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){
92309
92309
if( vdbeSafetyNotNull(v) ){
92310
92310
return SQLITE_MISUSE_BKPT;
92311
92311
}
92312
+ db = v->db;
92312
92313
if( v->isInterrupted ){
92313
- return SQLITE_INTERRUPT;
92314
+ rc = SQLITE_INTERRUPT;
92315
+ v->rc = rc;
92316
+ db->errCode = rc;
92317
+ return rc;
92314
92318
}
92315
- db = v->db;
92316
92319
sqlite3_mutex_enter(db->mutex);
92317
92320
while( (rc = sqlite3Step(v))==SQLITE_SCHEMA
92318
92321
&& cnt++ < SQLITE_MAX_SCHEMA_RETRY ){
Original file line number Diff line number Diff line change @@ -1555,6 +1555,9 @@ extern "C" {
1555
1555
extern "C" {
1556
1556
pub fn sqlite3_reset ( pStmt : * mut sqlite3_stmt ) -> :: std:: os:: raw:: c_int ;
1557
1557
}
1558
+ extern "C" {
1559
+ pub fn libsql_stmt_interrupt ( stmt : * mut sqlite3_stmt ) ;
1560
+ }
1558
1561
extern "C" {
1559
1562
pub fn sqlite3_create_function (
1560
1563
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){
92309
92309
if( vdbeSafetyNotNull(v) ){
92310
92310
return SQLITE_MISUSE_BKPT;
92311
92311
}
92312
+ db = v->db;
92312
92313
if( v->isInterrupted ){
92313
- return SQLITE_INTERRUPT;
92314
+ rc = SQLITE_INTERRUPT;
92315
+ v->rc = rc;
92316
+ db->errCode = rc;
92317
+ return rc;
92314
92318
}
92315
- db = v->db;
92316
92319
sqlite3_mutex_enter(db->mutex);
92317
92320
while( (rc = sqlite3Step(v))==SQLITE_SCHEMA
92318
92321
&& 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){
914
914
if ( vdbeSafetyNotNull (v ) ){
915
915
return SQLITE_MISUSE_BKPT ;
916
916
}
917
+ db = v -> db ;
917
918
if ( v -> isInterrupted ){
918
- return SQLITE_INTERRUPT ;
919
+ rc = SQLITE_INTERRUPT ;
920
+ v -> rc = rc ;
921
+ db -> errCode = rc ;
922
+ return rc ;
919
923
}
920
- db = v -> db ;
921
924
sqlite3_mutex_enter (db -> mutex );
922
925
while ( (rc = sqlite3Step (v ))== SQLITE_SCHEMA
923
926
&& cnt ++ < SQLITE_MAX_SCHEMA_RETRY ){
Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ impl Statement {
82
82
unsafe { crate :: ffi:: sqlite3_step ( self . raw_stmt ) }
83
83
}
84
84
85
+ pub fn interrupt ( & self ) {
86
+ unsafe { crate :: ffi:: libsql_stmt_interrupt ( self . raw_stmt ) }
87
+ }
88
+
85
89
pub fn reset ( & self ) -> std:: ffi:: c_int {
86
90
unsafe { crate :: ffi:: sqlite3_reset ( self . raw_stmt ) }
87
91
}
Original file line number Diff line number Diff line change @@ -205,6 +205,12 @@ impl crate::statement::Stmt for crate::hrana::Statement<HttpSender> {
205
205
self . run ( params) . await
206
206
}
207
207
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
+
208
214
fn reset ( & mut self ) { }
209
215
210
216
fn parameter_count ( & self ) -> usize {
Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ impl Stmt for LibsqlStmt {
120
120
stmt. run ( & params)
121
121
}
122
122
123
+ fn interrupt ( & mut self ) -> Result < ( ) > {
124
+ self . 0 . interrupt ( )
125
+ }
126
+
123
127
fn reset ( & mut self ) {
124
128
self . 0 . reset ( ) ;
125
129
}
Original file line number Diff line number Diff line change @@ -134,6 +134,12 @@ impl Statement {
134
134
}
135
135
}
136
136
137
+ /// Interrupt the statement.
138
+ pub fn interrupt ( & self ) -> Result < ( ) > {
139
+ self . inner . interrupt ( ) ;
140
+ Ok ( ( ) )
141
+ }
142
+
137
143
/// Reset the prepared statement to initial state for reuse.
138
144
pub fn reset ( & self ) {
139
145
self . inner . reset ( ) ;
Original file line number Diff line number Diff line change @@ -732,6 +732,12 @@ impl Stmt for RemoteStatement {
732
732
Ok ( ( ) )
733
733
}
734
734
735
+ fn interrupt ( & mut self ) -> Result < ( ) > {
736
+ Err ( Error :: Misuse (
737
+ "interrupt is not supported for remote connections" . to_string ( ) ,
738
+ ) )
739
+ }
740
+
735
741
fn reset ( & mut self ) { }
736
742
737
743
fn parameter_count ( & self ) -> usize {
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ pub(crate) trait Stmt {
14
14
15
15
async fn run ( & mut self , params : & Params ) -> Result < ( ) > ;
16
16
17
+ fn interrupt ( & mut self ) -> Result < ( ) > ;
18
+
17
19
fn reset ( & mut self ) ;
18
20
19
21
fn parameter_count ( & self ) -> usize ;
@@ -60,6 +62,11 @@ impl Statement {
60
62
Ok ( ( ) )
61
63
}
62
64
65
+ /// Interrupt the statement.
66
+ pub fn interrupt ( & mut self ) -> Result < ( ) > {
67
+ self . inner . interrupt ( )
68
+ }
69
+
63
70
/// Execute a query that returns the first [`Row`].
64
71
///
65
72
/// # Errors
You can’t perform that action at this time.
0 commit comments