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 (thats 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 : * SQLCancel() 25 : * CLI Compliance: ISO 92 26 : **********************************************************************/ 27 : 28 : #include "ODBCGlobal.h" 29 : #include "ODBCStmt.h" 30 : #include "ODBCDbc.h" 31 : #include "ODBCEnv.h" 32 : 33 : SQLRETURN SQL_API 34 : SQLCancel(SQLHSTMT StatementHandle) 35 : { 36 0 : ODBCStmt *stmt = (ODBCStmt *) StatementHandle; 37 : 38 : #ifdef ODBCDEBUG 39 0 : ODBCLOG("SQLCancel %p\n", StatementHandle); 40 : #endif 41 : 42 0 : if (!isValidStmt(stmt)) 43 : return SQL_INVALID_HANDLE; 44 : 45 0 : clearStmtErrors(stmt); 46 : 47 0 : if (stmt->Dbc->Env->sql_attr_odbc_version == SQL_OV_ODBC2) 48 0 : return MNDBFreeStmt(stmt, SQL_CLOSE); 49 : return SQL_SUCCESS; 50 : }