I tried to investigate my previous problem with statements containing LIKE clause on a specific table. The problem was basically the following:

mysql> SELECT count(*) FROM user WHERE username LIKE 'o%';
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)

mysql> SELECT count(*) FROM user WHERE username LIKE 'ors%';
+----------+
| count(*) |
+----------+
|       91 |
+----------+
1 row in set (0.01 sec)


I checked the table:

mysql> CHECK TABLE user;
+---------------+-------+----------+----------+
| Table         | Op    | Msg_type | Msg_text |
+---------------+-------+----------+----------+
| database.user | check | status   | OK       |
+---------------+-------+----------+----------+
1 row in set (0.77 sec)

So the table seems to be healthy. I queried the same as above but with REGEXP instead of LIKE:

mysql> SELECT count(*) FROM user WHERE username REGEXP "^o.*";
+----------+
| count(*) |
+----------+
|      801 |
+----------+
1 row in set (0.19 sec)

mysql> SELECT count(*) FROM user WHERE username REGEXP "^ors.*";
+----------+
| count(*) |
+----------+
|       91 |
+----------+
1 row in set (0.23 sec)

The result of the second query matches that of the corresponding LIKE query, but the first seems to be correct.

Any ideas what the problem might be?

Zoltan


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to