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
022ae421
Commit
022ae421
authored
Dec 14, 2023
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11777 REGEXP_REPLACE converts utf8mb4 supplementary characters to '?'
use utf8mb4 with PCRE2, not utf8mb3
parent
6538a91e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
mysql-test/main/func_regexp_pcre.result
mysql-test/main/func_regexp_pcre.result
+9
-0
mysql-test/main/func_regexp_pcre.test
mysql-test/main/func_regexp_pcre.test
+8
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+1
-1
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+1
-1
No files found.
mysql-test/main/func_regexp_pcre.result
View file @
022ae421
...
@@ -895,3 +895,12 @@ REGEXP_INSTR('a_kollision', 'o([lm])\\1')
...
@@ -895,3 +895,12 @@ REGEXP_INSTR('a_kollision', 'o([lm])\\1')
4
4
SELECT a FROM (SELECT "aa" a) t WHERE a REGEXP '[0-9]';
SELECT a FROM (SELECT "aa" a) t WHERE a REGEXP '[0-9]';
a
a
#
# MDEV-11777 REGEXP_REPLACE converts utf8mb4 supplementary characters to '?'
#
select hex(regexp_replace(cast(x'F09F9881' as char character set 'utf8mb4'), _utf8mb4'a', _utf8mb4'b')) as Text;
Text
F09F9881
#
# End of 10.6 tests
#
...
...
mysql-test/main/func_regexp_pcre.test
View file @
022ae421
...
@@ -470,3 +470,11 @@ SELECT REGEXP_INSTR('a_kollision', 'o([lm])\\1');
...
@@ -470,3 +470,11 @@ SELECT REGEXP_INSTR('a_kollision', 'o([lm])\\1');
#
#
SELECT
a
FROM
(
SELECT
"aa"
a
)
t
WHERE
a
REGEXP
'[0-9]'
;
SELECT
a
FROM
(
SELECT
"aa"
a
)
t
WHERE
a
REGEXP
'[0-9]'
;
--
enable_service_connection
--
enable_service_connection
--
echo
#
--
echo
# MDEV-11777 REGEXP_REPLACE converts utf8mb4 supplementary characters to '?'
--
echo
#
select
hex
(
regexp_replace
(
cast
(
x
'F09F9881'
as
char
character
set
'utf8mb4'
),
_utf8mb4
'a'
,
_utf8mb4
'b'
))
as
Text
;
--
echo
#
--
echo
# End of 10.6 tests
--
echo
#
sql/item_cmpfunc.cc
View file @
022ae421
...
@@ -6096,7 +6096,7 @@ void Regexp_processor_pcre::init(CHARSET_INFO *data_charset, int extra_flags)
...
@@ -6096,7 +6096,7 @@ void Regexp_processor_pcre::init(CHARSET_INFO *data_charset, int extra_flags)
// Convert text data to utf-8.
// Convert text data to utf-8.
m_library_charset
=
data_charset
==
&
my_charset_bin
?
m_library_charset
=
data_charset
==
&
my_charset_bin
?
&
my_charset_bin
:
&
my_charset_utf8mb
3
_general_ci
;
&
my_charset_bin
:
&
my_charset_utf8mb
4
_general_ci
;
m_conversion_is_needed
=
(
data_charset
!=
&
my_charset_bin
)
&&
m_conversion_is_needed
=
(
data_charset
!=
&
my_charset_bin
)
&&
!
my_charset_same
(
data_charset
,
m_library_charset
);
!
my_charset_same
(
data_charset
,
m_library_charset
);
...
...
sql/item_cmpfunc.h
View file @
022ae421
...
@@ -3057,7 +3057,7 @@ class Regexp_processor_pcre
...
@@ -3057,7 +3057,7 @@ class Regexp_processor_pcre
m_pcre
(
NULL
),
m_pcre_match_data
(
NULL
),
m_pcre
(
NULL
),
m_pcre_match_data
(
NULL
),
m_conversion_is_needed
(
true
),
m_is_const
(
0
),
m_conversion_is_needed
(
true
),
m_is_const
(
0
),
m_library_flags
(
0
),
m_library_flags
(
0
),
m_library_charset
(
&
my_charset_utf8mb
3
_general_ci
)
m_library_charset
(
&
my_charset_utf8mb
4
_general_ci
)
{}
{}
int
default_regex_flags
();
int
default_regex_flags
();
void
init
(
CHARSET_INFO
*
data_charset
,
int
extra_flags
);
void
init
(
CHARSET_INFO
*
data_charset
,
int
extra_flags
);
...
...
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