summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorunknown <kroki/tomash@moonlight.home>2007-03-09 15:52:50 +0300
committerunknown <kroki/tomash@moonlight.home>2007-03-09 15:52:50 +0300
commitfebb6b924e1f2a6d59963e7fa9ccbbcb5c6d96ad (patch)
treec051a0badfc879e5755cc78f468069f9a6eee570 /mysql-test/t/view.test
parent1b198eeb6893b4095c70df224eafb2c823f8970f (diff)
downloadmariadb-git-febb6b924e1f2a6d59963e7fa9ccbbcb5c6d96ad.tar.gz
Resolve one shift/reduce conflict introduced with the push of the fix
for bug#16425: Events: no DEFINER clause. The problem was that there were two rules ALTER view_algorithm_opt definer ... VIEW ... ALTER definer EVENT ... so when there was 'ALTER definer' in the input it was unclear if empty view_algorithm_opt should be executed or not. We solve this by introducing three distinct rules ALTER view_algorithm definer ... VIEW ... ALTER definer ... VIEW ... ALTER definer EVENT ... that remove the ambiguity. mysql-test/r/view.result: Add result for the test of ALTER ALGORITHM= DEFINER= VIEW. mysql-test/t/view.test: Add test case for ALTER ALGORITHM= DEFINER= VIEW.
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test27
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 520babafb7e..0915fb01e6f 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3175,3 +3175,30 @@ DROP TABLE `t-2`;
DROP VIEW `v-2`;
DROP DATABASE `d-1`;
USE test;
+
+
+#
+# Test that ALTER VIEW accepts DEFINER and ALGORITHM, see bug#16425.
+#
+--disable_warnings
+DROP VIEW IF EXISTS v1;
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+ALTER VIEW v1 AS SELECT * FROM t1;
+SHOW CREATE VIEW v1;
+ALTER DEFINER=no_such@user_1 VIEW v1 AS SELECT * FROM t1;
+SHOW CREATE VIEW v1;
+ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
+SHOW CREATE VIEW v1;
+ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1;
+SHOW CREATE VIEW v1;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+
+--echo End of 5.1 tests.