Visitar URL original
bpo-43853: Expand test suite for SQLite UDF's by erlend-aasland · Pull Request #27642 · python/cpython · GitHub
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
Next Next commit
Test that str params with embedded NULL chars are passed to SQLite fu…
…nctions
  • Loading branch information
Erlend E. Aasland
Erlend E. Aasland committed Aug 6, 2021
commit 1fa7e13db03ce0e655611c87b1d65abb6fdace50
7 changes: 7 additions & 0 deletions Lib/sqlite3/test/userfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,13 @@ def test_empty_blob(self):
cur = self.con.execute("select isblob(x'')")
self.assertTrue(cur.fetchone()[0])

def test_set_and_get(self):
self.con.create_function("returnit", 1, lambda x: x)
for val in 1, 2.5, "text", "1\x002", "", b"data", None:
with self.subTest(val=val):
cur = self.con.execute("select returnit(?)", (val,))
self.assertEqual(val, cur.fetchone()[0])

# Regarding deterministic functions:
#
# Between 3.8.3 and 3.15.0, deterministic functions were only used to
Expand Down