mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Fix cases where modifying bound variables using the clear_bindings() or transfer_bindings() APIs can invalidate a query plan.
FossilOrigin-Name: e6808c988c9cd7b2db23f18b5fe2177151b6f586
This commit is contained in:
@@ -99,6 +99,9 @@ int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
|
||||
sqlite3VdbeMemRelease(&p->aVar[i]);
|
||||
p->aVar[i].flags = MEM_Null;
|
||||
}
|
||||
if( p->isPrepareV2 && p->expmask ){
|
||||
p->expired = 1;
|
||||
}
|
||||
sqlite3_mutex_leave(mutex);
|
||||
return rc;
|
||||
}
|
||||
@@ -1173,6 +1176,12 @@ int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
|
||||
if( pFrom->nVar!=pTo->nVar ){
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
if( pTo->isPrepareV2 && pTo->expmask ){
|
||||
pTo->expired = 1;
|
||||
}
|
||||
if( pFrom->isPrepareV2 && pFrom->expmask ){
|
||||
pFrom->expired = 1;
|
||||
}
|
||||
return sqlite3TransferBindings(pFromStmt, pToStmt);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user