abortresultset.c

来自「适合于Unix/Linux下的一个持久数据库连接池」· C语言 代码 · 共 56 行

C
56
字号
// Copyright (c) 1999-2001  David Muse// See the file COPYING for more information#include <config.h>#include <sqlrelay/sqlrclient.h>#include <defines.h>void sqlrcursor::abortResultSet() {	// If the end of the previous result set was never reached, abort it.	// If we're caching data to a local file, get the rest of the data; we	// won't have to abort the result set in that case, the server will	// do it.	if (sqlrc->debug) {		sqlrc->debugPreStart();		sqlrc->debugPrint("Aborting Result Set For Cursor: ");		sqlrc->debugPrint((int64_t)cursorid);		sqlrc->debugPrint("\n");		sqlrc->debugPreEnd();	}	if (sqlrc->connected || cached) {		if (cachedest && cachedestind) {			if (sqlrc->debug) {				sqlrc->debugPreStart();				sqlrc->debugPrint("Getting the rest of the result set, since this is a cached result set.\n");				sqlrc->debugPreEnd();			}			while (!endofresultset) {				clearRows();				// if we're not fetching from a cached result 				// set tell the server to send one 				if (!cachesource && !cachesourceind) {					sqlrc->cs->write((uint16_t)							FETCH_RESULT_SET);					sqlrc->cs->write(cursorid);				}				// parseData should call finishCaching when				// it hits the end of the result set, but				// if it or skipAndFetch return a -1 (network				// error) we'll have to call it ourselves.				if (!skipAndFetch(true,0) || !parseData()) {					finishCaching();					return;				}			}		} else {			sqlrc->cs->write((uint16_t)ABORT_RESULT_SET);			sqlrc->cs->write(cursorid);			sqlrc->flushWriteBuffer();		}	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?