summaryrefslogtreecommitdiff
path: root/mysql-test/main/grant5.test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-06-13 12:49:22 +0200
committerSergei Golubchik <serg@mariadb.org>2020-06-13 18:49:42 +0200
commitb58586aae938e6aa7714c9bb3813da908e49010a (patch)
tree1501cf15f1bfac619528283c71144e53046f0213 /mysql-test/main/grant5.test
parent805340936aa47493886bafd119863d83c475f45c (diff)
downloadmariadb-git-b58586aae938e6aa7714c9bb3813da908e49010a.tar.gz
MDEV-21560 Assertion `grant_table || grant_table_role' failed in check_grant_all_columns
With RETURNING it can happen that the user has some privileges on the table (namely, DELETE), but later needs different privileges on individual columns (namely, SELECT). Do the same as in check_grant_column() - ER_COLUMNACCESS_DENIED_ERROR, not an assert.
Diffstat (limited to 'mysql-test/main/grant5.test')
-rw-r--r--mysql-test/main/grant5.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/main/grant5.test b/mysql-test/main/grant5.test
index 307549ec9d8..39fcff92435 100644
--- a/mysql-test/main/grant5.test
+++ b/mysql-test/main/grant5.test
@@ -182,4 +182,21 @@ insert mysql.tables_priv (host,db,user,table_name,grantor,table_priv) values ('l
flush privileges;
delete from mysql.tables_priv where db='';
+#
+# MDEV-21560 Assertion `grant_table || grant_table_role' failed in check_grant_all_columns
+#
+create database db;
+create table db.t1 (a int);
+insert into db.t1 values (1);
+create user foo;
+grant delete on db.* to foo;
+--connect (con1,localhost,foo,,)
+show create table db.t1;
+--error ER_COLUMNACCESS_DENIED_ERROR
+delete from db.t1 returning *;
+--disconnect con1
+--connection default
+drop database db;
+drop user foo;
+
--echo # End of 10.4 tests