Skip to content

Commit eb5712b

Browse files
aquilamacedovuvova
authored andcommitted
MDEV-38046 Make func_regexp_pcre tolerant to PCRE2 offset change
PCRE2 10.47 reports the invalid escape in 'A\q' at offset 3 instead of 2. Update the expected result and add a --replace_regex in the test so the suite passes with both older and newer PCRE2 versions.
1 parent ccd9b00 commit eb5712b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mysql-test/main/func_regexp_pcre.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ SELECT 'AB' RLIKE 'A# this is a comment\nB';
791791
1
792792
SET default_regex_flags=DEFAULT;
793793
SELECT 'Aq' RLIKE 'A\\q';
794-
ERROR 42000: Regex error 'unrecognized character follows \ at offset 2'
794+
ERROR 42000: Regex error 'unrecognized character follows \ at offset 3'
795795
SET default_regex_flags='EXTRA';
796796
SELECT 'A' RLIKE 'B';
797797
'A' RLIKE 'B'

mysql-test/main/func_regexp_pcre.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ SELECT 'AB' RLIKE 'A B';
381381
SELECT 'AB' RLIKE 'A# this is a comment\nB';
382382
SET default_regex_flags=DEFAULT;
383383

384+
# pcre2 versions differ in the reported error offset for invalid escapes
385+
--replace_regex /offset 2/offset 3/
384386
--error ER_REGEXP_ERROR
385387
SELECT 'Aq' RLIKE 'A\\q';
386388

0 commit comments

Comments
 (0)