summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/func_regexp_pcre.result9
-rw-r--r--mysql-test/t/func_regexp_pcre.test7
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 #