summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-04-06 09:52:25 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-04-06 09:52:25 +0300
commit1494147cf6f810dfd2a87c93be53e3c9da3a0958 (patch)
treef62d714617394660d75f804aa7850449733cc564 /mysql-test/t/view.test
parentd528fd72f281541e95cec803e9db63d620cccf5e (diff)
parent25d69ea0124941cca54dbf0c2ebb2aa20ab2d6a8 (diff)
downloadmariadb-git-1494147cf6f810dfd2a87c93be53e3c9da3a0958.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test38
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index df5c7d3495d..cb658b5146f 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.