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
bb200599
Commit
bb200599
authored
Nov 03, 2021
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-24584 Selecting INT column with COLLATE utf8mb4_general_ci throws an error
parent
5cae401b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
2 deletions
+73
-2
mysql-test/main/ctype_ucs.result
mysql-test/main/ctype_ucs.result
+19
-0
mysql-test/main/ctype_ucs.test
mysql-test/main/ctype_ucs.test
+13
-0
mysql-test/main/ctype_utf8mb4.result
mysql-test/main/ctype_utf8mb4.result
+18
-0
mysql-test/main/ctype_utf8mb4.test
mysql-test/main/ctype_utf8mb4.test
+19
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+4
-2
No files found.
mysql-test/main/ctype_ucs.result
View file @
bb200599
...
...
@@ -6473,5 +6473,24 @@ CAST(_ucs2 0x0061E0030062 AS INT)
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'ab'
#
# MDEV-24584 Selecting INT column with COLLATE utf8mb4_general_ci throws an error
#
SET NAMES utf8, collation_connection=ucs2_general_ci;
SELECT 1 COLLATE ucs2_general_ci;
1 COLLATE ucs2_general_ci
1
SELECT 1 COLLATE ucs2_bin;
1 COLLATE ucs2_bin
1
SELECT HEX(1 COLLATE ucs2_general_ci);
HEX(1 COLLATE ucs2_general_ci)
0031
SELECT HEX(1 COLLATE ucs2_bin);
HEX(1 COLLATE ucs2_bin)
0031
SELECT 1 COLLATE latin1_swedish_ci;
ERROR 42000: COLLATION 'latin1_swedish_ci' is not valid for CHARACTER SET 'ucs2'
SET NAMES utf8;
#
# End of 10.5 tests
#
mysql-test/main/ctype_ucs.test
View file @
bb200599
...
...
@@ -1146,6 +1146,19 @@ SELECT CAST(_ucs2 0x0061DFFF0062 AS INT);
SELECT
CAST
(
_ucs2
0x0061D7000062
AS
INT
);
SELECT
CAST
(
_ucs2
0x0061E0030062
AS
INT
);
--
echo
#
--
echo
# MDEV-24584 Selecting INT column with COLLATE utf8mb4_general_ci throws an error
--
echo
#
SET
NAMES
utf8
,
collation_connection
=
ucs2_general_ci
;
SELECT
1
COLLATE
ucs2_general_ci
;
SELECT
1
COLLATE
ucs2_bin
;
SELECT
HEX
(
1
COLLATE
ucs2_general_ci
);
SELECT
HEX
(
1
COLLATE
ucs2_bin
);
--
error
ER_COLLATION_CHARSET_MISMATCH
SELECT
1
COLLATE
latin1_swedish_ci
;
SET
NAMES
utf8
;
--
echo
#
--
echo
# End of 10.5 tests
--
echo
#
mysql-test/main/ctype_utf8mb4.result
View file @
bb200599
...
...
@@ -4149,3 +4149,21 @@ c
#
# End of 10.2 tests
#
#
# Start of 10.5 tests
#
#
# MDEV-24584 Selecting INT column with COLLATE utf8mb4_general_ci throws an error
#
SET NAMES utf8mb4;
SELECT 1 COLLATE utf8mb4_general_ci;
1 COLLATE utf8mb4_general_ci
1
SELECT 1 COLLATE utf8mb4_bin;
1 COLLATE utf8mb4_bin
1
SELECT 1 COLLATE latin1_swedish_ci;
ERROR 42000: COLLATION 'latin1_swedish_ci' is not valid for CHARACTER SET 'utf8mb4'
#
# End of 10.5 tests
#
mysql-test/main/ctype_utf8mb4.test
View file @
bb200599
...
...
@@ -2043,3 +2043,22 @@ EXECUTE IMMEDIATE 'SELECT ''😎'' AS c';
--
echo
#
--
echo
# End of 10.2 tests
--
echo
#
--
echo
#
--
echo
# Start of 10.5 tests
--
echo
#
--
echo
#
--
echo
# MDEV-24584 Selecting INT column with COLLATE utf8mb4_general_ci throws an error
--
echo
#
SET
NAMES
utf8mb4
;
SELECT
1
COLLATE
utf8mb4_general_ci
;
SELECT
1
COLLATE
utf8mb4_bin
;
--
error
ER_COLLATION_CHARSET_MISMATCH
SELECT
1
COLLATE
latin1_swedish_ci
;
--
echo
#
--
echo
# End of 10.5 tests
--
echo
#
sql/item_strfunc.cc
View file @
bb200599
...
...
@@ -3552,10 +3552,12 @@ String *Item_func_set_collation::val_str(String *str)
bool
Item_func_set_collation
::
fix_length_and_dec
()
{
if
(
!
my_charset_same
(
args
[
0
]
->
collation
.
collation
,
m_set_collation
))
if
(
agg_arg_charsets_for_string_result
(
collation
,
args
,
1
))
return
true
;
if
(
!
my_charset_same
(
collation
.
collation
,
m_set_collation
))
{
my_error
(
ER_COLLATION_CHARSET_MISMATCH
,
MYF
(
0
),
m_set_collation
->
name
,
args
[
0
]
->
collation
.
collation
->
csname
);
m_set_collation
->
name
,
collation
.
collation
->
csname
);
return
TRUE
;
}
collation
.
set
(
m_set_collation
,
DERIVATION_EXPLICIT
,
...
...
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