File tree Expand file tree Collapse file tree 11 files changed +55
-6
lines changed
SQLite3MultipleCiphers/src Expand file tree Collapse file tree 11 files changed +55
-6
lines changed Original file line number Diff line number Diff line change @@ -92309,10 +92309,13 @@ SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){
9230992309 if( vdbeSafetyNotNull(v) ){
9231092310 return SQLITE_MISUSE_BKPT;
9231192311 }
92312+ db = v->db;
9231292313 if( v->isInterrupted ){
92313- return SQLITE_INTERRUPT;
92314+ rc = SQLITE_INTERRUPT;
92315+ v->rc = rc;
92316+ db->errCode = rc;
92317+ return rc;
9231492318 }
92315- db = v->db;
9231692319 sqlite3_mutex_enter(db->mutex);
9231792320 while( (rc = sqlite3Step(v))==SQLITE_SCHEMA
9231892321 && cnt++ < SQLITE_MAX_SCHEMA_RETRY ){
Original file line number Diff line number Diff line change @@ -1555,6 +1555,9 @@ extern "C" {
15551555extern "C" {
15561556 pub fn sqlite3_reset ( pStmt : * mut sqlite3_stmt ) -> :: std:: os:: raw:: c_int ;
15571557}
1558+ extern "C" {
1559+ pub fn libsql_stmt_interrupt ( stmt : * mut sqlite3_stmt ) ;
1560+ }
15581561extern "C" {
15591562 pub fn sqlite3_create_function (
15601563 db : * mut sqlite3 ,
Original file line number Diff line number Diff line change @@ -92309,10 +92309,13 @@ SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){
9230992309 if( vdbeSafetyNotNull(v) ){
9231092310 return SQLITE_MISUSE_BKPT;
9231192311 }
92312+ db = v->db;
9231292313 if( v->isInterrupted ){
92313- return SQLITE_INTERRUPT;
92314+ rc = SQLITE_INTERRUPT;
92315+ v->rc = rc;
92316+ db->errCode = rc;
92317+ return rc;
9231492318 }
92315- db = v->db;
9231692319 sqlite3_mutex_enter(db->mutex);
9231792320 while( (rc = sqlite3Step(v))==SQLITE_SCHEMA
9231892321 && cnt++ < SQLITE_MAX_SCHEMA_RETRY ){
Original file line number Diff line number Diff 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 ){
Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ impl Statement {
8282 unsafe { crate :: ffi:: sqlite3_step ( self . raw_stmt ) }
8383 }
8484
85+ pub fn interrupt ( & self ) {
86+ unsafe { crate :: ffi:: libsql_stmt_interrupt ( self . raw_stmt ) }
87+ }
88+
8589 pub fn reset ( & self ) -> std:: ffi:: c_int {
8690 unsafe { crate :: ffi:: sqlite3_reset ( self . raw_stmt ) }
8791 }
Original file line number Diff line number Diff line change @@ -205,6 +205,12 @@ impl crate::statement::Stmt for crate::hrana::Statement<HttpSender> {
205205 self . run ( params) . await
206206 }
207207
208+ fn interrupt ( & mut self ) -> crate :: Result < ( ) > {
209+ Err ( crate :: Error :: Misuse (
210+ "interrupt is not supported for remote connections" . to_string ( ) ,
211+ ) )
212+ }
213+
208214 fn reset ( & mut self ) { }
209215
210216 fn parameter_count ( & self ) -> usize {
Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ impl Stmt for LibsqlStmt {
120120 stmt. run ( & params)
121121 }
122122
123+ fn interrupt ( & mut self ) -> Result < ( ) > {
124+ self . 0 . interrupt ( )
125+ }
126+
123127 fn reset ( & mut self ) {
124128 self . 0 . reset ( ) ;
125129 }
Original file line number Diff line number Diff line change @@ -134,6 +134,12 @@ impl Statement {
134134 }
135135 }
136136
137+ /// Interrupt the statement.
138+ pub fn interrupt ( & self ) -> Result < ( ) > {
139+ self . inner . interrupt ( ) ;
140+ Ok ( ( ) )
141+ }
142+
137143 /// Reset the prepared statement to initial state for reuse.
138144 pub fn reset ( & self ) {
139145 self . inner . reset ( ) ;
Original file line number Diff line number Diff line change @@ -732,6 +732,12 @@ impl Stmt for RemoteStatement {
732732 Ok ( ( ) )
733733 }
734734
735+ fn interrupt ( & mut self ) -> Result < ( ) > {
736+ Err ( Error :: Misuse (
737+ "interrupt is not supported for remote connections" . to_string ( ) ,
738+ ) )
739+ }
740+
735741 fn reset ( & mut self ) { }
736742
737743 fn parameter_count ( & self ) -> usize {
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ pub(crate) trait Stmt {
1414
1515 async fn run ( & mut self , params : & Params ) -> Result < ( ) > ;
1616
17+ fn interrupt ( & mut self ) -> Result < ( ) > ;
18+
1719 fn reset ( & mut self ) ;
1820
1921 fn parameter_count ( & self ) -> usize ;
@@ -60,6 +62,11 @@ impl Statement {
6062 Ok ( ( ) )
6163 }
6264
65+ /// Interrupt the statement.
66+ pub fn interrupt ( & mut self ) -> Result < ( ) > {
67+ self . inner . interrupt ( )
68+ }
69+
6370 /// Execute a query that returns the first [`Row`].
6471 ///
6572 /// # Errors
You can’t perform that action at this time.
0 commit comments