summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_regexp_pcre.test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-10-08 18:25:17 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-10-08 18:25:17 +0400
commit1bcd2bebc69163c541baa548f1204ccd1b830d25 (patch)
treed3ee75906d99188903b87662730d415ded4a1b0e /mysql-test/t/func_regexp_pcre.test
parent43c09c15ff6d07e70d3fb12f7eea47dd85ecd992 (diff)
downloadmariadb-git-1bcd2bebc69163c541baa548f1204ccd1b830d25.tar.gz
MDEV-4425 Regexp enhancements
Do not pass PCRE_UCP flag for binary data. This makes bytes 0x80..FF not to belong to generic character classes \d (digit) and \w (word character). SELECT 0xFF RLIKE '\\w'; -> 0 Note, this change does not affect non-binary data, which is still examined with the PCRE_UCP flag by default.
Diffstat (limited to 'mysql-test/t/func_regexp_pcre.test')
-rw-r--r--mysql-test/t/func_regexp_pcre.test4
1 files changed, 4 insertions, 0 deletions
diff --git a/mysql-test/t/func_regexp_pcre.test b/mysql-test/t/func_regexp_pcre.test
index 7a4be163001..4892d9931da 100644
--- a/mysql-test/t/func_regexp_pcre.test
+++ b/mysql-test/t/func_regexp_pcre.test
@@ -46,6 +46,10 @@ INSERT INTO t2 VALUES ('[[:alpha:]]'),('[[:digit:]]');
SELECT class, ch, ch RLIKE class FROM t1, t2 ORDER BY class, BINARY ch;
DROP TABLE t1, t2;
+# Checking that UCP is disabled by default for binary data
+SELECT 0xFF RLIKE '\\w';
+SELECT 0xFF RLIKE '(*UCP)\\w';
+
# newline character
SELECT '\n' RLIKE '(*CR)';
SELECT '\n' RLIKE '(*LF)';