1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-4425 Regexp enhancements

Adding tests with 0x00 characters from

Bug#70470 REGEXP fails to find matches after NUL character
This commit is contained in:
Alexander Barkov
2013-10-03 14:28:57 +04:00
parent 01f833569b
commit 30ad3354b9
2 changed files with 16 additions and 0 deletions

View File

@ -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
#

View File

@ -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 #