Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upDiesel crashes but should return db error #1119
Comments
This comment has been minimized.
|
Thanks for the report! The error you quoted comes from this function: diesel/diesel/src/sqlite/connection/stmt.rs Lines 122 to 128 in bb6a35b I agree, |
killercup
added
bug
sqlite
labels
Aug 19, 2017
This comment has been minimized.
Boscop
commented
Aug 19, 2017
|
I'm not an sqlite expert but I tested it in the REPL and I don't see a reason why the connection wouldn't be perfectly usable afterwards. |
This comment has been minimized.
|
The main question isn't whether the connection is useable, but whether the statement itself is useable. I suspect we need to remove that statement from the cache if an error occurs here. |
This comment has been minimized.
|
This no longer panics as of 1.0.0-rc1. I still have concerns about whether the statement cache is poisoned by this case or not. If anyone is able to create a repro script that shows a poisoned prepared statement from this, I would appreciate an issue report. |
Boscop commentedAug 18, 2017
In sqlite FTS, searching for a string that is empty or contains only punctuation returns an error in the sqlite3 cli like so:
Btw, it works when the string contains alphanumeric chars:
When I use this code
if the string is empty or only contains punctuation, instead of returning a db error, diesel crashes:
I think diesel should return an error instead of crashing.