Skip to content

Commit 6b1ccfe

Browse files
author
Erlend E. Aasland
committed
Add test
1 parent 72c9c9d commit 6b1ccfe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Lib/sqlite3/test/types.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,15 @@ def test_number2(self):
237237
# if the converter is not used, it's an int instead of a float
238238
self.assertEqual(type(value), float)
239239

240+
def test_convert_zero_sized_blob(self):
241+
self.con.execute("create table b(b cblob)")
242+
sqlite.converters["CBLOB"] = lambda x: b'blobish'
243+
self.con.execute("insert into b(b) values (?)", (b'',))
244+
cur = self.con.execute("select b from b")
245+
self.assertEqual(cur.fetchone()[0], b'blobish')
246+
del sqlite.converters["CBLOB"]
247+
248+
240249
class ColNamesTests(unittest.TestCase):
241250
def setUp(self):
242251
self.con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_COLNAMES)

0 commit comments

Comments
 (0)