Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
1b1bf430
Commit
1b1bf430
authored
Jan 12, 2020
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tolerate old pcre versions without PCRE2_EXTENDED_MORE flag
parent
0b8b84d8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
mysql-test/main/func_regexp_pcre.result
mysql-test/main/func_regexp_pcre.result
+5
-2
mysql-test/main/func_regexp_pcre.test
mysql-test/main/func_regexp_pcre.test
+3
-2
sql/sys_vars.cc
sql/sys_vars.cc
+9
-2
No files found.
mysql-test/main/func_regexp_pcre.result
View file @
1b1bf430
...
@@ -819,8 +819,11 @@ SET default_regex_flags=DEFAULT;
...
@@ -819,8 +819,11 @@ 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'
ERROR 42000: Regex error 'unrecognized character follows \ at offset 2'
SET default_regex_flags='EXTRA';
SET default_regex_flags='EXTRA';
SELECT 'Aq' RLIKE 'A\\q';
SELECT 'A' RLIKE 'B';
ERROR 42000: Regex error 'unrecognized character follows \ at offset 2'
'A' RLIKE 'B'
0
Warnings:
Warning 1105 PCRE2 doesn't support the EXTRA flag. Ignored.
SET default_regex_flags=DEFAULT;
SET default_regex_flags=DEFAULT;
SELECT 'a\nb\nc' RLIKE '^b$';
SELECT 'a\nb\nc' RLIKE '^b$';
'a\nb\nc' RLIKE '^b$'
'a\nb\nc' RLIKE '^b$'
...
...
mysql-test/main/func_regexp_pcre.test
View file @
1b1bf430
...
@@ -384,9 +384,10 @@ SET default_regex_flags=DEFAULT;
...
@@ -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$'
;
...
...
sql/sys_vars.cc
View file @
1b1bf430
...
@@ -5992,6 +5992,11 @@ static Sys_var_set Sys_log_disabled_statements(
...
@@ -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)
...
@@ -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
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment