From a010536211af6e58cfd1c72eedca896c6676e377 Mon Sep 17 00:00:00 2001 From: Matthew Vernon Date: Thu, 6 Feb 2025 14:44:19 +0000 Subject: [PATCH] Update PCRE tests to fix case confusion (Closes: #1095286) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit MariaDB RLIKE is case-insensitive; in perl the Unicode character property tests \p{Lu} and \p{Ll} are equivalent to \p{L&} in case-insensitive matches. So remove those tests (since there is already the \p{L&} test). This fixes a FTBFS with PCRE2 10.45 which fixed its handling of Ll Lt and Lu under case-insensitive matching to match perl's behaviour. Example of failure seen in MTR: main.func_regexp_pcre w4 [ fail ] Test ended at 2025-02-06 07:00:25 CURRENT_TEST: main.func_regexp_pcre @@ -169,13 +169,13 @@ \p{Latin} 㐗 0 \p{Latin} 갷 0 \p{Ll} 1 0 -\p{Ll} A 0 +\p{Ll} A 1 \p{Ll} a 1 -\p{Ll} À 0 +\p{Ll} À 1 \p{Ll} à 1 -\p{Ll} Σ 0 +\p{Ll} Σ 1 \p{Ll} σ 1 -\p{Ll} Я 0 +\p{Ll} Я 1 \p{Ll} я 1 \p{Ll} ௨ 0 \p{Ll} ප 0 Forwarded: no Gbp-Pq: Name 1095286-pcre-tests-case-confusion.patch --- mysql-test/main/func_regexp_pcre.result | 28 +------------------------ mysql-test/main/func_regexp_pcre.test | 2 +- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/mysql-test/main/func_regexp_pcre.result b/mysql-test/main/func_regexp_pcre.result index 3085d2a31..eda2e9d02 100644 --- a/mysql-test/main/func_regexp_pcre.result +++ b/mysql-test/main/func_regexp_pcre.result @@ -60,7 +60,7 @@ INSERT INTO t1 VALUES ('1'),('௨'); INSERT INTO t2 VALUES ('\\p{Cyrillic}'),('\\p{Greek}'),('\\p{Latin}'); INSERT INTO t2 VALUES ('\\p{Han}'),('\\p{Hangul}'); INSERT INTO t2 VALUES ('\\p{Sinhala}'), ('\\p{Tamil}'); -INSERT INTO t2 VALUES ('\\p{L}'),('\\p{Ll}'),('\\p{Lu}'),('\\p{L&}'); +INSERT INTO t2 VALUES ('\\p{L}'),('\\p{L&}'); INSERT INTO t2 VALUES ('[[:alpha:]]'),('[[:digit:]]'); SELECT class, ch, ch RLIKE class FROM t1, t2 ORDER BY BINARY class, BINARY ch; class ch ch RLIKE class @@ -168,32 +168,6 @@ class ch ch RLIKE class \p{Latin} ප 0 \p{Latin} 㐗 0 \p{Latin} 갷 0 -\p{Ll} 1 0 -\p{Ll} A 0 -\p{Ll} a 1 -\p{Ll} À 0 -\p{Ll} à 1 -\p{Ll} Σ 0 -\p{Ll} σ 1 -\p{Ll} Я 0 -\p{Ll} я 1 -\p{Ll} ௨ 0 -\p{Ll} ප 0 -\p{Ll} 㐗 0 -\p{Ll} 갷 0 -\p{Lu} 1 0 -\p{Lu} A 1 -\p{Lu} a 0 -\p{Lu} À 1 -\p{Lu} à 0 -\p{Lu} Σ 1 -\p{Lu} σ 0 -\p{Lu} Я 1 -\p{Lu} я 0 -\p{Lu} ௨ 0 -\p{Lu} ප 0 -\p{Lu} 㐗 0 -\p{Lu} 갷 0 \p{L} 1 0 \p{L} A 1 \p{L} a 1 diff --git a/mysql-test/main/func_regexp_pcre.test b/mysql-test/main/func_regexp_pcre.test index 53280b75e..4d5b4ad39 100644 --- a/mysql-test/main/func_regexp_pcre.test +++ b/mysql-test/main/func_regexp_pcre.test @@ -41,7 +41,7 @@ INSERT INTO t1 VALUES ('1'),('௨'); INSERT INTO t2 VALUES ('\\p{Cyrillic}'),('\\p{Greek}'),('\\p{Latin}'); INSERT INTO t2 VALUES ('\\p{Han}'),('\\p{Hangul}'); INSERT INTO t2 VALUES ('\\p{Sinhala}'), ('\\p{Tamil}'); -INSERT INTO t2 VALUES ('\\p{L}'),('\\p{Ll}'),('\\p{Lu}'),('\\p{L&}'); +INSERT INTO t2 VALUES ('\\p{L}'),('\\p{L&}'); INSERT INTO t2 VALUES ('[[:alpha:]]'),('[[:digit:]]'); # Use "ORDER BY BINARY" to avoid dependency on the default utf8 collation SELECT class, ch, ch RLIKE class FROM t1, t2 ORDER BY BINARY class, BINARY ch; -- 2.30.2