LCOV - code coverage report
Current view: top level - clients/odbc/driver - SQLRowCount.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 11 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             :  * SQLRowCount()
      21             :  * CLI Compliance: ISO 92
      22             :  *
      23             :  * Author: Martin van Dinther, Sjoerd Mullender
      24             :  * Date  : 30 aug 2002
      25             :  *
      26             :  **********************************************************************/
      27             : 
      28             : #include "ODBCGlobal.h"
      29             : #include "ODBCStmt.h"
      30             : 
      31             : 
      32             : SQLRETURN SQL_API
      33             : SQLRowCount(SQLHSTMT StatementHandle,
      34             :             SQLLEN *RowCountPtr)
      35             : {
      36             :         ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
      37             : 
      38             : #ifdef ODBCDEBUG
      39           0 :         ODBCLOG("SQLRowCount %p\n", StatementHandle);
      40             : #endif
      41             : 
      42           0 :         if (!isValidStmt(stmt))
      43             :                  return SQL_INVALID_HANDLE;
      44             : 
      45           0 :         clearStmtErrors(stmt);
      46             : 
      47             :         /* check statement cursor state, query should be executed */
      48           0 :         if (stmt->State < EXECUTED0) {
      49             :                 /* Function sequence error */
      50           0 :                 addStmtError(stmt, "HY010", NULL, 0);
      51           0 :                 return SQL_ERROR;
      52             :         }
      53             : 
      54             :         /* check output parameter */
      55           0 :         if (RowCountPtr == NULL) {
      56             :                 /* Invalid use of null pointer */
      57           0 :                 addStmtError(stmt, "HY009", NULL, 0);
      58           0 :                 return SQL_ERROR;
      59             :         }
      60             : 
      61             :         /* We can now set the "number of result set rows" value */
      62           0 :         *RowCountPtr = (SQLLEN) stmt->rowcount;
      63             : 
      64           0 :         return SQL_SUCCESS;
      65             : }

Generated by: LCOV version 1.14