You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mysql-test/r/subselect.result
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -402,13 +402,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
402
402
id select_type table type possible_keys key key_len ref rows filtered Extra
403
403
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
404
404
Warnings:
405
-
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
405
+
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
406
406
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
407
407
id select_type table type possible_keys key key_len ref rows filtered Extra
408
408
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
409
409
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
410
410
Warnings:
411
-
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
411
+
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
412
412
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
Copy file name to clipboardExpand all lines: mysql-test/r/subselect_no_exists_to_in.result
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -406,13 +406,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
406
406
id select_type table type possible_keys key key_len ref rows filtered Extra
407
407
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
408
408
Warnings:
409
-
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
409
+
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
410
410
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
411
411
id select_type table type possible_keys key key_len ref rows filtered Extra
412
412
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
413
413
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
414
414
Warnings:
415
-
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
415
+
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
416
416
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
Copy file name to clipboardExpand all lines: mysql-test/r/subselect_no_mat.result
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -409,13 +409,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
409
409
id select_type table type possible_keys key key_len ref rows filtered Extra
410
410
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
411
411
Warnings:
412
-
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
412
+
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
413
413
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
414
414
id select_type table type possible_keys key key_len ref rows filtered Extra
415
415
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
416
416
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
417
417
Warnings:
418
-
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
418
+
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
419
419
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
Copy file name to clipboardExpand all lines: mysql-test/r/subselect_no_opts.result
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -405,13 +405,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
405
405
id select_type table type possible_keys key key_len ref rows filtered Extra
406
406
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
407
407
Warnings:
408
-
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
408
+
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
409
409
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
410
410
id select_type table type possible_keys key key_len ref rows filtered Extra
411
411
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
412
412
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
413
413
Warnings:
414
-
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
414
+
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
415
415
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
Copy file name to clipboardExpand all lines: mysql-test/r/subselect_no_scache.result
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -408,13 +408,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
408
408
id select_type table type possible_keys key key_len ref rows filtered Extra
409
409
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
410
410
Warnings:
411
-
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
411
+
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
412
412
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
413
413
id select_type table type possible_keys key key_len ref rows filtered Extra
414
414
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
415
415
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
416
416
Warnings:
417
-
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
417
+
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
418
418
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
Copy file name to clipboardExpand all lines: mysql-test/r/subselect_no_semijoin.result
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -405,13 +405,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
405
405
id select_type table type possible_keys key key_len ref rows filtered Extra
406
406
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
407
407
Warnings:
408
-
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
408
+
Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
409
409
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
410
410
id select_type table type possible_keys key key_len ref rows filtered Extra
411
411
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
412
412
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
413
413
Warnings:
414
-
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
414
+
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
415
415
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
Copy file name to clipboardExpand all lines: mysql-test/r/type_date.result
+160-6Lines changed: 160 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -503,12 +503,12 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a BETWEEN '2001-01-01
503
503
id select_type table type possible_keys key key_len ref rows filtered Extra
504
504
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
505
505
Warnings:
506
-
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '2001-01-01')
506
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01')
507
507
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a IN ('2001-01-01','2001-01-02');
508
508
id select_type table type possible_keys key key_len ref rows filtered Extra
509
509
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
510
510
Warnings:
511
-
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '2001-01-01')
511
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01')
512
512
DROP TABLE t1;
513
513
#
514
514
# End of 10.1 tests
@@ -546,7 +546,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
546
546
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
547
547
Warnings:
548
548
Warning 1292 Truncated incorrect date value: '2001-01-01x'
549
-
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '2001-01-01x') and (<cache>(hex(DATE'2001-01-01')) <> concat('xx',rand())))
549
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2001-01-01') and (<cache>(hex(DATE'2001-01-01')) <> concat('xx',rand())))
550
550
DROP TABLE t1;
551
551
CREATE TABLE t1 (a DATE);
552
552
INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
@@ -565,14 +565,14 @@ SELECT * FROM t1 WHERE LENGTH(a)=11+RAND() AND a=' 2001-01-01';
565
565
id select_type table type possible_keys key key_len ref rows filtered Extra
566
566
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
567
567
Warnings:
568
-
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 2001-01-01') and (<cache>(length(DATE'2001-01-01')) = (11 + rand())))
568
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2001-01-01') and (<cache>(length(DATE'2001-01-01')) = (11 + rand())))
569
569
EXPLAIN EXTENDED
570
570
SELECT * FROM t1 WHERE LENGTH(a)=11+RAND() AND a=' garbage ';
571
571
id select_type table type possible_keys key key_len ref rows filtered Extra
572
572
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' garbage ') and (length(`test`.`t1`.`a`) = (11 + rand())))
575
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'0000-00-00') and (<cache>(length(DATE'0000-00-00')) = (11 + rand())))
576
576
DROP TABLE t1;
577
577
CREATE TABLE t1 (a DATE);
578
578
INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-01');
@@ -591,8 +591,162 @@ SELECT * FROM t1 WHERE LENGTH(a)=8+RAND() AND a='20010101';
591
591
id select_type table type possible_keys key key_len ref rows filtered Extra
592
592
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
593
593
Warnings:
594
-
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '20010101') and (<cache>(length(DATE'2001-01-01')) = (8 + rand())))
594
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2001-01-01') and (<cache>(length(DATE'2001-01-01')) = (8 + rand())))
595
595
DROP TABLE t1;
596
596
#
597
+
# MDEV-8706 Wrong result for SELECT..WHERE time_column=TIMESTAMP'2015-08-30 00:00:00' AND time_column='00:00:00'
598
+
#
599
+
SET timestamp=UNIX_TIMESTAMP('2015-08-30 10:20:30');
600
+
CREATE TABLE t1 (a DATE);
601
+
INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
602
+
SELECT * FROM t1 WHERE a=TIME'00:00:00';
603
+
a
604
+
2015-08-30
605
+
SELECT * FROM t1 WHERE LENGTH(a)=10;
606
+
a
607
+
2015-08-30
608
+
2015-08-31
609
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'00:00:00';
610
+
a
611
+
2015-08-30
612
+
EXPLAIN EXTENDED
613
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'00:00:00';
614
+
id select_type table type possible_keys key key_len ref rows filtered Extra
615
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
616
+
Warnings:
617
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2015-08-30')
618
+
EXPLAIN EXTENDED
619
+
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'00:00:00';
620
+
id select_type table type possible_keys key key_len ref rows filtered Extra
621
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
622
+
Warnings:
623
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2015-08-30') and (<cache>(length(DATE'2015-08-30')) = (30 + rand())))
624
+
DROP TABLE t1;
625
+
CREATE TABLE t1 (a DATE);
626
+
INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
627
+
SELECT * FROM t1 WHERE a=TIME'24:00:00';
628
+
a
629
+
2015-08-31
630
+
SELECT * FROM t1 WHERE LENGTH(a)=10;
631
+
a
632
+
2015-08-30
633
+
2015-08-31
634
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'24:00:00';
635
+
a
636
+
2015-08-31
637
+
EXPLAIN EXTENDED
638
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'24:00:00';
639
+
id select_type table type possible_keys key key_len ref rows filtered Extra
640
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
641
+
Warnings:
642
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2015-08-31')
643
+
EXPLAIN EXTENDED
644
+
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'24:00:00';
645
+
id select_type table type possible_keys key key_len ref rows filtered Extra
646
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
647
+
Warnings:
648
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2015-08-31') and (<cache>(length(DATE'2015-08-31')) = (30 + rand())))
649
+
DROP TABLE t1;
650
+
# In this example '00:00:00' is not recognized as TIME'00:00:00'
651
+
# and is treated as DATE'0000-00-00'.
652
+
# This may change after MDEV-8322 Distinguish between time and date strings more carefully
653
+
CREATE TABLE t1 (a DATE);
654
+
INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
655
+
SELECT * FROM t1 WHERE a='00:00:00';
656
+
a
657
+
SELECT * FROM t1 WHERE LENGTH(a)=10;
658
+
a
659
+
2015-08-30
660
+
2015-08-31
661
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='00:00:00';
662
+
a
663
+
EXPLAIN EXTENDED
664
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='00:00:00';
665
+
id select_type table type possible_keys key key_len ref rows filtered Extra
666
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
667
+
Warnings:
668
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'0000-00-00')
669
+
EXPLAIN EXTENDED
670
+
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='00:00:00';
671
+
id select_type table type possible_keys key key_len ref rows filtered Extra
672
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
673
+
Warnings:
674
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'0000-00-00') and (<cache>(length(DATE'0000-00-00')) = (30 + rand())))
675
+
DROP TABLE t1;
676
+
CREATE TABLE t1 (a DATE);
677
+
INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
678
+
SELECT * FROM t1 WHERE a=TIMESTAMP'2015-08-30 00:00:00';
679
+
a
680
+
2015-08-30
681
+
SELECT * FROM t1 WHERE LENGTH(a)=10;
682
+
a
683
+
2015-08-30
684
+
2015-08-31
685
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00';
686
+
a
687
+
2015-08-30
688
+
EXPLAIN EXTENDED
689
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00';
690
+
id select_type table type possible_keys key key_len ref rows filtered Extra
691
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
692
+
Warnings:
693
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00')
694
+
EXPLAIN EXTENDED
695
+
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2015-08-30 00:00:00';
696
+
id select_type table type possible_keys key key_len ref rows filtered Extra
697
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
698
+
Warnings:
699
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00') and (<cache>(length(DATE'2015-08-30')) = (30 + rand())))
700
+
DROP TABLE t1;
701
+
CREATE TABLE t1 (a DATE);
702
+
INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
703
+
SELECT * FROM t1 WHERE a=TIMESTAMP'2015-08-30 00:00:00.1';
704
+
a
705
+
SELECT * FROM t1 WHERE LENGTH(a)=10;
706
+
a
707
+
2015-08-30
708
+
2015-08-31
709
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00.1';
710
+
a
711
+
EXPLAIN EXTENDED
712
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00.1';
713
+
id select_type table type possible_keys key key_len ref rows filtered Extra
714
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
715
+
Warnings:
716
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00.1')
717
+
EXPLAIN EXTENDED
718
+
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2015-08-30 00:00:00.1';
719
+
id select_type table type possible_keys key key_len ref rows filtered Extra
720
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
721
+
Warnings:
722
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00.1') and (<cache>(length(DATE'2015-08-30')) = (30 + rand())))
723
+
DROP TABLE t1;
724
+
CREATE TABLE t1 (a DATE);
725
+
INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
726
+
SELECT * FROM t1 WHERE a='2015-08-30 00:00:00';
727
+
a
728
+
2015-08-30
729
+
SELECT * FROM t1 WHERE LENGTH(a)=10;
730
+
a
731
+
2015-08-30
732
+
2015-08-31
733
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='2015-08-30 00:00:00';
734
+
a
735
+
2015-08-30
736
+
EXPLAIN EXTENDED
737
+
SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='2015-08-30 00:00:00';
738
+
id select_type table type possible_keys key key_len ref rows filtered Extra
739
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
740
+
Warnings:
741
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2015-08-30')
742
+
EXPLAIN EXTENDED
743
+
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='2015-08-30 00:00:00';
744
+
id select_type table type possible_keys key key_len ref rows filtered Extra
745
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
746
+
Warnings:
747
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2015-08-30') and (<cache>(length(DATE'2015-08-30')) = (30 + rand())))
0 commit comments