Bug #55427 REGEXP does not recognize '\t' as [:blank:]
Submitted: 21 Jul 2010 7:22 Modified: 21 Jul 2010 7:40
Reporter: Tor Didriksen Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: General Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: 5.0+

[21 Jul 2010 7:22] Tor Didriksen
According to POSIX, this query should return true.

SELECT '\t' REGEXP '[[:blank:]]';

Tested with 4.1 5.1 next-mr
they all return false.

How to repeat:
See description.

The regression test in the regex directory also fails:

./re < tests
286: ERE matched `SS' instead

Suggested fix:
Changing 'static uchar ctype_latin1[]' fixes it:

ctype_latin1['\t' + 1] |= _MY_B;

Similarly for all other character sets I guess.

Running with this change does not seem to break any of our mtr or unit tests,
and fixes the regex regression test.
[21 Jul 2010 7:40] Valeriy Kravchuk
Thank you for the bug report. Indeed:

valeriy-kravchuks-macbook-pro:5.0 openxs$ bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.92-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT '\t' REGEXP '[[:blank:]]';
| '\t' REGEXP '[[:blank:]]' |
|                         0 | 
1 row in set (0.04 sec)