File: MDEV-38046-pcre2-offset.patch

package info (click to toggle)
mariadb 1%3A11.8.5-3~exp3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 775,036 kB
  • sloc: ansic: 2,415,394; cpp: 1,796,627; asm: 381,336; perl: 62,933; sh: 50,567; pascal: 40,908; java: 39,363; python: 25,814; yacc: 20,444; sql: 17,907; xml: 12,354; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,194; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (42 lines) | stat: -rw-r--r-- 1,686 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From: Aquila Macedo <aquilamacedo@riseup.net>
Date: Fri, 7 Nov 2025 21:09:05 -0300
Subject: [PATCH] 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.

Forwarded: https://jira.mariadb.org/browse/MDEV-38046
(accepted upstream, will be in MariaDB 11.8.6+)
---
 mysql-test/main/func_regexp_pcre.result | 2 +-
 mysql-test/main/func_regexp_pcre.test   | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/mysql-test/main/func_regexp_pcre.result b/mysql-test/main/func_regexp_pcre.result
index 4416dfc..dff12c6 100644
--- a/mysql-test/main/func_regexp_pcre.result
+++ b/mysql-test/main/func_regexp_pcre.result
@@ -791,7 +791,7 @@ SELECT 'AB' RLIKE 'A# this is a comment\nB';
 1
 SET default_regex_flags=DEFAULT;
 SELECT 'Aq' RLIKE 'A\\q';
-ERROR 42000: Regex error 'unrecognized character follows \ at offset 2'
+ERROR 42000: Regex error 'unrecognized character follows \ at offset 3'
 SET default_regex_flags='EXTRA';
 SELECT 'A' RLIKE 'B';
 'A' RLIKE 'B'
diff --git a/mysql-test/main/func_regexp_pcre.test b/mysql-test/main/func_regexp_pcre.test
index f214ee6..260a248 100644
--- a/mysql-test/main/func_regexp_pcre.test
+++ b/mysql-test/main/func_regexp_pcre.test
@@ -382,6 +382,8 @@ SELECT 'AB' RLIKE 'A B';
 SELECT 'AB' RLIKE 'A# this is a comment\nB';
 SET default_regex_flags=DEFAULT;
 
+# pcre2 versions differ in the reported error offset for invalid escapes
+--replace_regex /offset 2/offset 3/
 --error ER_REGEXP_ERROR
 SELECT 'Aq' RLIKE 'A\\q';