Bug #8134 Strange behaveor comparing strings which begins with CHAR(31).

Submitted: 25 Jan 2005 15:01 Modified: 3 Feb 2005 21:09
Reporter: Moris Buga Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.8 OS:Linux (Linux)
Assigned to: Jim Winstead CPU Architecture:Any

[25 Jan 2005 15:01] Moris Buga
Description:
Empty string is equal with any string that begins with CHAR(31).

mysql> SELECT '' = CONCAT(CHAR(31),'ABC'), CONCAT(CHAR(31),'ABC') = '';
+-----------------------------+-----------------------------+
| '' = CONCAT(CHAR(31),'ABC') | CONCAT(CHAR(31),'ABC') = '' |
+-----------------------------+-----------------------------+
|                           1 |                           0 |
+-----------------------------+-----------------------------+

Same problem with selects from tables containing empty rows.

How to repeat:
SELECT '' = CONCAT(CHAR(31),'ABC');
[28 Jan 2005 22:42] Jim Winstead
This was a mistake in how string comparisons that require space-padding were done.
[1 Feb 2005 1:50] Jim Winstead
Pushed to 4.1.
[3 Feb 2005 21:09] Paul DuBois
Mentioned in 4.1.10 change notes.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.