summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-04-13 05:52:44 +0400
committerAlexander Barkov <bar@mariadb.org>2017-04-13 05:52:44 +0400
commit949faa2ec24999ce35c558433d5932805542e278 (patch)
tree252877067ef28138a8e29d9b582433ffb5298710 /mysql-test/t/view.test
parent012fbc15cfbd34c218ae50f553d2e2e32301da01 (diff)
parenteecce3d7c8a6374342ed7d0cd8844420d8957682 (diff)
downloadmariadb-git-949faa2ec24999ce35c558433d5932805542e278.tar.gz
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test50
1 files changed, 50 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 137902c54f2..cd6ca108661 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -5779,6 +5779,44 @@ DROP VIEW v1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-8642: WHERE Clause not applied on View - Empty result set returned
+--echo #
+
+CREATE TABLE `t1` (
+ `id` int(20) NOT NULL AUTO_INCREMENT,
+ `use_case` int(11) DEFAULT NULL,
+ `current_deadline` date DEFAULT NULL,
+ `ts_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `id_UNIQUE` (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=13976 DEFAULT CHARSET=latin1;
+INSERT INTO `t1` VALUES (1,10,'2015-12-18','2015-08-18 08:38:16');
+INSERT INTO `t1` VALUES (2,20,'2015-10-18','2015-08-18 08:43:30');
+CREATE VIEW v1 AS SELECT
+ use_case as use_case_id,
+ (
+ SELECT
+ deadline_sub.current_deadline
+ FROM
+ t1 deadline_sub
+ WHERE
+ deadline_sub.use_case = use_case_id
+ AND ts_create = (SELECT
+ MIN(ts_create)
+ FROM
+ t1 startdate_sub
+ WHERE
+ startdate_sub.use_case = use_case_id
+ )
+ ) AS InitialDeadline
+FROM
+ t1;
+
+SELECT * FROM v1 where use_case_id = 10;
+
+drop view v1;
+drop table t1;
--echo # -----------------------------------------------------------------
--echo # -- End of 10.0 tests.
@@ -6148,6 +6186,18 @@ REPLACE INTO v (f1,f2) VALUES (1,1);
drop view v;
drop table t1,t2,t3;
+
+--echo #
+--echo # MDEV-12379: Server crashes in TABLE_LIST::is_with_table on
+--echo # SHOW CREATE VIEW
+--echo #
+
+CREATE TABLE t (i INT);
+CREATE VIEW v AS SELECT * FROM ( SELECT * FROM t ) sq;
+DROP TABLE IF EXISTS t;
+SHOW CREATE VIEW v;
+DROP VIEW v;
+
--echo #
--echo # End of 10.2 tests
--echo #