summaryrefslogtreecommitdiff
path: root/mysql-test/t/view_grant.test
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2005-11-21 21:11:02 +0200
committerbell@sanja.is.com.ua <>2005-11-21 21:11:02 +0200
commit87a199fc2a7ba6ec7da38267172eb2da754756ac (patch)
tree34dfc38b93cf3e088781627b6d82961dc398e2b3 /mysql-test/t/view_grant.test
parent13260ea8f36488e2121e6ba019d7b970c8d4887f (diff)
downloadmariadb-git-87a199fc2a7ba6ec7da38267172eb2da754756ac.tar.gz
Avoiding removing dummy TABLE allocated on the stack (BUG#14726).
Diffstat (limited to 'mysql-test/t/view_grant.test')
-rw-r--r--mysql-test/t/view_grant.test36
1 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index b4f367c2065..04d6d2f323b 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -664,3 +664,39 @@ insert into mysql.user select * from t1;
flush privileges;
drop table t1;
+
+#
+# BUG#14726: freeing stack variable in case of an error of opening
+# a view when we have locked tables with LOCK TABLES statement.
+#
+connection root;
+--disable_warnings
+create database mysqltest;
+--enable_warnings
+
+use mysqltest;
+CREATE TABLE t1 (i INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+SHOW CREATE VIEW v1;
+GRANT SELECT, LOCK TABLES ON mysqltest.* TO mysqltest_1@localhost;
+
+connection user1;
+
+use mysqltest;
+LOCK TABLES v1 READ;
+-- error ER_TABLEACCESS_DENIED_ERROR
+SHOW CREATE TABLE v1;
+UNLOCK TABLES;
+use test;
+
+connection root;
+use test;
+drop user mysqltest_1@localhost;
+drop database mysqltest;
+
+#
+# switch to default connaction
+#
+disconnect user1;
+disconnect root;
+connection default;