LCOV - code coverage report
Current view: top level - clients/odbc/driver - SQLBulkOperations.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 27 0.0 %
Date: 2024-12-19 20:05:57 Functions: 0 1 0.0 %

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

Generated by: LCOV version 1.14