Bug: Text compare doesn't work, if column name matches text literal enclosed in double quotes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bug: Text compare doesn't work, if column name matches text literal enclosed in double quotes

Andreas Martin
Hello,

I'll report a bug tested on SQLite 1.18.0, Windows 7/64bit:

(You can reproduce this issue by using the attached SQL text file
"bug.sql").

The bug appears, when querying from a table with text compare, where a
column is named as like the text pattern:
SELECT * FROM tbl WHERE col_1="col_2";

The result is empty, if there exists a column named "col_2".
Using single quotes fixes this:
SELECT * FROM tbl WHERE col_1='col_2';


Kindly regards,
Andreas Martin
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bug: Text compare doesn't work, if column name matches text literal enclosed in double quotes

Andreas Martin
Hello,

this is apparently not a bug. I have just read, that double quoted strings
are identifiers and no string literals...
(https://sqlite.org/lang_keywords.html)

Kindly Regards,
Andreas Martin

2017-04-19 13:46 GMT+02:00 Andreas Martin <[hidden email]>:

> Hello,
>
> I'll report a bug tested on SQLite 1.18.0, Windows 7/64bit:
>
> (You can reproduce this issue by using the attached SQL text file
> "bug.sql").
>
> The bug appears, when querying from a table with text compare, where a
> column is named as like the text pattern:
> SELECT * FROM tbl WHERE col_1="col_2";
>
> The result is empty, if there exists a column named "col_2".
> Using single quotes fixes this:
> SELECT * FROM tbl WHERE col_1='col_2';
>
>
> Kindly regards,
> Andreas Martin
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...