Skip to content

Commit a07b9b1

Browse files
committed
libsql-sqlite3: Fix statement interruption signaling
We need to set some database and statement state to propagate the interrupt error correctly.
1 parent ed837f0 commit a07b9b1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libsql-sqlite3/src/vdbeapi.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,10 +914,13 @@ int sqlite3_step(sqlite3_stmt *pStmt){
914914
if( vdbeSafetyNotNull(v) ){
915915
return SQLITE_MISUSE_BKPT;
916916
}
917+
db = v->db;
917918
if( v->isInterrupted ){
918-
return SQLITE_INTERRUPT;
919+
rc = SQLITE_INTERRUPT;
920+
v->rc = rc;
921+
db->errCode = rc;
922+
return rc;
919923
}
920-
db = v->db;
921924
sqlite3_mutex_enter(db->mutex);
922925
while( (rc = sqlite3Step(v))==SQLITE_SCHEMA
923926
&& cnt++ < SQLITE_MAX_SCHEMA_RETRY ){

0 commit comments

Comments
 (0)