Skip to content

Commit c84311e

Browse files
author
Erlend E. Aasland
committed
Test that datamodifying select queries are marked readonly
#27844 (comment)
1 parent ebebdb7 commit c84311e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Lib/sqlite3/test/test_regression.py

+14
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,20 @@ def test_table_lock_cursor_dealloc(self):
456456
con.execute("drop table t")
457457
con.commit()
458458

459+
def test_table_lock_cursor_non_readonly_select(self):
460+
con = sqlite.connect(":memory:")
461+
con.execute("create table t(t)")
462+
con.executemany("insert into t values(?)", ((v,) for v in range(5)))
463+
con.commit()
464+
def dup(v):
465+
con.execute("insert into t values(?)", (v,))
466+
return
467+
con.create_function("dup", 1, dup)
468+
cur = con.execute("select dup(t) from t")
469+
del cur
470+
con.execute("drop table t")
471+
con.commit()
472+
459473

460474
if __name__ == "__main__":
461475
unittest.main()

0 commit comments

Comments
 (0)