Ticket #29563: test1.py

File test1.py, 687 bytes (added by Andrew Brown, 6 years ago)
Line 
1# This test case reproduces Django bug #7411 but doesn't use Django. It
2# exhibits a limitation in SQLite that was present in versions 3.6.4 and below
3
4import sys
5import sqlite3
6conn = sqlite3.connect(":memory:")
7
8print("test1.py")
9print("Python Version: %s" % sys.version)
10print("SQLite Version: %s" % conn.execute("select sqlite_version()").fetchone()[0])
11
12# setup
13c = conn.cursor()
14c.execute("CREATE TABLE A (a)")
15c.execute("INSERT INTO A VALUES (1)")
16c.close()
17
18# Start a SELECT statement
19c1 = conn.cursor()
20c1.execute("SELECT * FROM A")
21
22# Make a change and then COMMIT it
23c2 = conn.cursor()
24c2.execute("INSERT INTO A VALUES (2)")
25conn.commit()
26
27print("Didn't crash")
28
29conn.close()
Back to Top