LCOV - code coverage report
Current view: top level - clients/odbc/driver - SQLBulkOperations.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 25 0.0 %
Date: 2021-10-13 02:24:04 Functions: 0 1 0.0 %

          Line data    Source code
       1             : /*
       2             :  * This Source Code Form is subject to the terms of the Mozilla Public
       3             :  * License, v. 2.0.  If a copy of the MPL was not distributed with this
       4             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       5             :  *
       6             :  * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V.
       7             :  */
       8             : 
       9             : /*
      10             :  * This code was created by Peter Harvey (mostly during Christmas 98/99).
      11             :  * This code is LGPL. Please ensure that this message remains in future
      12             :  * distributions and uses of this code (thats about all I get out of it).
      13             :  * - Peter Harvey pharvey@codebydesign.com
      14             :  *
      15             :  * This file has been modified for the MonetDB project.  See the file
      16             :  * Copyright in this directory for more information.
      17             :  */
      18             : 
      19             : /**********************************************************************
      20             :  * SQLBulkOperations()
      21             :  * CLI Compliance: ODBC (Microsoft)
      22             :  *
      23             :  * Note: this function is not supported (yet), it returns error IM001.
      24             :  *
      25             :  * Author: Martin van Dinther, Sjoerd Mullender
      26             :  * Date  : 30 Aug 2002
      27             :  *
      28             :  **********************************************************************/
      29             : 
      30             : #include "ODBCGlobal.h"
      31             : #include "ODBCStmt.h"
      32             : 
      33             : 
      34             : #ifdef ODBCDEBUG
      35             : static char *
      36           0 : translateOperation(SQLSMALLINT Operation)
      37             : {
      38           0 :         switch (Operation) {
      39             :         case SQL_ADD:
      40             :                 return "SQL_ADD";
      41           0 :         case SQL_UPDATE_BY_BOOKMARK:
      42           0 :                 return "SQL_UPDATE_BY_BOOKMARK";
      43           0 :         case SQL_DELETE_BY_BOOKMARK:
      44           0 :                 return "SQL_DELETE_BY_BOOKMARK";
      45           0 :         case SQL_FETCH_BY_BOOKMARK:
      46           0 :                 return "SQL_FETCH_BY_BOOKMARK";
      47           0 :         default:
      48           0 :                 return "invalid";
      49             :         }
      50             : }
      51             : #endif
      52             : 
      53             : SQLRETURN SQL_API
      54             : SQLBulkOperations(SQLHSTMT StatementHandle,
      55             :                   SQLSMALLINT Operation)
      56             : {
      57             :         ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
      58             : 
      59             : #ifdef ODBCDEBUG
      60           0 :         ODBCLOG("SQLBulkOperations %p %s\n",
      61             :                 StatementHandle, translateOperation(Operation));
      62             : #endif
      63             : 
      64           0 :         if (!isValidStmt(stmt))
      65             :                  return SQL_INVALID_HANDLE;
      66             : 
      67           0 :         clearStmtErrors(stmt);
      68             : 
      69           0 :         if (stmt->State < EXECUTED0 || stmt->State == EXTENDEDFETCHED) {
      70             :                 /* Function sequence error */
      71           0 :                 addStmtError(stmt, "HY010", NULL, 0);
      72           0 :                 return SQL_ERROR;
      73             :         }
      74           0 :         if (stmt->State == EXECUTED0) {
      75             :                 /* Invalid cursor state */
      76           0 :                 addStmtError(stmt, "24000", NULL, 0);
      77           0 :                 return SQL_ERROR;
      78             :         }
      79             : 
      80             :         /* check Operation code */
      81           0 :         switch (Operation) {
      82             :         case SQL_ADD:
      83             :         case SQL_UPDATE_BY_BOOKMARK:
      84             :         case SQL_DELETE_BY_BOOKMARK:
      85             :         case SQL_FETCH_BY_BOOKMARK:
      86             :                 break;
      87           0 :         default:
      88             :                 /* Invalid attribute/option identifier */
      89           0 :                 addStmtError(stmt, "HY092", NULL, 0);
      90           0 :                 return SQL_ERROR;
      91             :         }
      92             : 
      93             :         /* TODO: finish implementation */
      94             : 
      95             :         /* Driver does not support this function */
      96           0 :         addStmtError(stmt, "IM001", NULL, 0);
      97           0 :         return SQL_ERROR;
      98             : }

Generated by: LCOV version 1.14