LCOV - code coverage report
Current view: top level - clients/odbc/driver - SQLMoreResults.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 16 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             :  * SQLMoreResults()
      21             :  * CLI Compliance: ODBC (Microsoft)
      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             : SQLMoreResults(SQLHSTMT StatementHandle)
      34             : {
      35             :         ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
      36             : 
      37             : #ifdef ODBCDEBUG
      38           0 :         ODBCLOG("SQLMoreResults %p\n", StatementHandle);
      39             : #endif
      40             : 
      41           0 :         if (!isValidStmt(stmt))
      42             :                  return SQL_INVALID_HANDLE;
      43             : 
      44           0 :         clearStmtErrors(stmt);
      45             : 
      46           0 :         if (stmt->State < EXECUTED0)
      47             :                 return SQL_NO_DATA;
      48             : 
      49           0 :         switch (mapi_next_result(stmt->hdl)) {
      50           0 :         case MOK:
      51           0 :                 stmt->State = stmt->queryid >= 0 ? (stmt->State == EXECUTED0 ? PREPARED0 : PREPARED1) : INITED;
      52           0 :                 return SQL_NO_DATA;
      53           0 :         case MERROR:
      54             :                 /* General error */
      55           0 :                 addStmtError(stmt, "HY000", mapi_error_str(stmt->Dbc->mid), 0);
      56           0 :                 return SQL_ERROR;
      57           0 :         case MTIMEOUT:
      58             :                 /* Timeout expired / Communication link failure */
      59           0 :                 addStmtError(stmt, stmt->Dbc->sql_attr_connection_timeout ? "HYT00" : "08S01", mapi_error_str(stmt->Dbc->mid), 0);
      60           0 :                 return SQL_ERROR;
      61           0 :         default:
      62           0 :                 return ODBCInitResult(stmt);
      63             :         }
      64             : }

Generated by: LCOV version 1.14