diff options
| author | Alexander Barkov <bar@mnogosearch.org> | 2013-10-03 14:28:57 +0400 |
|---|---|---|
| committer | Alexander Barkov <bar@mnogosearch.org> | 2013-10-03 14:28:57 +0400 |
| commit | 30ad3354b9786a4db54643b127a88aaa073c0237 (patch) | |
| tree | fa466fab130f2dc66f94e2048f75334105da65f8 /mysql-test | |
| parent | 01f833569b9d66b7abc1704037354b8e2727e504 (diff) | |
| download | mariadb-git-30ad3354b9786a4db54643b127a88aaa073c0237.tar.gz | |
MDEV-4425 Regexp enhancements
Adding tests with 0x00 characters from
Bug#70470 REGEXP fails to find matches after NUL character
Diffstat (limited to 'mysql-test')
| -rw-r--r-- | mysql-test/r/func_regexp_pcre.result | 9 | ||||
| -rw-r--r-- | mysql-test/t/func_regexp_pcre.test | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/func_regexp_pcre.result b/mysql-test/r/func_regexp_pcre.result index e001e52bc55..4ae66e24eda 100644 --- a/mysql-test/r/func_regexp_pcre.result +++ b/mysql-test/r/func_regexp_pcre.result @@ -414,6 +414,15 @@ SELECT '!' RLIKE '\\S'; SELECT '.' RLIKE '\\S'; '.' RLIKE '\\S' 1 +SELECT 'abc\0def' REGEXP 'def'; +'abc\0def' REGEXP 'def' +1 +SELECT 'abc\0def' REGEXP 'abc\\x{00}def'; +'abc\0def' REGEXP 'abc\\x{00}def' +1 +SELECT HEX(REGEXP_SUBSTR('abc\0def','abc\\x{00}def')); +HEX(REGEXP_SUBSTR('abc\0def','abc\\x{00}def')) +61626300646566 # # Checking REGEXP_REPLACE # diff --git a/mysql-test/t/func_regexp_pcre.test b/mysql-test/t/func_regexp_pcre.test index ff0ee569b1a..7a4be163001 100644 --- a/mysql-test/t/func_regexp_pcre.test +++ b/mysql-test/t/func_regexp_pcre.test @@ -144,6 +144,13 @@ SELECT '1' RLIKE '\\S'; SELECT '!' RLIKE '\\S'; SELECT '.' RLIKE '\\S'; +# checking 0x00 bytes +# Bug#70470 REGEXP fails to find matches after NUL character +SELECT 'abc\0def' REGEXP 'def'; +SELECT 'abc\0def' REGEXP 'abc\\x{00}def'; +SELECT HEX(REGEXP_SUBSTR('abc\0def','abc\\x{00}def')); + + --echo # --echo # Checking REGEXP_REPLACE --echo # |
