summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test25
1 files changed, 17 insertions, 8 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 1d1b64d323e..d11b7f0bc37 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -731,6 +731,7 @@ 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;
select * from v1;
drop view v1;
drop table t1;
@@ -4642,7 +4643,6 @@ DROP PROCEDURE IF EXISTS p1;
connect (con2, localhost, root);
connect (con3, localhost, root);
---echo # Connection default
connection default;
CREATE VIEW v1 AS SELECT schema_name FROM information_schema.schemata;
@@ -4652,17 +4652,14 @@ CREATE PROCEDURE p1() INSERT INTO t1 SELECT * FROM v1;
--echo # CALL p1() so the view is merged.
CALL p1();
---echo # Connection 3
connection con3;
LOCK TABLE t1 READ;
---echo # Connection default
connection default;
--echo # Try to CALL p1() again, this time it should block for t1.
--echo # Sending:
--send CALL p1()
---echo # Connection 2
connection con2;
let $wait_condition=
SELECT COUNT(*) = 1 from information_schema.processlist
@@ -4673,7 +4670,6 @@ let $wait_condition=
--echo # Sending:
--send DROP VIEW v1
---echo # Connection 3
connection con3;
let $wait_condition=
SELECT COUNT(*) = 1 from information_schema.processlist
@@ -4682,17 +4678,14 @@ let $wait_condition=
--echo # Now allow CALL p1() to complete
UNLOCK TABLES;
---echo # Connection default
connection default;
--echo # Reaping: CALL p1()
--reap
---echo # Connection 2
connection con2;
--echo # Reaping: DROP VIEW v1
--reap
---echo # Connection default
connection default;
DROP PROCEDURE p1;
DROP TABLE t1;
@@ -5747,6 +5740,22 @@ SELECT * FROM v1 WHERE a=_latin1'a' COLLATE latin1_bin;
DROP VIEW v1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant
+--echo # produces invalid definition
+--echo #
+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;
+
+SELECT * FROM v1;
+
+drop view v1;
+drop table t1;
--echo #
--echo # End of 10.1 tests