summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-10-07 09:16:45 (GMT)
committerGitHub <noreply@github.com>2021-10-07 09:16:45 (GMT)
commit3f2c433da560d7999a52f9fcba4bbd0898848520 (patch)
treee9412020ea841dacf5adbcb91fe5cd87d9c49b7b /Lib/sqlite3
parentdd02a696e55b450413e765e698e653d781ca4205 (diff)
downloadcpython-3f2c433da560d7999a52f9fcba4bbd0898848520.zip
cpython-3f2c433da560d7999a52f9fcba4bbd0898848520.tar.gz
cpython-3f2c433da560d7999a52f9fcba4bbd0898848520.tar.bz2
bpo-45041: Restore `sqlite3` executescript behaviour for `SELECT` queries (GH-28509)
* bpo-45041: Restore sqlite3 executescript behaviour for select queries * Add regression test
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r--Lib/sqlite3/test/test_regression.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/test_regression.py b/Lib/sqlite3/test/test_regression.py
index ff35673..3d71809 100644
--- a/Lib/sqlite3/test/test_regression.py
+++ b/Lib/sqlite3/test/test_regression.py
@@ -475,6 +475,17 @@ class RegressionTests(unittest.TestCase):
con.execute("drop table t")
con.commit()
+ def test_executescript_step_through_select(self):
+ with managed_connect(":memory:", in_mem=True) as con:
+ values = [(v,) for v in range(5)]
+ with con:
+ con.execute("create table t(t)")
+ con.executemany("insert into t values(?)", values)
+ steps = []
+ con.create_function("step", 1, lambda x: steps.append((x,)))
+ con.executescript("select step(t) from t")
+ self.assertEqual(steps, values)
+
if __name__ == "__main__":
unittest.main()