Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Test that datamodifying select queries are marked readonly
  • Loading branch information
Erlend E. Aasland committed Sep 20, 2021
commit c84311e8a3655b4037459db2925c2f03861f074a
14 changes: 14 additions & 0 deletions Lib/sqlite3/test/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,20 @@ def test_table_lock_cursor_dealloc(self):
con.execute("drop table t")
con.commit()

def test_table_lock_cursor_non_readonly_select(self):
con = sqlite.connect(":memory:")
con.execute("create table t(t)")
con.executemany("insert into t values(?)", ((v,) for v in range(5)))
con.commit()
def dup(v):
con.execute("insert into t values(?)", (v,))
return
con.create_function("dup", 1, dup)
cur = con.execute("select dup(t) from t")
del cur
con.execute("drop table t")
con.commit()


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