summaryrefslogtreecommitdiff
path: root/mysql-test/main/type_datetime.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/type_datetime.result')
-rw-r--r--mysql-test/main/type_datetime.result81
1 files changed, 81 insertions, 0 deletions
diff --git a/mysql-test/main/type_datetime.result b/mysql-test/main/type_datetime.result
index 5afb0257757..b23fa762c73 100644
--- a/mysql-test/main/type_datetime.result
+++ b/mysql-test/main/type_datetime.result
@@ -1198,6 +1198,87 @@ Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2
DROP VIEW v1;
DROP TABLE t1;
#
+# MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, but 1 result in 10.1.41
+#
+CREATE TABLE t1
+(
+id INT NOT NULL PRIMARY KEY,
+id2 INT,
+k TINYINT,
+j INT,
+t DATETIME,
+KEY k1 (id2,k,j,t)
+);
+INSERT INTO t1 VALUES
+(53,54,1,0,'2019-12-13 10:09:59'),
+(54,54,1,0,'2019-12-13 16:28:41'),
+(55,54,1,0,'2019-12-13 16:29:10'),
+(56,54,1,0,'2019-12-13 16:29:43'),
+(57,54,1,0,'2019-12-13 16:30:16'),
+(58,54,1,0,'2019-12-13 16:30:49'),
+(59,54,1,0,'2019-12-13 16:31:23'),
+(60,54,1,0,'2019-12-13 16:31:55'),
+(61,54,1,0,'2019-12-13 16:32:28'),
+(62,54,1,0,'2019-12-13 16:33:01'),
+(63,54,1,0,'2019-12-13 16:33:34'),
+(64,54,1,0,'2019-12-13 16:34:07'),
+(65,54,1,0,'2019-12-13 16:34:40'),
+(66,54,1,0,'2019-12-13 16:35:13'),
+(67,54,1,0,'2019-12-13 16:35:46'),
+(68,54,1,0,'2019-12-13 16:36:19');
+SELECT t FROM t1 GROUP BY t HAVING t=max(t);
+t
+2019-12-13 10:09:59
+2019-12-13 16:28:41
+2019-12-13 16:29:10
+2019-12-13 16:29:43
+2019-12-13 16:30:16
+2019-12-13 16:30:49
+2019-12-13 16:31:23
+2019-12-13 16:31:55
+2019-12-13 16:32:28
+2019-12-13 16:33:01
+2019-12-13 16:33:34
+2019-12-13 16:34:07
+2019-12-13 16:34:40
+2019-12-13 16:35:13
+2019-12-13 16:35:46
+2019-12-13 16:36:19
+SELECT t FROM t1 WHERE id2=54 and j=0 and k=1 GROUP BY t HAVING t=max(t);
+t
+2019-12-13 10:09:59
+2019-12-13 16:28:41
+2019-12-13 16:29:10
+2019-12-13 16:29:43
+2019-12-13 16:30:16
+2019-12-13 16:30:49
+2019-12-13 16:31:23
+2019-12-13 16:31:55
+2019-12-13 16:32:28
+2019-12-13 16:33:01
+2019-12-13 16:33:34
+2019-12-13 16:34:07
+2019-12-13 16:34:40
+2019-12-13 16:35:13
+2019-12-13 16:35:46
+2019-12-13 16:36:19
+DROP TABLE t1;
+CREATE TABLE t1 (pk INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 VALUES (1);
+SELECT pk<DATE'2001-01-01' FROM t1 GROUP BY pk;
+pk<DATE'2001-01-01'
+1
+Warnings:
+Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
+SELECT pk<DATE'2001-01-01' FROM v1 GROUP BY pk;
+pk<DATE'2001-01-01'
+1
+Warnings:
+Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
+DROP VIEW v1;
+DROP TABLE t1;
+#
# End of 10.1 tests
#
#