LCOV - code coverage report
Current view: top level - clients/odbc/driver - SQLSetStmtOption.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 10 0.0 %
Date: 2021-10-13 02:24:04 Functions: 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             :  * SQLSetStmtOption()
      21             :  * CLI Compliance: deprecated in ODBC 3.0 (replaced by SQLSetStmtAttr())
      22             :  * Provided here for old (pre ODBC 3.0) applications and driver managers.
      23             :  *
      24             :  * Author: Martin van Dinther, Sjoerd Mullender
      25             :  * Date  : 30 aug 2002
      26             :  *
      27             :  **********************************************************************/
      28             : 
      29             : #include "ODBCGlobal.h"
      30             : #include "ODBCStmt.h"
      31             : 
      32             : SQLRETURN SQL_API
      33             : SQLSetStmtOption(SQLHSTMT StatementHandle,
      34             :                  SQLUSMALLINT Option,
      35             :                  SQLULEN ValuePtr)
      36             : {
      37             :         ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
      38             : 
      39             : #ifdef ODBCDEBUG
      40           0 :         ODBCLOG("SQLSetStmtOption %p %s " ULENFMT "\n",
      41             :                 StatementHandle, translateStmtOption(Option),
      42             :                 ULENCAST ValuePtr);
      43             : #endif
      44             : 
      45           0 :         if (!isValidStmt(stmt))
      46             :                  return SQL_INVALID_HANDLE;
      47             : 
      48           0 :         clearStmtErrors(stmt);
      49             : 
      50           0 :         switch (Option) {
      51             :                 /* only the ODBC 1.0 and ODBC 2.0 options */
      52           0 :         case SQL_ROWSET_SIZE:
      53             :                 Option = SQL_ATTR_ROW_ARRAY_SIZE;
      54             :                 /* fall through */
      55           0 :         case SQL_QUERY_TIMEOUT:
      56             :         case SQL_MAX_ROWS:
      57             :         case SQL_NOSCAN:
      58             :         case SQL_MAX_LENGTH:
      59             :         case SQL_ASYNC_ENABLE:
      60             :         case SQL_BIND_TYPE:
      61             :         case SQL_CURSOR_TYPE:
      62             :         case SQL_CONCURRENCY:
      63             :         case SQL_KEYSET_SIZE:
      64             :         case SQL_SIMULATE_CURSOR:
      65             :         case SQL_RETRIEVE_DATA:
      66             :         case SQL_USE_BOOKMARKS:
      67             :                 /* use mapping as described in ODBC 3.0 SDK Help */
      68           0 :                 return MNDBSetStmtAttr(stmt,
      69             :                                        Option,
      70             :                                        (SQLPOINTER) (uintptr_t) ValuePtr,
      71             :                                        SQL_NTS);
      72           0 :         default:
      73             :                 /* Invalid attribute/option identifier */
      74           0 :                 addStmtError(stmt, "HY092", NULL, 0);
      75             :                 break;
      76             :         }
      77             : 
      78           0 :         return SQL_ERROR;
      79             : }

Generated by: LCOV version 1.14