Merge upstream changes.
This commit is contained in:
parent
030818f448
commit
925221c9fa
2 changed files with 9 additions and 26 deletions
27
src/cursor.c
27
src/cursor.c
|
|
@ -611,7 +611,6 @@ static PyObject *
|
|||
pysqlite_cursor_executescript(pysqlite_Cursor* self, PyObject* args)
|
||||
{
|
||||
PyObject* script_obj;
|
||||
PyObject* script_str = NULL;
|
||||
const char* script_cstr;
|
||||
sqlite3_stmt* statement;
|
||||
int rc;
|
||||
|
|
@ -685,8 +684,6 @@ pysqlite_cursor_executescript(pysqlite_Cursor* self, PyObject* args)
|
|||
}
|
||||
|
||||
error:
|
||||
Py_XDECREF(script_str);
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
return NULL;
|
||||
} else {
|
||||
|
|
@ -773,7 +770,7 @@ PyObject* pysqlite_cursor_fetchone(pysqlite_Cursor* self, PyObject* args)
|
|||
|
||||
PyObject* pysqlite_cursor_fetchmany(pysqlite_Cursor* self, PyObject* args, PyObject* kwargs)
|
||||
{
|
||||
static char *kwlist[] = {"size", NULL, NULL};
|
||||
static char *kwlist[] = {"size", NULL};
|
||||
|
||||
PyObject* row;
|
||||
PyObject* list;
|
||||
|
|
@ -789,17 +786,9 @@ PyObject* pysqlite_cursor_fetchmany(pysqlite_Cursor* self, PyObject* args, PyObj
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* just make sure we enter the loop */
|
||||
row = Py_None;
|
||||
|
||||
while (row) {
|
||||
row = pysqlite_cursor_iternext(self);
|
||||
if (row) {
|
||||
while ((row = pysqlite_cursor_iternext(self))) {
|
||||
PyList_Append(list, row);
|
||||
Py_DECREF(row);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
Py_XDECREF(row);
|
||||
|
||||
if (++counter == maxrows) {
|
||||
break;
|
||||
|
|
@ -824,15 +813,9 @@ PyObject* pysqlite_cursor_fetchall(pysqlite_Cursor* self, PyObject* args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* just make sure we enter the loop */
|
||||
row = (PyObject*)Py_None;
|
||||
|
||||
while (row) {
|
||||
row = pysqlite_cursor_iternext(self);
|
||||
if (row) {
|
||||
while ((row = pysqlite_cursor_iternext(self))) {
|
||||
PyList_Append(list, row);
|
||||
Py_DECREF(row);
|
||||
}
|
||||
Py_XDECREF(row);
|
||||
}
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ RAM instead of on disk.");
|
|||
static PyObject* module_complete(PyObject* self, PyObject* args, PyObject*
|
||||
kwargs)
|
||||
{
|
||||
static char *kwlist[] = {"statement", NULL, NULL};
|
||||
static char *kwlist[] = {"statement", NULL};
|
||||
char* statement;
|
||||
|
||||
PyObject* result;
|
||||
|
|
@ -135,7 +135,7 @@ Checks if a string contains a complete SQL statement. Non-standard.");
|
|||
static PyObject* module_enable_shared_cache(PyObject* self, PyObject* args, PyObject*
|
||||
kwargs)
|
||||
{
|
||||
static char *kwlist[] = {"do_enable", NULL, NULL};
|
||||
static char *kwlist[] = {"do_enable", NULL};
|
||||
int do_enable;
|
||||
int rc;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue