aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeapi.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-06-19 02:52:25 +0000
committerdrh <drh@noemail.net>2008-06-19 02:52:25 +0000
commitbb5a9c3eea276ff67a2823df1cad92a3af1be354 (patch)
tree2126114665d735b59bd39cdf5b2306a5c0e6d66c /src/vdbeapi.c
parent8c4d6b97e0f76248b26442237c758e3f55c2b904 (diff)
downloadsqlite-bb5a9c3eea276ff67a2823df1cad92a3af1be354.tar.gz
sqlite-bb5a9c3eea276ff67a2823df1cad92a3af1be354.zip
Add the sqlite3_next_stmt() interface, including test cases. (CVS 5243)
FossilOrigin-Name: 565a530896b40790287eeaad709edd51980fbddf
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r--src/vdbeapi.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 8fc3987c6..fea540f43 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -13,7 +13,7 @@
** This file contains code use to implement APIs that are part of the
** VDBE.
**
-** $Id: vdbeapi.c,v 1.133 2008/06/18 17:09:10 danielk1977 Exp $
+** $Id: vdbeapi.c,v 1.134 2008/06/19 02:52:25 drh Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
@@ -1256,3 +1256,21 @@ int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
sqlite3 *sqlite3_db_handle(sqlite3_stmt *pStmt){
return pStmt ? ((Vdbe*)pStmt)->db : 0;
}
+
+/*
+** Return a pointer to the next prepared statement after pStmt associated
+** with database connection pDb. If pStmt is NULL, return the first
+** prepared statement for the database connection. Return NULL if there
+** are no more.
+*/
+sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
+ sqlite3_stmt *pNext;
+ sqlite3_mutex_enter(pDb->mutex);
+ if( pStmt==0 ){
+ pNext = (sqlite3_stmt*)pDb->pVdbe;
+ }else{
+ pNext = (sqlite3_stmt*)((Vdbe*)pStmt)->pNext;
+ }
+ sqlite3_mutex_leave(pDb->mutex);
+ return pNext;
+}