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
0897a557
Commit
0897a557
authored
Jan 11, 2017
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert 030e100f048a (#29006, #10513)
parent
2f7d13c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
33 deletions
+4
-33
Lib/sqlite3/test/regression.py
Lib/sqlite3/test/regression.py
+0
-30
Misc/NEWS
Misc/NEWS
+3
-3
Modules/_sqlite/connection.c
Modules/_sqlite/connection.c
+1
-0
No files found.
Lib/sqlite3/test/regression.py
View file @
0897a557
...
...
@@ -328,36 +328,6 @@ class RegressionTests(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
cur
.
execute
,
"
\
0
select 2"
)
self
.
assertRaises
(
ValueError
,
cur
.
execute
,
"select 2
\
0
"
)
def
CheckCommitCursorReset
(
self
):
"""
Connection.commit() did reset cursors, which made sqlite3
to return rows multiple times when fetched from cursors
after commit. See issues 10513 and 23129 for details.
"""
con
=
sqlite
.
connect
(
":memory:"
)
con
.
executescript
(
"""
create table t(c);
create table t2(c);
insert into t values(0);
insert into t values(1);
insert into t values(2);
"""
)
self
.
assertEqual
(
con
.
isolation_level
,
""
)
counter
=
0
for
i
,
row
in
enumerate
(
con
.
execute
(
"select c from t"
)):
con
.
execute
(
"insert into t2(c) values (?)"
,
(
i
,))
con
.
commit
()
if
counter
==
0
:
self
.
assertEqual
(
row
[
0
],
0
)
elif
counter
==
1
:
self
.
assertEqual
(
row
[
0
],
1
)
elif
counter
==
2
:
self
.
assertEqual
(
row
[
0
],
2
)
counter
+=
1
self
.
assertEqual
(
counter
,
3
,
"should have returned exactly three rows"
)
def
suite
():
regression_suite
=
unittest
.
makeSuite
(
RegressionTests
,
"Check"
)
...
...
Misc/NEWS
View file @
0897a557
...
...
@@ -15,6 +15,9 @@ Core and Builtins
Library
-------
- Issue #29006: Revert change from issue #10513 for making sqlite more liable to
emit "database table is locked" errors.
- Issue #29094: Offsets in a ZIP file created with extern file object and mode
"w" now are relative to the start of the file.
...
...
@@ -225,9 +228,6 @@ Library
-
Issue
#
19884
:
Avoid
spurious
output
on
OS
X
with
Gnu
Readline
.
-
Issue
#
10513
:
Fix
a
regression
in
Connection
.
commit
().
Statements
should
not
be
reset
after
a
commit
.
-
Issue
#
2466
:
posixpath
.
ismount
now
correctly
recognizes
mount
points
which
the
user
does
not
have
permission
to
access
.
...
...
Modules/_sqlite/connection.c
View file @
0897a557
...
...
@@ -467,6 +467,7 @@ PyObject* pysqlite_connection_commit(pysqlite_Connection* self, PyObject* args)
}
if
(
self
->
inTransaction
)
{
pysqlite_do_all_statements
(
self
,
ACTION_RESET
,
0
);
Py_BEGIN_ALLOW_THREADS
rc
=
sqlite3_prepare
(
self
->
db
,
"COMMIT"
,
-
1
,
&
statement
,
&
tail
);
...
...
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