summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@sun.com>2009-11-02 09:31:00 -0700
committerMarc Alff <marc.alff@sun.com>2009-11-02 09:31:00 -0700
commit1035de6282a24838b545f58d2adf90ce6ee10d06 (patch)
tree7a6bb218b937aaeaab0ee4794a23a8bea1bb2529 /mysql-test/t/view.test
parent64b813e361b557a26f5f66df0bcdeb1e710f7cdb (diff)
downloadmariadb-git-1035de6282a24838b545f58d2adf90ce6ee10d06.tar.gz
Bug#9801 Views: imperfect error message
Backport for 5.5 The root cause of this bug is that the grammar for GROUP BY clauses, when using WITH CUBE or WITH ROLLUP, cause conflicts with the grammar for VIEW, when using WITH CHECK OPTION. The solution is to implement two token look ahead when parsing a WITH token, to disambiguate the non standard WITH CUBE and WITH ROLLUP syntaxes. Patch based on code from Marc Alff and Antony Curtis
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index b2490847dbc..e180d4ebab8 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3905,3 +3905,29 @@ DROP TABLE t1;
--echo # -----------------------------------------------------------------
--echo # -- End of 5.1 tests.
--echo # -----------------------------------------------------------------
+
+#
+# Bug#9801 (Views: imperfect error message)
+#
+
+--disable_warnings
+drop table if exists t_9801;
+drop view if exists v_9801;
+--enable_warnings
+
+create table t_9801 (s1 int);
+
+--error ER_VIEW_NONUPD_CHECK
+create view v_9801 as
+ select sum(s1) from t_9801 with check option;
+
+--error ER_VIEW_NONUPD_CHECK
+create view v_9801 as
+ select sum(s1) from t_9801 group by s1 with check option;
+
+ --error ER_VIEW_NONUPD_CHECK
+create view v_9801 as
+ select sum(s1) from t_9801 group by s1 with rollup with check option;
+
+drop table t_9801;
+