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
4a0f2563
Commit
4a0f2563
authored
May 08, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-4462 mysqld gets SIGFPE when mysql.user table is empty
avoid divison by zero
parent
61ed0ebe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
0 deletions
+32
-0
mysql-test/r/empty_user_table.result
mysql-test/r/empty_user_table.result
+8
-0
mysql-test/t/empty_user_table.test
mysql-test/t/empty_user_table.test
+18
-0
sql/sql_acl.cc
sql/sql_acl.cc
+6
-0
No files found.
mysql-test/r/empty_user_table.result
0 → 100644
View file @
4a0f2563
create table t1 as select * from mysql.user;
truncate table mysql.user;
flush privileges;
connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
insert mysql.user select * from t1;
drop table t1;
flush privileges;
mysql-test/t/empty_user_table.test
0 → 100644
View file @
4a0f2563
#
# MDEV-4462 mysqld gets SIGFPE when mysql.user table is empty
#
source
include
/
not_embedded
.
inc
;
create
table
t1
as
select
*
from
mysql
.
user
;
truncate
table
mysql
.
user
;
flush
privileges
;
--
replace_result
$MASTER_MYSOCK
MASTER_SOCKET
$MASTER_MYPORT
MASTER_PORT
--
error
ER_ACCESS_DENIED_ERROR
connect
(
fail
,
localhost
,
u1
);
insert
mysql
.
user
select
*
from
t1
;
drop
table
t1
;
flush
privileges
;
sql/sql_acl.cc
View file @
4a0f2563
...
@@ -7367,6 +7367,12 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio, Security_context *sctx)
...
@@ -7367,6 +7367,12 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio, Security_context *sctx)
cs
->
coll
->
hash_sort
(
cs
,
(
uchar
*
)
sctx
->
user
,
strlen
(
sctx
->
user
),
&
nr1
,
&
nr2
);
cs
->
coll
->
hash_sort
(
cs
,
(
uchar
*
)
sctx
->
user
,
strlen
(
sctx
->
user
),
&
nr1
,
&
nr2
);
pthread_mutex_lock
(
&
acl_cache
->
lock
);
pthread_mutex_lock
(
&
acl_cache
->
lock
);
if
(
!
acl_users
.
elements
)
{
pthread_mutex_unlock
(
&
acl_cache
->
lock
);
login_failed_error
(
mpvio
->
thd
);
return
1
;
}
uint
i
=
nr1
%
acl_users
.
elements
;
uint
i
=
nr1
%
acl_users
.
elements
;
ACL_USER
*
acl_user_tmp
=
dynamic_element
(
&
acl_users
,
i
,
ACL_USER
*
);
ACL_USER
*
acl_user_tmp
=
dynamic_element
(
&
acl_users
,
i
,
ACL_USER
*
);
mpvio
->
acl_user
=
acl_user_tmp
->
copy
(
mpvio
->
thd
->
mem_root
);
mpvio
->
acl_user
=
acl_user_tmp
->
copy
(
mpvio
->
thd
->
mem_root
);
...
...
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