mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
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.
This commit is contained in:
@ -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)';
|
||||
|
Reference in New Issue
Block a user