Subject Re: [ib-support] LIKE problem
Author Paul Vinkenoog
Hello,

> (...) but if I do:
> CREATE TABLE foo (addr CHAR(64));
> INSERT INTO foo (addr) VALUES('test%');
> SELECT * FROM foo WHERE addr LIKE 'test@...';
> the select returns no results (the query doesn't fail, it just
> doesn't match any rows).

This is exactly what I would expect: you've inserted the string

test%

into the field.

Then, you use LIKE without wildcards, so it works as =

Since 'test%' != 'test@...', no match is found here.

(You might try
...WHERE 'test@...' LIKE addr
but I don't know if that's supported syntax. If it is, it should
return a match.)

> I'm pretty sure it's a bug, and I tried it on mysql and it works
> fine there.

Well, then I'm pretty sure it's a bug in mysql ;-)


Greetings,
Paul Vinkenoog


Not like that -- like that!
(Tommy Cooper)