Using cl-sqlite-20190813-git in sbcl, I've hit an issue where empty strings are replaced with garbage characters. In the example below, the empty string is replaced with ":" upon insertion.
>>> (let ((db (connect ":memory:")))
(execute-non-query db "create table foo (bar text)")
(execute-non-query db "insert into foo (bar) values (?)" "")
(execute-to-list db "select * from foo")
)
((":"))
If I write the value into the query; it works fine:
>>> (let ((db (connect ":memory:")))
(execute-non-query db "create table foo (bar text)")
(execute-non-query db "insert into foo (bar) values (\"\")")
(execute-to-list db "select * from foo")
)
((""))
A colleague of mine has traced the issue to line 388 of sqlite.lisp; the problem goes away with the length -1 is replaced by (length value) but you may prefer a different fix.
Thanks!
Using
cl-sqlite-20190813-gitinsbcl, I've hit an issue where empty strings are replaced with garbage characters. In the example below, the empty string is replaced with ":" upon insertion.If I write the value into the query; it works fine:
A colleague of mine has traced the issue to line 388 of
sqlite.lisp; the problem goes away with the length-1is replaced by(length value)but you may prefer a different fix.Thanks!