Bug #6997 SELECT REGEXP returns no result if range is too large
Submitted: 3 Dec 2004 19:57 Modified: 3 Dec 2004 22:15
Reporter: Lars Wiberg Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.0.21 OS:Linux (Linux 2.4.26-bf2.4 SMP i686)
Assigned to: CPU Architecture:Any

[3 Dec 2004 19:57] Lars Wiberg
Description:
When I make an SQL statement that includes regular expressions using the REGEXP function I get no results or an error if the range is too large or just doesn't fit the mood of REGEXP.

How to repeat:
Example 1:

SELECT dstaddr, srcaddr, doctets FROM table WHERE 
dstaddr = '130.226.164.' REGEXP '[1-142]'

The above will run successfully but with no results even though there should be around 130.000 matching rows.

Example 2:

SELECT dstaddr, srcaddr, doctets FROM table WHERE 
dstaddr = '130.226.164.' REGEXP '[101-102]'

The above will run fine and return 130.000 matching rows as it is supposed to.

Example 3:

SELECT dstaddr, srcaddr, doctets FROM table WHERE 
dstaddr = '130.226.164.' REGEXP '[129-142]'

The above will give me the following error:

Got error 'invalid character range' from regexp
[3 Dec 2004 22:15] Sergei Golubchik
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

http://dev.mysql.com/doc/mysql/en/Regexp.html