summaryrefslogtreecommitdiff
path: root/mysql-test/r/ps_ddl.result
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2013-09-20 13:12:53 +0400
committerSergey Vojtovich <svoj@mariadb.org>2013-09-20 13:12:53 +0400
commit815c607dcfa4a43be73e42c325956eda16e24c91 (patch)
treebb36fd8012e2e29163d1b14bac9c05f18b7a01d7 /mysql-test/r/ps_ddl.result
parent8b5938a1276ffc4fe7f63a21c08a342f301cca30 (diff)
downloadmariadb-git-815c607dcfa4a43be73e42c325956eda16e24c91.tar.gz
MDEV-4879 - Merge test cases for new CREATE TEMPORARY TABLE privilege model
- merged test cases for MySQL bug#27480 - fixed that LOCK TABLES was unable to open temporary table (covered by grant2 test, merged appropriate code from 5.6) - commented lines that cause server crash in merge test, reported MDEV-5042 (not relevant to bug#27480)
Diffstat (limited to 'mysql-test/r/ps_ddl.result')
-rw-r--r--mysql-test/r/ps_ddl.result40
1 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/r/ps_ddl.result b/mysql-test/r/ps_ddl.result
index 7a8b38bec75..8284e974574 100644
--- a/mysql-test/r/ps_ddl.result
+++ b/mysql-test/r/ps_ddl.result
@@ -2502,3 +2502,43 @@ drop procedure if exists p_verify_reprepare_count;
drop procedure if exists p1;
drop function if exists f1;
drop view if exists v1, v2;
+#
+# Additional coverage for refactoring which was made as part of work
+# on bug '27480: Extend CREATE TEMPORARY TABLES privilege to allow
+# temp table operations'.
+#
+# Check that we don't try to pre-open temporary tables for the elements
+# from prelocking list, as this can lead to unwarranted ER_CANT_REOPEN
+# errors.
+DROP TABLE IF EXISTS t1, tm;
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+SET @a:= (SELECT COUNT(*) FROM t1);
+# Prelocking list for the below statement should
+# contain t1 twice - once for the INSERT and once
+# SELECT from the trigger.
+PREPARE stmt1 FROM 'INSERT INTO t1 VALUES (1)';
+EXECUTE stmt1;
+# Create temporary table which will shadow t1.
+CREATE TEMPORARY TABLE t1 (b int);
+# The below execution of statement should not fail with ER_CANT_REOPEN
+# error. Instead stmt1 should be auto-matically reprepared and succeed.
+EXECUTE stmt1;
+DEALLOCATE PREPARE stmt1;
+DROP TEMPORARY TABLE t1;
+DROP TABLE t1;
+#
+# Also check that we properly reset table list elements from UNION
+# clause of CREATE TABLE and ALTER TABLE statements.
+#
+CREATE TEMPORARY TABLE t1 (i INT);
+PREPARE stmt2 FROM 'CREATE TEMPORARY TABLE tm (i INT) ENGINE=MERGE UNION=(t1)';
+EXECUTE stmt2;
+DROP TEMPORARY TABLE tm;
+EXECUTE stmt2;
+DEALLOCATE PREPARE stmt2;
+PREPARE stmt3 FROM 'ALTER TABLE tm UNION=(t1)';
+EXECUTE stmt3;
+EXECUTE stmt3;
+DEALLOCATE PREPARE stmt3;
+DROP TEMPORARY TABLES tm, t1;