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 18bbb0da2ab..4a295762530 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -826,6 +826,9 @@ drop table t2;
create table t1 (a int);
insert into t1 values (1), (2);
create view v1 as select 5 from t1 order by 1;
+show create view v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 5 AS `5` from `t1` order by 1 latin1 latin1_swedish_ci
select * from v1;
5
5
@@ -5884,6 +5887,22 @@ a
DROP VIEW v1;
DROP TABLE t1;
#
+# MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant
+# produces invalid definition
+#
+CREATE TABLE t1 ( i INT );
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS
+SELECT 3 AS three, COUNT(*) FROM t1 GROUP BY three;
+show create view v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 3 AS `three`,count(0) AS `COUNT(*)` from `t1` group by '' latin1 latin1_swedish_ci
+SELECT * FROM v1;
+three COUNT(*)
+3 2
+drop view v1;
+drop table t1;
+#
# End of 10.1 tests
#
#