1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Remove some vestigal code. Add the experimental sqlite3_transfer_bindings()

API. (CVS 2446)

FossilOrigin-Name: 88b39436f00d645cdb6333a7413c698c42227d3f
This commit is contained in:
drh
2005-04-22 02:38:37 +00:00
parent b47d45ccbf
commit f8db1bc03b
13 changed files with 167 additions and 38 deletions

View File

@@ -622,3 +622,26 @@ int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
}
return 0;
}
/* EXPERIMENTAL
**
** Transfer all bindings from the first statement over to the second.
** If the two statements contain a different number of bindings, then
** an SQLITE_ERROR is returned.
*/
int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
Vdbe *pFrom = (Vdbe*)pFromStmt;
Vdbe *pTo = (Vdbe*)pToStmt;
int i, rc = SQLITE_OK;
if( (pFrom->magic!=VDBE_MAGIC_RUN && pFrom->magic!=VDBE_MAGIC_HALT)
|| (pTo->magic!=VDBE_MAGIC_RUN && pTo->magic!=VDBE_MAGIC_HALT) ){
return SQLITE_MISUSE;
}
if( pFrom->nVar!=pTo->nVar ){
return SQLITE_ERROR;
}
for(i=0; rc==SQLITE_OK && i<pFrom->nVar; i++){
rc = sqlite3VdbeMemMove(&pTo->aVar[i], &pFrom->aVar[i]);
}
return rc;
}