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
Warning 1292 Truncated incorrect date value: '2001-01-01x'
542
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
543
+
EXPLAIN EXTENDED
544
+
SELECT * FROM t1 WHERE HEX(a)!=CONCAT('xx',RAND()) AND a='2001-01-01x';
545
+
id select_type table type possible_keys key key_len ref rows filtered Extra
546
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
547
+
Warnings:
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())))
550
+
DROP TABLE t1;
551
+
CREATE TABLE t1 (a DATE);
552
+
INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
553
+
SELECT * FROM t1 WHERE LENGTH(a)=11;
554
+
a
555
+
SELECT * FROM t1 WHERE LENGTH(a)=11 AND a=' 2001-01-01';
556
+
a
557
+
EXPLAIN EXTENDED
558
+
SELECT * FROM t1 WHERE LENGTH(a)=11 AND a=' 2001-01-01';
559
+
id select_type table type possible_keys key key_len ref rows filtered Extra
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
563
+
EXPLAIN EXTENDED
564
+
SELECT * FROM t1 WHERE LENGTH(a)=11+RAND() AND a=' 2001-01-01';
565
+
id select_type table type possible_keys key key_len ref rows filtered Extra
566
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
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())))
569
+
EXPLAIN EXTENDED
570
+
SELECT * FROM t1 WHERE LENGTH(a)=11+RAND() AND a=' garbage ';
571
+
id select_type table type possible_keys key key_len ref rows filtered Extra
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` = '2001-01-01 00:00:00x') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand())))
981
+
DROP TABLE t1;
982
+
CREATE TABLE t1 (a DATETIME);;
983
+
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
984
+
SELECT * FROM t1 WHERE LENGTH(a)=19;
985
+
a
986
+
2001-01-01 00:00:00
987
+
2001-01-01 00:00:01
988
+
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
989
+
a
990
+
2001-01-01 00:00:00
991
+
EXPLAIN EXTENDED
992
+
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
993
+
id select_type table type possible_keys key key_len ref rows filtered Extra
994
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
995
+
Warnings:
996
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ' 2001-01-01 00:00:00')
997
+
EXPLAIN EXTENDED
998
+
SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00';
999
+
id select_type table type possible_keys key key_len ref rows filtered Extra
1000
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1001
+
Warnings:
1002
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand())))
1003
+
EXPLAIN EXTENDED
1004
+
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage ';
1005
+
id select_type table type possible_keys key key_len ref rows filtered Extra
1006
+
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`) = (30 + rand())))
1010
+
DROP TABLE t1;
1011
+
CREATE TABLE t1 (a DATETIME);;
1012
+
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
1013
+
SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
1014
+
a
1015
+
2001-01-01 00:00:00
1016
+
SELECT * FROM t1 WHERE LENGTH(a)=19;
1017
+
a
1018
+
2001-01-01 00:00:00
1019
+
2001-01-01 00:00:01
1020
+
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
1021
+
a
1022
+
2001-01-01 00:00:00
1023
+
EXPLAIN EXTENDED
1024
+
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
1025
+
id select_type table type possible_keys key key_len ref rows filtered Extra
1026
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1027
+
Warnings:
1028
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000')
1029
+
EXPLAIN EXTENDED
1030
+
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
1031
+
id select_type table type possible_keys key key_len ref rows filtered Extra
1032
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1033
+
Warnings:
1034
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (30 + rand())))
1035
+
DROP TABLE t1;
1036
+
CREATE TABLE t1 (a DATETIME(6));;
1037
+
INSERT INTO t1 VALUES ('2001-01-01 00:00:00.000000'),('2001-01-01 00:00:01.000000');
1038
+
SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
1039
+
a
1040
+
2001-01-01 00:00:00.000000
1041
+
SELECT * FROM t1 WHERE LENGTH(a)=26;
1042
+
a
1043
+
2001-01-01 00:00:00.000000
1044
+
2001-01-01 00:00:01.000000
1045
+
SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
1046
+
a
1047
+
2001-01-01 00:00:00.000000
1048
+
EXPLAIN EXTENDED
1049
+
SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
1050
+
id select_type table type possible_keys key key_len ref rows filtered Extra
1051
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1052
+
Warnings:
1053
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000')
1054
+
EXPLAIN EXTENDED
1055
+
SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
1056
+
id select_type table type possible_keys key key_len ref rows filtered Extra
1057
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1058
+
Warnings:
1059
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00.000000')) = (40 + rand())))
1060
+
DROP TABLE t1;
1061
+
SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
1062
+
CREATE TABLE t1 (a DATETIME);;
1063
+
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
1064
+
SELECT * FROM t1 WHERE a=TIME'00:00:00';
1065
+
a
1066
+
2001-01-01 00:00:00
1067
+
SELECT * FROM t1 WHERE LENGTH(a)=19;
1068
+
a
1069
+
2001-01-01 00:00:00
1070
+
2001-01-01 00:00:01
1071
+
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
1072
+
a
1073
+
2001-01-01 00:00:00
1074
+
EXPLAIN EXTENDED
1075
+
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
1076
+
id select_type table type possible_keys key key_len ref rows filtered Extra
1077
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1078
+
Warnings:
1079
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
1080
+
EXPLAIN EXTENDED
1081
+
SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00';
1082
+
id select_type table type possible_keys key key_len ref rows filtered Extra
1083
+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1084
+
Warnings:
1085
+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand())))
0 commit comments