diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-05-08 14:32:32 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-05-08 14:32:32 +0200 |
commit | 4a0f2563d3d1747a4704e6241380071efbeb3882 (patch) | |
tree | eacf17c38fb72c458fe134b8d8fde0dfdfce6eb2 /mysql-test | |
parent | 61ed0ebe7388d8302f2de7144de41da32bf085ba (diff) | |
download | mariadb-git-4a0f2563d3d1747a4704e6241380071efbeb3882.tar.gz |
MDEV-4462 mysqld gets SIGFPE when mysql.user table is empty
avoid divison by zero
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/empty_user_table.result | 8 | ||||
-rw-r--r-- | mysql-test/t/empty_user_table.test | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/empty_user_table.result b/mysql-test/r/empty_user_table.result new file mode 100644 index 00000000000..df9d803e5c0 --- /dev/null +++ b/mysql-test/r/empty_user_table.result @@ -0,0 +1,8 @@ +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; diff --git a/mysql-test/t/empty_user_table.test b/mysql-test/t/empty_user_table.test new file mode 100644 index 00000000000..7e672cc64f6 --- /dev/null +++ b/mysql-test/t/empty_user_table.test @@ -0,0 +1,18 @@ +# +# 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; + |