Description:
anet.mysql.com/secure/pushbuild/getlog.pl?dir=bzr_mysql-6.0-bka-preview&entry=Sergey_Petrunia__sergefp-20081227193100-1&name=test_ps_row&plat=sles10-ia64-a-1
main.type_date [ fail ]
--- /data0/pushbuild/pb1-1/pb/bzr_mysql-6.0-bka-preview/51/mysql-6.0.10-alpha-pb51/mysql-test/r/type_date.result 2008-12-27 23:38:46.000000000 +0300
+++ /data0/pushbuild/pb1-1/pb/bzr_mysql-6.0-bka-preview/51/mysql-6.0.10-alpha-pb51/mysql-test/r/type_date.reject 2008-12-28 00:00:00.000000000 +0300
@@ -159,27 +159,27 @@
INSERT INTO t1 VALUES (DATE(NOW()), 1);
SELECT COUNT(*) FROM t1 WHERE a = NOW();
COUNT(*)
-0
+1
EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+1 SIMPLE t1 system PRIMARY NULL NULL NULL 1
INSERT INTO t1 VALUES (DATE(NOW()), 2);
SELECT COUNT(*) FROM t1 WHERE a = NOW();
COUNT(*)
-0
+2
EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+1 SIMPLE t1 ref PRIMARY PRIMARY 3 const 1 Using index
SELECT COUNT(*) FROM t1 WHERE a = NOW() AND b = 1;
COUNT(*)
-0
+1
EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW() AND b = 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+1 SIMPLE t1 const PRIMARY PRIMARY 7 const,const 1 Using index
ALTER TABLE t1 DROP PRIMARY KEY;
SELECT COUNT(*) FROM t1 WHERE a = NOW();
COUNT(*)
-0
+2
EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
mysqltest: Result content mismatch
Stopping All Servers
Restoring snapshot of databases
Resuming Tests
Apparently the test doesn't account for the possibility of midnight
occurring in the middle of the test.
How to repeat:
run type_date.test around midnight or just look at the above diff and see what's the problem
Suggested fix:
Develop a routine which will determine if it is several minutes before the midnight. If it is, either
1. Skip the test
2. Wait until midnight is over before running the test.