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
b9adaeb4
Commit
b9adaeb4
authored
May 12, 2022
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-28481 SIGSEGV in Lex_charset_collation_st::find_bin_collation
parent
40498498
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
1 deletion
+45
-1
mysql-test/main/ctype_filename.result
mysql-test/main/ctype_filename.result
+19
-0
mysql-test/main/ctype_filename.test
mysql-test/main/ctype_filename.test
+24
-0
sql/lex_charset.cc
sql/lex_charset.cc
+2
-1
No files found.
mysql-test/main/ctype_filename.result
View file @
b9adaeb4
...
...
@@ -133,3 +133,22 @@ a c
DROP TABLE t1;
SET NAMES utf8;
# End of 10.5 tests
#
# Start of 10.9 tests
#
#
# MDEV-28481 SIGSEGV in Lex_charset_collation_st::find_bin_collation
#
SET SESSION collation_server=filename;
CREATE DATABASE db1;
USE db1;
CREATE TABLE t (c CHAR BINARY);
ERROR HY000: Unknown collation: 'filename_bin'
DROP DATABASE db1;
USE test;
SET NAMES latin1;
CREATE TABLE t1 (c CHAR BINARY) CHARACTER SET filename;
ERROR HY000: Unknown collation: 'filename_bin'
#
# End of 10.9 tests
#
mysql-test/main/ctype_filename.test
View file @
b9adaeb4
...
...
@@ -139,3 +139,27 @@ SET NAMES utf8;
--
enable_ps_protocol
--
echo
# End of 10.5 tests
--
echo
#
--
echo
# Start of 10.9 tests
--
echo
#
--
echo
#
--
echo
# MDEV-28481 SIGSEGV in Lex_charset_collation_st::find_bin_collation
--
echo
#
SET
SESSION
collation_server
=
filename
;
CREATE
DATABASE
db1
;
USE
db1
;
--
error
ER_UNKNOWN_COLLATION
CREATE
TABLE
t
(
c
CHAR
BINARY
);
DROP
DATABASE
db1
;
USE
test
;
SET
NAMES
latin1
;
--
error
ER_UNKNOWN_COLLATION
CREATE
TABLE
t1
(
c
CHAR
BINARY
)
CHARACTER
SET
filename
;
--
echo
#
--
echo
# End of 10.9 tests
--
echo
#
sql/lex_charset.cc
View file @
b9adaeb4
...
...
@@ -41,10 +41,11 @@ CHARSET_INFO *Lex_charset_collation_st::find_bin_collation(CHARSET_INFO *cs)
return
cs
;
// CREATE TABLE t1 (a CHAR(10) BINARY) CHARACTER SET utf8mb4;
const
LEX_CSTRING
&
cs_name
=
cs
->
cs_name
;
if
(
!
(
cs
=
get_charset_by_csname
(
cs
->
cs_name
.
str
,
MY_CS_BINSORT
,
MYF
(
0
))))
{
char
tmp
[
65
];
strxnmov
(
tmp
,
sizeof
(
tmp
)
-
1
,
cs
->
cs
_name
.
str
,
"_bin"
,
NULL
);
strxnmov
(
tmp
,
sizeof
(
tmp
)
-
1
,
cs_name
.
str
,
"_bin"
,
NULL
);
my_error
(
ER_UNKNOWN_COLLATION
,
MYF
(
0
),
tmp
);
}
return
cs
;
...
...
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