1 # Created for verifying bug#20577.
2 # expects TABLE t1 (... , a DATE, ...)
5 SELECT * FROM t1 WHERE a <
'1001-01-01';
7 SELECT * FROM t1 WHERE a <=
'1001-01-01';
9 SELECT * FROM t1 WHERE a >=
'1001-01-01';
11 SELECT * FROM t1 WHERE a >
'1001-01-01';
13 SELECT * FROM t1 WHERE a =
'1001-01-01';
15 SELECT * FROM t1 WHERE a <
'1001-00-00';
17 SELECT * FROM t1 WHERE a <=
'1001-00-00';
19 SELECT * FROM t1 WHERE a >=
'1001-00-00';
21 SELECT * FROM t1 WHERE a >
'1001-00-00';
23 SELECT * FROM t1 WHERE a =
'1001-00-00';
24 --echo # Disabling warnings
for the invalid date
27 SELECT * FROM t1 WHERE a <
'1999-02-31';
29 SELECT * FROM t1 WHERE a <=
'1999-02-31';
31 SELECT * FROM t1 WHERE a >=
'1999-02-31';
33 SELECT * FROM t1 WHERE a >
'1999-02-31';
35 SELECT * FROM t1 WHERE a =
'1999-02-31';
38 SELECT * FROM t1 WHERE a BETWEEN
'0000-00-00' AND
'1002-00-00';
40 SELECT * FROM t1 WHERE a BETWEEN
'0000-00-00' AND
'1001-01-01';
42 SELECT * FROM t1 WHERE a BETWEEN
'0001-01-02' AND
'1002-00-00';
44 SELECT * FROM t1 WHERE a BETWEEN
'0001-01-01' AND
'1001-01-01';
45 if ($explain_partitions)
47 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <
'1001-01-01';
48 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <=
'1001-01-01';
49 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >=
'1001-01-01';
50 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >
'1001-01-01';
51 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a =
'1001-01-01';
52 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <
'1001-00-00';
53 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <=
'1001-00-00';
54 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >=
'1001-00-00';
55 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >
'1001-00-00';
56 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a =
'1001-00-00';
57 --echo # Disabling warnings
for the invalid date
59 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <
'1999-02-31';
60 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <=
'1999-02-31';
61 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >=
'1999-02-31';
62 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >
'1999-02-31';
63 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a =
'1999-02-31';
65 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN
'0000-00-00' AND
'1002-00-00';
66 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN
'0000-00-00' AND
'1001-01-01';
67 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN
'0001-01-02' AND
'1002-00-00';
68 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN
'0001-01-01' AND
'1001-01-01';