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
da0e00e7
Commit
da0e00e7
authored
Apr 25, 2019
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#28986737: RENAMING AND REPLACING MYSQL.USER TABLE CAN LEAD TO A SERVER CRASH
parent
33fe3b58
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
mysql-test/r/grant4.result
mysql-test/r/grant4.result
+7
-0
mysql-test/t/grant4.test
mysql-test/t/grant4.test
+11
-0
sql/sql_acl.cc
sql/sql_acl.cc
+8
-0
No files found.
mysql-test/r/grant4.result
View file @
da0e00e7
...
...
@@ -132,3 +132,10 @@ flush privileges;
ERROR 42S02: Table 'mysql.user' doesn't exist
drop temporary table mysql.user;
rename table mysql.user1 to mysql.user;
call mtr.add_suppression('mysql.user table is damaged');
rename table mysql.user to mysql.user1;
create table mysql.user (Host char(100), User char(100));
flush privileges;
ERROR HY000: Unknown error
drop table mysql.user;
rename table mysql.user1 to mysql.user;
mysql-test/t/grant4.test
View file @
da0e00e7
...
...
@@ -159,3 +159,14 @@ create temporary table mysql.user select * from mysql.user1 limit 0;
flush privileges;
drop temporary table mysql.user;
rename table mysql.user1 to mysql.user;
#
# Bug#28986737: RENAMING AND REPLACING MYSQL.USER TABLE CAN LEAD TO A SERVER CRASH
#
call mtr.add_suppression('mysql.user table is damaged');
rename table mysql.user to mysql.user1;
create table mysql.user (Host char(100), User char(100));
--error ER_UNKNOWN_ERROR
flush privileges;
drop table mysql.user;
rename table mysql.user1 to mysql.user;
sql/sql_acl.cc
View file @
da0e00e7
...
...
@@ -825,6 +825,14 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
goto
end
;
table
->
use_all_columns
();
if
(
table
->
s
->
fields
<
13
)
// number of columns in 3.21
{
sql_print_error
(
"Fatal error: mysql.user table is damaged or in "
"unsupported 3.20 format."
);
goto
end
;
}
username_char_length
=
min
(
table
->
field
[
1
]
->
char_length
(),
USERNAME_CHAR_LENGTH
);
password_length
=
table
->
field
[
2
]
->
field_length
/
table
->
field
[
2
]
->
charset
()
->
mbmaxlen
;
...
...
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