Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
unrecognized token error #1270
Details for the issue
Selecting values in double quotes containing double hyphen substring returns "unrecognized token" error.
Please see example below.
Useful extra information
I'm opening this issue because:
I'm using DB4S on:
I'm using DB4S version:
I have also:
Oops. Just realised something that should have been obvious to me right away before.
This is probably not a bug after all. With SQL, the single and double quote characters aren't the same thing.
In the above example, the table
Further reference info, in case it's useful:
With your double quote example, the "unrecognized token" message is probably meaning that it's looking for a field called (literally) "anything--something", and not finding it.
Does that help?
Thank you for pointing to SQLite documentation.
Hmmm, yeah you're right. I've just tried it here with the sqlite3 client (and older version, 3.7.17 on my CentOS 7 desktop), and a recent build of DB4S.
It looks like DB4S is getting misunderstanding the double quotes. For example, with this (from above):
In the sqlite3 CLI it works, adding a new row into the table
Looking at that error message, there's an extra
So... yep this does seem like a bug. Our Execute SQL tab should accept anything that the SQLite CLI does. Thanks for being persistent.
added a commit
Jan 5, 2018
We need to make sure it's working for all these statements:
SELECT "something--something" -- comment SELECT 'something--something' -- comment SELECT "something--some'thing" -- comment SELECT 'something--some"thing' -- comment
And as a bonus maybe for these too:
SELECT `something--something` FROM table -- comment SELECT [something--something] FROM table -- comment
And for these:
SELECT '/*test*/' -- comment SELECT "/*test*/" -- comment SELECT '/*te"st*/' -- comment SELECT "/*te'st*/" -- comment SELECT `/*test*/` FROM table -- comment SELECT [/*test*/] FROM table -- comment