File tree 3 files changed +18
-0
lines changed
3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -5390,6 +5390,8 @@ int sqlite3_finalize(sqlite3_stmt *pStmt);
5390
5390
int sqlite3_reset(sqlite3_stmt *pStmt);
5391
5391
5392
5392
5393
+ void libsql_stmt_interrupt(sqlite3_stmt *stmt);
5394
+
5393
5395
/*
5394
5396
** CAPI3REF: Create Or Redefine SQL Functions
5395
5397
** KEYWORDS: {function creation routines}
Original file line number Diff line number Diff line change @@ -528,6 +528,7 @@ struct Vdbe {
528
528
int nScan ; /* Entries in aScan[] */
529
529
ScanStatus * aScan ; /* Scan definitions for sqlite3_stmt_scanstatus() */
530
530
#endif
531
+ u8 isInterrupted ; /* True if the statement has been interrupted */
531
532
};
532
533
533
534
void libsql_inc_row_read (Vdbe * p , int count );
Original file line number Diff line number Diff line change @@ -888,6 +888,18 @@ static int sqlite3Step(Vdbe *p){
888
888
return (rc & db -> errMask );
889
889
}
890
890
891
+ /*
892
+ ** Interrupt the statement.
893
+ */
894
+ void libsql_stmt_interrupt (sqlite3_stmt * pStmt ){
895
+ Vdbe * v = (Vdbe * )pStmt ; /* the prepared statement */
896
+ if ( vdbeSafetyNotNull (v ) ){
897
+ (void )SQLITE_MISUSE_BKPT ;
898
+ return ;
899
+ }
900
+ v -> isInterrupted = 1 ;
901
+ }
902
+
891
903
/*
892
904
** This is the top-level implementation of sqlite3_step(). Call
893
905
** sqlite3Step() to do most of the work. If a schema error occurs,
@@ -902,6 +914,9 @@ int sqlite3_step(sqlite3_stmt *pStmt){
902
914
if ( vdbeSafetyNotNull (v ) ){
903
915
return SQLITE_MISUSE_BKPT ;
904
916
}
917
+ if ( v -> isInterrupted ){
918
+ return SQLITE_INTERRUPT ;
919
+ }
905
920
db = v -> db ;
906
921
sqlite3_mutex_enter (db -> mutex );
907
922
while ( (rc = sqlite3Step (v ))== SQLITE_SCHEMA
You can’t perform that action at this time.
0 commit comments