summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_regexp_pcre.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/func_regexp_pcre.result')
-rw-r--r--mysql-test/r/func_regexp_pcre.result29
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/func_regexp_pcre.result b/mysql-test/r/func_regexp_pcre.result
index 641c4fddbf7..aa090c9faf6 100644
--- a/mysql-test/r/func_regexp_pcre.result
+++ b/mysql-test/r/func_regexp_pcre.result
@@ -845,3 +845,32 @@ SET default_regex_flags=DEFAULT;
SELECT REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that');
REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that')
1 this and that
+#
+# MDEV-8102 REGEXP function fails to match hex values when expression is stored as a variable
+#
+# Testing a warning
+SET NAMES latin1;
+SET @regCheck= '\\xE0\\x01';
+SELECT 0xE001 REGEXP @regCheck;
+0xE001 REGEXP @regCheck
+0
+Warnings:
+Warning 1139 Got error 'pcre_exec: Invalid utf8 byte sequence in the subject string' from regexp
+# Testing workaround N1: This makes the pattern to be a binary string:
+SET NAMES latin1;
+SET @regCheck= X'E001';
+SELECT 0xE001 REGEXP @regCheck;
+0xE001 REGEXP @regCheck
+1
+# Testing workaround N2: This also makes the pattern to be a binary string, using a different syntax:
+SET NAMES latin1;
+SET @regCheck= _binary '\\xE0\\x01';
+SELECT 0xE001 REGEXP @regCheck;
+0xE001 REGEXP @regCheck
+1
+# Testing workarond N3: This makes derivation of the subject string stronger (IMLICIT instead of COERCIBLE)
+SET NAMES latin1;
+SET @regCheck= '\\xE0\\x01';
+SELECT CAST(0xE001 AS BINARY) REGEXP @regCheck;
+CAST(0xE001 AS BINARY) REGEXP @regCheck
+1