If the value in key is a blob, then like matches it and = does not.

Because like has to do a string conversion on key, it also doesn't use
the index.

Try:

SELECT * FROM recordings WHERE "key" =
cast('4df0247ce1a97685a782d2cb051b48ed952e666c' as blob);

Or try inserting the key as text in the first place.

Or use a binary blob instead of a hex dump of it, and use (note the
"x"):

SELECT * FROM recordings WHERE "key" =
x'4df0247ce1a97685a782d2cb051b48ed952e666c';

--David Garfield

Eric Anderson writes:
> The below statement returns records:
> 
> SELECT * FROM recordings WHERE "key" LIKE
> '4df0247ce1a97685a782d2cb051b48ed952e666c';
> 
> But this one does not:
> 
> SELECT * FROM recordings WHERE "key" =
> '4df0247ce1a97685a782d2cb051b48ed952e666c';
> 
> The only difference is that = and LIKE have been swapped.
> 
> I realize "key" is a keyword but it is quoted properly from what I can
> tell. I'm on sqlite version 3.7.4 (standard one with Mint 11 Linux).
> Any ideas? The only thing I can think of is some sort of encoding
> issue that the LIKE operator is getting around somehow. Or perhaps the
> fact that it is a keyword?
> 
> Any ideas on how to debug?
> 
> -- 
> http://saveyourcall.com - Easily record phone calls from any phone
> http://pixelwareinc.com - Atlanta-based web development and design
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to