This repository was archived by the owner on Jul 11, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ impl<'a> fmt::Display for MultiStatement {
4040
4141pub struct Statement {
4242 stmt : * mut ffi:: sqlite3_stmt ,
43+ //stmt: ptr::NonNull<ffi::sqlite3_stmt>,
4344}
4445
4546unsafe impl Send for Statement { }
@@ -87,10 +88,13 @@ pub fn generate_statements(
8788 & mut next_query,
8889 )
8990 } ;
91+
9092 match r {
9193 ffi:: SQLITE_OK => {
92- let stmt = Statement { stmt } ;
93- stmts. push ( stmt) ;
94+ if !stmt. is_null ( ) {
95+ let stmt = Statement { stmt } ;
96+ stmts. push ( stmt) ;
97+ }
9498 if unsafe { * next_query } == 0 {
9599 let ( num_parameters, parameters) =
96100 count_parameters ( & stmts) ?;
@@ -100,7 +104,7 @@ pub fn generate_statements(
100104 number_parameters : num_parameters,
101105 _parameters : parameters,
102106 } ) ;
103- }
107+ } ;
104108 }
105109 _ => return Err ( conn. get_last_error ( ) ) ,
106110 }
You can’t perform that action at this time.
0 commit comments