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 |
|
---|
4 | import sys
|
---|
5 | import sqlite3
|
---|
6 | conn = sqlite3.connect(":memory:")
|
---|
7 |
|
---|
8 | print("test1.py")
|
---|
9 | print("Python Version: %s" % sys.version)
|
---|
10 | print("SQLite Version: %s" % conn.execute("select sqlite_version()").fetchone()[0])
|
---|
11 |
|
---|
12 | # setup
|
---|
13 | c = conn.cursor()
|
---|
14 | c.execute("CREATE TABLE A (a)")
|
---|
15 | c.execute("INSERT INTO A VALUES (1)")
|
---|
16 | c.close()
|
---|
17 |
|
---|
18 | # Start a SELECT statement
|
---|
19 | c1 = conn.cursor()
|
---|
20 | c1.execute("SELECT * FROM A")
|
---|
21 |
|
---|
22 | # Make a change and then COMMIT it
|
---|
23 | c2 = conn.cursor()
|
---|
24 | c2.execute("INSERT INTO A VALUES (2)")
|
---|
25 | conn.commit()
|
---|
26 |
|
---|
27 | print("Didn't crash")
|
---|
28 |
|
---|
29 | conn.close()
|
---|