On May 1, 2019, at 3:31 PM, Manuel Rigger <rigger.man...@gmail.com> wrote:
> 
> CREATE TABLE test (c0 REAL);
> CREATE INDEX index_0 ON test(c0 COLLATE NOCASE);
> INSERT INTO test(c0) VALUES ('+/');
> SELECT * FROM test WHERE (c0 LIKE '+/‘);

That behavior *does* reproduce here.

Making the final query’s predicate “c0 = '+/'” does look up the test record, 
indicating that SQLite isn’t losing information here.  I suspect it’s seeing 
that leading + and deciding to treat it as a number on one side of the LIKE 
operator but a string on the other and thereby failing to make the match.

While I am now with you in believing this to be a bug in SQLite, it’s a strange 
thing to want to do: put a string into a REAL column and then do a string match 
on it; then on top of that, use LIKE with a pattern string that doesn’t include 
% or _, when the = not only works, it’ll be more efficient besides.

Although I understand the value in SQLite’s dynamic typing behavior, I don’t 
understand what reasonable use case motivates such a query.  Would you care to 
enlighten us?
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to