Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1839bac7
Commit
1839bac7
authored
Jul 13, 2008
by
Alexandre Vassalotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forward port r64930.
Fix one more case in cursor.c.
parent
dff1834f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
25 deletions
+14
-25
Modules/_sqlite/connection.c
Modules/_sqlite/connection.c
+9
-18
Modules/_sqlite/cursor.c
Modules/_sqlite/cursor.c
+5
-7
No files found.
Modules/_sqlite/connection.c
View file @
1839bac7
...
@@ -944,19 +944,16 @@ PyObject* pysqlite_connection_call(pysqlite_Connection* self, PyObject* args, Py
...
@@ -944,19 +944,16 @@ PyObject* pysqlite_connection_call(pysqlite_Connection* self, PyObject* args, Py
_pysqlite_seterror
(
self
->
db
,
NULL
);
_pysqlite_seterror
(
self
->
db
,
NULL
);
}
}
Py_DECREF
(
statement
);
Py_CLEAR
(
statement
);
statement
=
0
;
}
else
{
}
else
{
weakref
=
PyWeakref_NewRef
((
PyObject
*
)
statement
,
NULL
);
weakref
=
PyWeakref_NewRef
((
PyObject
*
)
statement
,
NULL
);
if
(
!
weakref
)
{
if
(
!
weakref
)
{
Py_DECREF
(
statement
);
Py_CLEAR
(
statement
);
statement
=
0
;
goto
error
;
goto
error
;
}
}
if
(
PyList_Append
(
self
->
statements
,
weakref
)
!=
0
)
{
if
(
PyList_Append
(
self
->
statements
,
weakref
)
!=
0
)
{
Py_DECREF
(
weakref
);
Py_CLEAR
(
weakref
);
statement
=
0
;
goto
error
;
goto
error
;
}
}
...
@@ -980,15 +977,13 @@ PyObject* pysqlite_connection_execute(pysqlite_Connection* self, PyObject* args,
...
@@ -980,15 +977,13 @@ PyObject* pysqlite_connection_execute(pysqlite_Connection* self, PyObject* args,
method
=
PyObject_GetAttrString
(
cursor
,
"execute"
);
method
=
PyObject_GetAttrString
(
cursor
,
"execute"
);
if
(
!
method
)
{
if
(
!
method
)
{
Py_DECREF
(
cursor
);
Py_CLEAR
(
cursor
);
cursor
=
0
;
goto
error
;
goto
error
;
}
}
result
=
PyObject_CallObject
(
method
,
args
);
result
=
PyObject_CallObject
(
method
,
args
);
if
(
!
result
)
{
if
(
!
result
)
{
Py_DECREF
(
cursor
);
Py_CLEAR
(
cursor
);
cursor
=
0
;
}
}
error:
error:
...
@@ -1011,15 +1006,13 @@ PyObject* pysqlite_connection_executemany(pysqlite_Connection* self, PyObject* a
...
@@ -1011,15 +1006,13 @@ PyObject* pysqlite_connection_executemany(pysqlite_Connection* self, PyObject* a
method
=
PyObject_GetAttrString
(
cursor
,
"executemany"
);
method
=
PyObject_GetAttrString
(
cursor
,
"executemany"
);
if
(
!
method
)
{
if
(
!
method
)
{
Py_DECREF
(
cursor
);
Py_CLEAR
(
cursor
);
cursor
=
0
;
goto
error
;
goto
error
;
}
}
result
=
PyObject_CallObject
(
method
,
args
);
result
=
PyObject_CallObject
(
method
,
args
);
if
(
!
result
)
{
if
(
!
result
)
{
Py_DECREF
(
cursor
);
Py_CLEAR
(
cursor
);
cursor
=
0
;
}
}
error:
error:
...
@@ -1042,15 +1035,13 @@ PyObject* pysqlite_connection_executescript(pysqlite_Connection* self, PyObject*
...
@@ -1042,15 +1035,13 @@ PyObject* pysqlite_connection_executescript(pysqlite_Connection* self, PyObject*
method
=
PyObject_GetAttrString
(
cursor
,
"executescript"
);
method
=
PyObject_GetAttrString
(
cursor
,
"executescript"
);
if
(
!
method
)
{
if
(
!
method
)
{
Py_DECREF
(
cursor
);
Py_CLEAR
(
cursor
);
cursor
=
0
;
goto
error
;
goto
error
;
}
}
result
=
PyObject_CallObject
(
method
,
args
);
result
=
PyObject_CallObject
(
method
,
args
);
if
(
!
result
)
{
if
(
!
result
)
{
Py_DECREF
(
cursor
);
Py_CLEAR
(
cursor
);
cursor
=
0
;
}
}
error:
error:
...
...
Modules/_sqlite/cursor.c
View file @
1839bac7
/* cursor.c - the cursor type
/* cursor.c - the cursor type
*
*
* Copyright (C) 2004-2007 Gerhard H
r
ing <gh@ghaering.de>
* Copyright (C) 2004-2007 Gerhard H
är
ing <gh@ghaering.de>
*
*
* This file is part of pysqlite.
* This file is part of pysqlite.
*
*
...
@@ -529,7 +529,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
...
@@ -529,7 +529,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
}
}
rc
=
pysqlite_statement_create
(
self
->
statement
,
self
->
connection
,
operation
);
rc
=
pysqlite_statement_create
(
self
->
statement
,
self
->
connection
,
operation
);
if
(
rc
!=
SQLITE_OK
)
{
if
(
rc
!=
SQLITE_OK
)
{
self
->
statement
=
0
;
Py_CLEAR
(
self
->
statement
)
;
goto
error
;
goto
error
;
}
}
}
}
...
@@ -602,7 +602,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
...
@@ -602,7 +602,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
}
}
rc
=
pysqlite_statement_create
(
self
->
statement
,
self
->
connection
,
operation
);
rc
=
pysqlite_statement_create
(
self
->
statement
,
self
->
connection
,
operation
);
if
(
rc
!=
SQLITE_OK
)
{
if
(
rc
!=
SQLITE_OK
)
{
self
->
statement
=
0
;
Py_CLEAR
(
self
->
statement
)
;
goto
error
;
goto
error
;
}
}
}
}
...
@@ -711,8 +711,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
...
@@ -711,8 +711,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
self
->
next_row
=
_pysqlite_fetch_one_row
(
self
);
self
->
next_row
=
_pysqlite_fetch_one_row
(
self
);
}
else
if
(
rc
==
SQLITE_DONE
&&
!
multiple
)
{
}
else
if
(
rc
==
SQLITE_DONE
&&
!
multiple
)
{
pysqlite_statement_reset
(
self
->
statement
);
pysqlite_statement_reset
(
self
->
statement
);
Py_DECREF
(
self
->
statement
);
Py_CLEAR
(
self
->
statement
);
self
->
statement
=
0
;
}
}
switch
(
statement_type
)
{
switch
(
statement_type
)
{
...
@@ -1013,8 +1012,7 @@ PyObject* pysqlite_cursor_close(pysqlite_Cursor* self, PyObject* args)
...
@@ -1013,8 +1012,7 @@ PyObject* pysqlite_cursor_close(pysqlite_Cursor* self, PyObject* args)
if
(
self
->
statement
)
{
if
(
self
->
statement
)
{
(
void
)
pysqlite_statement_reset
(
self
->
statement
);
(
void
)
pysqlite_statement_reset
(
self
->
statement
);
Py_DECREF
(
self
->
statement
);
Py_CLEAR
(
self
->
statement
);
self
->
statement
=
0
;
}
}
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment