Commit 30ad3354 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-4425 Regexp enhancements

Adding tests with 0x00 characters from

Bug#70470 REGEXP fails to find matches after NUL character
parent 01f83356
......@@ -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
#
......
......@@ -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 #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment