summaryrefslogtreecommitdiff
path: root/mysql-test/r/view.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/view.result')
-rw-r--r--mysql-test/r/view.result19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 58aa614c508..a7ac971ef45 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3705,5 +3705,24 @@ ERROR HY000: Key 'c2' doesn't exist in table 'v1'
DROP VIEW v1;
DROP TABLE t1;
# -----------------------------------------------------------------
+# -- Bug#40825: Error 1356 while selecting from a view
+# -- with a "HAVING" clause though query works
+# -----------------------------------------------------------------
+
+CREATE TABLE t1 (c INT);
+
+CREATE VIEW v1 (view_column) AS SELECT c AS alias FROM t1 HAVING alias;
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`c` AS `view_column` from `t1` having `view_column`
+SELECT * FROM v1;
+view_column
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+# -- End of test case for Bug#40825
+
+# -----------------------------------------------------------------
# -- End of 5.0 tests.
# -----------------------------------------------------------------