Bug #4395 % character not matching zero characters at end of string
Submitted: 3 Jul 2004 4:01 Modified: 6 Aug 2004 11:45
Reporter: Marshall Spight Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:4.1.2-alpha-standard OS:Linux (RedHat 9.0)
Assigned to: Assigned Account CPU Architecture:Any

[3 Jul 2004 4:01] Marshall Spight
Description:
I'm using utf8 encoding.

The % character is not matching zero characters if it occurs at the end of the string.
The documentation says it should match zero characters. It does match zero characters if it comes at the beginning of the string.

How to repeat:
mysql> desc Users;
+------------+--------------+------+-----+---------+-------+
| Field      | Type         | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| UserId     | int(11)      |      | PRI | 0       |       |
| ManagerId  | int(11)      | YES  |     | NULL    |       |
| BugsUserId | int(11)      | YES  | MUL | NULL    |       |
| Login      | varchar(255) |      | MUL |         |       |
+------------+--------------+------+-----+---------+-------+
4 rows in set (0.00 sec)

mysql> select * from Users where Login like 'marshal%';
+--------+-----------+------------+----------+
| UserId | ManagerId | BugsUserId | Login    |
+--------+-----------+------------+----------+
|    332 |        37 |        234 | marshall |
+--------+-----------+------------+----------+
1 row in set (0.00 sec)

mysql> select * from Users where Login like 'marshall%';
Empty set (0.00 sec)
[6 Jul 2004 11:45] Hartmut Holzgraefe
As far as i know this was a collation related bug that has already been
fixed in 4.1.3. Can you please verify that this is the case here?

If the problem persists with 4.1.3 can you please add the 
language and collation settings for your system?

  SHOW VARIABLES LIKE 'char%'
  SHOW VARIABLES LIKE 'col%'
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".