mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Forward port r64930.
Fix one more case in cursor.c.
This commit is contained in:
parent
dff1834f45
commit
1839bac796
2 changed files with 14 additions and 25 deletions
|
@ -1,6 +1,6 @@
|
|||
/* cursor.c - the cursor type
|
||||
*
|
||||
* Copyright (C) 2004-2007 Gerhard Häring <gh@ghaering.de>
|
||||
* Copyright (C) 2004-2007 Gerhard Häring <gh@ghaering.de>
|
||||
*
|
||||
* This file is part of pysqlite.
|
||||
*
|
||||
|
@ -529,7 +529,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
|||
}
|
||||
rc = pysqlite_statement_create(self->statement, self->connection, operation);
|
||||
if (rc != SQLITE_OK) {
|
||||
self->statement = 0;
|
||||
Py_CLEAR(self->statement);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
@ -602,7 +602,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
|||
}
|
||||
rc = pysqlite_statement_create(self->statement, self->connection, operation);
|
||||
if (rc != SQLITE_OK) {
|
||||
self->statement = 0;
|
||||
Py_CLEAR(self->statement);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
@ -711,8 +711,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
|||
self->next_row = _pysqlite_fetch_one_row(self);
|
||||
} else if (rc == SQLITE_DONE && !multiple) {
|
||||
pysqlite_statement_reset(self->statement);
|
||||
Py_DECREF(self->statement);
|
||||
self->statement = 0;
|
||||
Py_CLEAR(self->statement);
|
||||
}
|
||||
|
||||
switch (statement_type) {
|
||||
|
@ -1013,8 +1012,7 @@ PyObject* pysqlite_cursor_close(pysqlite_Cursor* self, PyObject* args)
|
|||
|
||||
if (self->statement) {
|
||||
(void)pysqlite_statement_reset(self->statement);
|
||||
Py_DECREF(self->statement);
|
||||
self->statement = 0;
|
||||
Py_CLEAR(self->statement);
|
||||
}
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue