mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
tolerate old pcre versions without PCRE2_EXTENDED_MORE flag
This commit is contained in:
@ -819,8 +819,11 @@ SET default_regex_flags=DEFAULT;
|
|||||||
SELECT 'AB' RLIKE 'A# this is a comment\nB';
|
SELECT 'AB' RLIKE 'A# this is a comment\nB';
|
||||||
'AB' RLIKE 'A# this is a comment\nB'
|
'AB' RLIKE 'A# this is a comment\nB'
|
||||||
1
|
1
|
||||||
SET default_regex_flags=DEFAULT;
|
SET default_regex_flags=DEFAULT;
|
||||||
SELECT 'Aq' RLIKE 'A\\q';
|
SELECT 'Aq' RLIKE 'A\\q';
|
||||||
|
ERROR 42000: Regex error 'unrecognized character follows \ at offset 2'
|
||||||
|
SET default_regex_flags='EXTRA';
|
||||||
|
SELECT 'A' RLIKE 'B';
|
||||||
'A' RLIKE 'B'
|
'A' RLIKE 'B'
|
||||||
0
|
0
|
||||||
Warnings:
|
Warnings:
|
||||||
|
@ -384,9 +384,10 @@ SET default_regex_flags=DEFAULT;
|
|||||||
|
|
||||||
--error ER_REGEXP_ERROR
|
--error ER_REGEXP_ERROR
|
||||||
SELECT 'Aq' RLIKE 'A\\q';
|
SELECT 'Aq' RLIKE 'A\\q';
|
||||||
|
|
||||||
SET default_regex_flags='EXTRA';
|
SET default_regex_flags='EXTRA';
|
||||||
--error ER_REGEXP_ERROR
|
SELECT 'A' RLIKE 'B';
|
||||||
SELECT 'Aq' RLIKE 'A\\q';
|
|
||||||
SET default_regex_flags=DEFAULT;
|
SET default_regex_flags=DEFAULT;
|
||||||
|
|
||||||
SELECT 'a\nb\nc' RLIKE '^b$';
|
SELECT 'a\nb\nc' RLIKE '^b$';
|
||||||
|
@ -5992,6 +5992,11 @@ static Sys_var_set Sys_log_disabled_statements(
|
|||||||
DEFAULT(LOG_DISABLE_SP),
|
DEFAULT(LOG_DISABLE_SP),
|
||||||
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_has_super));
|
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_has_super));
|
||||||
|
|
||||||
|
#define NOT_SUPPORTED_YET -2
|
||||||
|
#ifndef PCRE2_EXTENDED_MORE
|
||||||
|
#define PCRE2_EXTENDED_MORE NOT_SUPPORTED_YET
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char *default_regex_flags_names[]=
|
static const char *default_regex_flags_names[]=
|
||||||
{
|
{
|
||||||
"DOTALL", // (?s) . matches anything including NL
|
"DOTALL", // (?s) . matches anything including NL
|
||||||
@ -6024,9 +6029,11 @@ int default_regex_flags_pcre(THD *thd)
|
|||||||
{
|
{
|
||||||
if (default_regex_flags_to_pcre[i] < 0)
|
if (default_regex_flags_to_pcre[i] < 0)
|
||||||
{
|
{
|
||||||
|
const char *msg= default_regex_flags_to_pcre[i] == NOT_SUPPORTED_YET
|
||||||
|
? "Your version of PCRE2 does not support the %s flag. Ignored."
|
||||||
|
: "PCRE2 doesn't support the %s flag. Ignored.";
|
||||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||||
ER_UNKNOWN_ERROR,
|
ER_UNKNOWN_ERROR, msg, default_regex_flags_names[i]);
|
||||||
"PCRE2 doens't support the EXTRA flag. Ignored.");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
res|= default_regex_flags_to_pcre[i];
|
res|= default_regex_flags_to_pcre[i];
|
||||||
|
Reference in New Issue
Block a user