summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-04-05 13:02:51 +0200
committerSergei Golubchik <serg@mariadb.org>2019-04-24 11:15:38 +0200
commit822071ca5b6d109e5497f1c15efa44fe47d277c5 (patch)
treebb717639ab208c48c8d549c2e9452f559ce8f692 /mysql-test
parent66099b8f2d10cedf4ee75d12c0188f3a9b383e6c (diff)
downloadmariadb-git-822071ca5b6d109e5497f1c15efa44fe47d277c5.tar.gz
MDEV-18241 Downgrade from 10.4 to 10.3 crashes
privilege tables can never be views or temporary tables, don't even try to open them, if they are.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/grant4.result11
-rw-r--r--mysql-test/t/grant4.test15
2 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/grant4.result b/mysql-test/r/grant4.result
index d0b6627cd0b..9b6d4c42c59 100644
--- a/mysql-test/r/grant4.result
+++ b/mysql-test/r/grant4.result
@@ -121,3 +121,14 @@ View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t_select_priv`.`a` AS `a`,`t_select_priv`.`b` AS `b` from `t_select_priv` latin1 latin1_swedish_ci
drop database mysqltest_db1;
drop user mysqltest_u1@localhost;
+call mtr.add_suppression("Table 'mysql.user' doesn't exist");
+rename table mysql.user to mysql.user1;
+create view mysql.user as select * from mysql.user1;
+flush privileges;
+ERROR 42S02: Table 'mysql.user' doesn't exist
+drop view mysql.user;
+create temporary table mysql.user select * from mysql.user1 limit 0;
+flush privileges;
+ERROR 42S02: Table 'mysql.user' doesn't exist
+drop temporary table mysql.user;
+rename table mysql.user1 to mysql.user;
diff --git a/mysql-test/t/grant4.test b/mysql-test/t/grant4.test
index f3e551cd623..2762182b978 100644
--- a/mysql-test/t/grant4.test
+++ b/mysql-test/t/grant4.test
@@ -144,3 +144,18 @@ connection default;
disconnect con1;
drop database mysqltest_db1;
drop user mysqltest_u1@localhost;
+
+#
+# MDEV-18241 Downgrade from 10.4 to 10.3 crashes
+#
+call mtr.add_suppression("Table 'mysql.user' doesn't exist");
+rename table mysql.user to mysql.user1;
+create view mysql.user as select * from mysql.user1;
+--error ER_NO_SUCH_TABLE
+flush privileges;
+drop view mysql.user;
+create temporary table mysql.user select * from mysql.user1 limit 0;
+--error ER_NO_SUCH_TABLE
+flush privileges;
+drop temporary table mysql.user;
+rename table mysql.user1 to mysql.user;