Bug #2551 Different behavior of 4.0 and 4.1 w.r.t. LIKE '303%000'
Submitted: 29 Jan 2004 3:29 Modified: 29 Jan 2004 10:59
Reporter: [ name withheld ] Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:4.1.1-alpha-standard-log OS:Linux (Linux (Kernel 2.4.21))
Assigned to: CPU Architecture:Any

[29 Jan 2004 3:29] [ name withheld ]
Description:
SELECT * FROM tablename WHERE INTFIELD LIKE '303%000';
gives with MySQL 4.0 a number of rows.
With MySQL 4.1 you get an empty result.
Workaround was:
SELECT * FROM tablename WHERE CONCAT(INTFIELD,'') LIKE '303%000';

How to repeat:
See above.

Suggested fix:
Don't know ;-)
[29 Jan 2004 9:04] MySQL Verification Team
Worked just fine for me:

 ./client/mysql telcent -e "select msg_nro from mails"
+---------+
| msg_nro |
+---------+
|   40148 |
|   40229 |
|   40791 |
|   42899 |
|   44000 |
|   59328 |
|   59329 |
+---------+
[/mnt/work/mysql-4.1]$ ./client/mysql telcent -e "select msg_nro from mails where concat(msg_nro,'') like '4%9'"
+---------+
| msg_nro |
+---------+
|   40229 |
|   42899 |
+---------+
[/mnt/work/mysql-4.1]$ ./client/mysql telcent -e "select msg_nro from mails where concat(msg_nro,'') like '5%9'"
+---------+
| msg_nro |
+---------+
|   59329 |
+---------+

You should consider using a different default charset.
[29 Jan 2004 10:59] Sergei Golubchik
if this is really a charset issue, please provide a repeatable test case, that starts from SET NAMES, so that we will be able to repeat the bug.