@@ -130,14 +130,10 @@ stmt_reset(pysqlite_Statement *self)
130
130
{
131
131
int rc = SQLITE_OK ;
132
132
133
- if (self -> in_use && self -> st ) {
133
+ if (self -> st != NULL ) {
134
134
Py_BEGIN_ALLOW_THREADS
135
135
rc = sqlite3_reset (self -> st );
136
136
Py_END_ALLOW_THREADS
137
-
138
- if (rc == SQLITE_OK ) {
139
- self -> in_use = 0 ;
140
- }
141
137
}
142
138
143
139
return rc ;
@@ -770,12 +766,6 @@ bind_parameters(pysqlite_state *state, pysqlite_Statement *self,
770
766
}
771
767
}
772
768
773
- static inline void
774
- stmt_mark_dirty (pysqlite_Statement * self )
775
- {
776
- self -> in_use = 1 ;
777
- }
778
-
779
769
PyObject *
780
770
_pysqlite_query_execute (pysqlite_Cursor * self , int multiple , PyObject * operation , PyObject * second_argument )
781
771
{
@@ -852,16 +842,15 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation
852
842
goto error ;
853
843
}
854
844
855
- if (self -> statement -> in_use ) {
845
+ if (sqlite3_stmt_busy ( self -> statement -> st ) ) {
856
846
Py_SETREF (self -> statement ,
857
847
pysqlite_statement_create (self -> connection , operation ));
858
848
if (self -> statement == NULL ) {
859
849
goto error ;
860
850
}
861
851
}
862
852
863
- stmt_reset (self -> statement );
864
- stmt_mark_dirty (self -> statement );
853
+ (void )stmt_reset (self -> statement );
865
854
self -> rowcount = self -> statement -> is_dml ? 0L : -1L ;
866
855
867
856
/* We start a transaction implicitly before a DML statement.
@@ -882,8 +871,6 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation
882
871
break ;
883
872
}
884
873
885
- stmt_mark_dirty (self -> statement );
886
-
887
874
bind_parameters (state , self -> statement , parameters );
888
875
if (PyErr_Occurred ()) {
889
876
goto error ;
0 commit comments