1941
1936
show full columns from t2;
1942
1937
Field Type Collation Null Key Default Extra Privileges Comment
1943
1938
auto int NULL NO PRI NULL auto_increment #
1944
fld1 int unsigned NULL NO UNI NULL #
1945
companynr tinyint(3) unsigned NULL NO NULL #
1946
fld3 varchar(30) latin1_swedish_ci NO MUL NULL #
1947
fld4 varchar(35) latin1_swedish_ci NO NULL #
1948
fld5 varchar(35) latin1_swedish_ci NO NULL #
1949
fld6 varchar(4) latin1_swedish_ci NO NULL #
1939
fld1 int NULL NO UNI 0 #
1940
companynr int NULL NO 0 #
1941
fld3 varchar(30) utf8_general_ci NO MUL #
1942
fld4 varchar(35) utf8_general_ci NO #
1943
fld5 varchar(35) utf8_general_ci NO #
1944
fld6 varchar(4) utf8_general_ci NO #
1950
1945
show full columns from t2 from test like 'f%';
1951
1946
Field Type Collation Null Key Default Extra Privileges Comment
1952
fld1 int unsigned NULL NO UNI NULL #
1953
fld3 varchar(30) latin1_swedish_ci NO MUL NULL #
1954
fld4 varchar(35) latin1_swedish_ci NO NULL #
1955
fld5 varchar(35) latin1_swedish_ci NO NULL #
1956
fld6 varchar(4) latin1_swedish_ci NO NULL #
1947
fld1 int NULL NO UNI 0 #
1948
fld3 varchar(30) utf8_general_ci NO MUL #
1949
fld4 varchar(35) utf8_general_ci NO #
1950
fld5 varchar(35) utf8_general_ci NO #
1951
fld6 varchar(4) utf8_general_ci NO #
1957
1952
show full columns from t2 from test like 's%';
1958
1953
Field Type Collation Null Key Default Extra Privileges Comment
1959
1954
drop table t4, t3, t2, t1;
1960
1955
CREATE TABLE t1 (
1961
id bigint unsigned NOT NULL auto_increment,
1956
id bigint NOT NULL auto_increment,
1962
1957
pseudo varchar(35) NOT NULL default '',
1963
1958
PRIMARY KEY (id),
1964
1959
UNIQUE KEY pseudo (pseudo)
1968
1963
SELECT 1 as rnd1 from t1 where rand() > 2;
1971
CREATE TABLE t1 (gvid int unsigned default NULL, hmid int unsigned default NULL, volid int unsigned default NULL, mmid int unsigned default NULL, hdid int unsigned default NULL, fsid int unsigned default NULL, ctid int unsigned default NULL, dtid int unsigned default NULL, cost int unsigned default NULL, performance int unsigned default NULL, serialnumber bigint unsigned default NULL, monitored tinyint unsigned default '1', removed tinyint unsigned default '0', target tinyint unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
1966
CREATE TEMPORARY TABLE t1 (gvid int default NULL, hmid int default NULL, volid int default NULL, mmid int default NULL, hdid int default NULL, fsid int default NULL, ctid int default NULL, dtid int default NULL, cost int default NULL, performance int default NULL, serialnumber bigint default NULL, monitored int default '1', removed int default '0', target int default '0', dt_modified timestamp NOT NULL, name varchar(255) default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
1972
1967
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
1973
CREATE TABLE t2 ( hmid int unsigned default NULL, volid int unsigned default NULL, sampletid smallint unsigned default NULL, sampletime datetime default NULL, samplevalue bigint unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
1968
CREATE TEMPORARY TABLE t2 ( hmid int default NULL, volid int default NULL, sampletid int default NULL, sampletime datetime default NULL, samplevalue bigint default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
1974
1969
INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);
1975
1970
SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
1976
gvid the_success the_fail the_size the_time
1978
Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1
1979
Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1
1971
ERROR HY000: Received an invalid datetime value 'wrong-date-value'.
1980
1972
SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
1981
1973
gvid the_success the_fail the_size the_time
1982
1974
DROP TABLE t1,t2;
2167
CREATE TABLE t1 ( aa char(2), id int NOT NULL auto_increment, t2_id int NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM;
2159
CREATE TEMPORARY TABLE t1 ( aa char(2), id int NOT NULL auto_increment, t2_id int NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM;
2168
2160
INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522);
2169
CREATE TABLE t2 ( id int NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM;
2161
CREATE TEMPORARY TABLE t2 ( id int NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM;
2170
2162
INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522);
2171
2163
select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5;
2818
2809
insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'),
2819
2810
(4,'2005-10-01'),(5,'2005-12-30');
2820
2811
select * from t1 where f2 >= 0 order by f2;
2812
ERROR HY000: Received an invalid datetime value '0'.
2827
2813
select * from t1 where f2 >= '0000-00-00' order by f2;
2814
ERROR HY000: Received an invalid datetime value '0000-00-00'.
2834
2815
select * from t1 where f2 >= '2005-09-31' order by f2;
2816
ERROR HY000: Received an invalid datetime value '2005-09-31'.
2838
2817
select * from t1 where f2 >= '2005-09-3a' order by f2;
2844
Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1
2818
ERROR HY000: Received an invalid datetime value '2005-09-3a'.
2845
2819
select * from t1 where f2 <= '2005-09-31' order by f2;
2820
ERROR HY000: Received an invalid datetime value '2005-09-31'.
2850
2821
select * from t1 where f2 <= '2005-09-3a' order by f2;
2855
Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1
2822
ERROR HY000: Received an invalid datetime value '2005-09-3a'.
2857
2824
CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a));
2858
2825
CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a));
3079
3025
FROM t1 JOIN t2 ON t2.fk=t1.pk
3080
3026
WHERE t2.fk < 'c' AND t2.pk=t1.fk;
3081
3027
id select_type table type possible_keys key key_len ref rows Extra
3082
1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 2 Using where
3083
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 18 test.t1.fk 1 Using where
3028
1 SIMPLE t1 range PRIMARY PRIMARY 42 NULL 2 Using where
3029
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 Using where
3084
3030
EXPLAIN SELECT t2.*
3085
3031
FROM t1 JOIN t2 ON t2.fk=t1.pk
3086
3032
WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk;
3087
3033
id select_type table type possible_keys key key_len ref rows Extra
3088
1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 2 Using where
3089
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 18 test.t1.fk 1 Using where
3034
1 SIMPLE t1 range PRIMARY PRIMARY 42 NULL 2 Using where
3035
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 Using where
3090
3036
EXPLAIN SELECT t2.*
3091
3037
FROM t1 JOIN t2 ON t2.fk=t1.pk
3092
3038
WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk;
3093
3039
id select_type table type possible_keys key key_len ref rows Extra
3094
1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 2 Using where
3095
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 18 test.t1.fk 1 Using where
3040
1 SIMPLE t1 range PRIMARY PRIMARY 42 NULL 2 Using where
3041
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 Using where
3096
3042
DROP TABLE t1,t2;
3097
3043
CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a));
3098
3044
CREATE TABLE t2 (a int, b varchar(20) NOT NULL,
3224
3170
EXPLAIN SELECT * FROM t1
3225
3171
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
3226
3172
id select_type table type possible_keys key key_len ref rows Extra
3227
1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index
3173
1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL # Using intersect(idx2,idx1); Using where; Using index
3228
3174
EXPLAIN SELECT * FROM t1
3229
3175
WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ;
3230
3176
id select_type table type possible_keys key key_len ref rows Extra
3231
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where
3177
1 SIMPLE t1 ref idx1,idx2 idx2 4 const # Using where
3232
3178
EXPLAIN SELECT * FROM t1
3233
3179
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL;
3234
3180
id select_type table type possible_keys key key_len ref rows Extra
3235
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where
3181
1 SIMPLE t1 ref idx1,idx2 idx2 4 const # Using where
3236
3182
DROP INDEX idx1 ON t1;
3237
3183
CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null);
3238
3184
EXPLAIN SELECT * FROM t1
3270
3216
AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31";
3271
3217
id select_type table type possible_keys key key_len ref rows Extra
3272
3218
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
3273
1 SIMPLE t1 range ts ts 4 NULL 1 Using index condition; Using where; Using MRR
3275
Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1
3219
1 SIMPLE t1 range ts ts 5 NULL 1 Using where
3276
3220
SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30
3277
3221
AND t1.ts BETWEEN t2.dt1 AND t2.dt2
3278
3222
AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31";
3280
3224
30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00
3282
Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1
3283
3225
DROP TABLE t1,t2;
3284
create table t1 (a bigint unsigned);
3226
create table t1 (a bigint);
3285
3227
insert into t1 values
3286
(if(1, 9223372036854775808, 1)),
3287
(case when 1 then 9223372036854775808 else 1 end),
3288
(coalesce(9223372036854775808, 1));
3228
(if(1, 92233720368547758, 1)),
3229
(case when 1 then 92233720368547758 else 1 end),
3230
(coalesce(92233720368547758, 1));
3289
3231
select * from t1;
3295
3237
create table t1 select
3296
3238
if(1, 9223372036854775808, 1) i,
3298
3240
coalesce(9223372036854775808, 1) co;
3299
3241
show create table t1;
3300
3242
Table Create Table
3301
t1 CREATE TABLE "t1" (
3302
"i" decimal(19,0) NOT NULL,
3303
"c" decimal(19,0) NOT NULL,
3304
"co" decimal(19,0) NOT NULL
3305
) ENGINE=InnoDB DEFAULT CHARSET=latin1
3243
t1 CREATE TABLE `t1` (
3244
`i` decimal(19,0) NOT NULL,
3245
`c` decimal(19,0) NOT NULL,
3246
`co` decimal(19,0) NOT NULL
3308
if(1, cast(1111111111111111111 as unsigned), 1) i,
3309
case when 1 then cast(1111111111111111111 as unsigned) else 1 end c,
3310
coalesce(cast(1111111111111111111 as unsigned), 1) co;
3250
if(1, 1111111111111111111, 1) i,
3251
case when 1 then 1111111111111111111 else 1 end c,
3252
coalesce(1111111111111111111, 1) co;
3312
3254
1111111111111111111 1111111111111111111 1111111111111111111
3313
3255
CREATE TABLE t1 (name varchar(255));
3635
3577
DROP TABLE t1, t2, t3;
3636
select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT'
3637
and '2007/10/20 00:00:00 GMT';
3638
str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT'
3639
and '2007/10/20 00:00:00 GMT'
3642
Warning 1292 Truncated incorrect datetime value: '2007/10/01 00:00:00 GMT'
3643
Warning 1292 Truncated incorrect datetime value: '2007/10/20 00:00:00 GMT'
3644
select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6';
3645
str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'
3648
Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6'
3649
select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6';
3650
str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'
3653
Warning 1292 Truncated incorrect date value: '2007/10/2000:00:00 GMT-6'
3654
select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6';
3655
str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'
3658
Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6'
3659
select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6';
3660
str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'
3663
Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6'
3664
select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6';
3665
str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'
3668
Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6'
3669
select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6';
3670
str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'
3673
Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6'
3674
select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6';
3675
str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'
3678
Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6'
3679
select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6';
3680
str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'
3683
Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6'
3684
select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6';
3685
str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'
3688
Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6'
3689
select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56';
3690
str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'
3692
select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00';
3693
str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'
3695
select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00';
3696
str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'
3698
select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00';
3699
str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'
3702
Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34'
3703
select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34';
3704
str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34'
3706
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
3707
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
3709
select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
3710
and '2007/10/20 00:00:00';
3711
str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
3712
and '2007/10/20 00:00:00'
3714
select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20';
3715
str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'
3718
Warning 1292 Truncated incorrect datetime value: ''
3719
select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20';
3720
str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'
3722
select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
3723
str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'
3725
select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34';
3726
str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'
3728
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '';
3729
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''
3732
Warning 1292 Truncated incorrect datetime value: ''
3733
select str_to_date('1','%Y-%m-%d') = '1';
3734
str_to_date('1','%Y-%m-%d') = '1'
3737
Warning 1292 Truncated incorrect date value: '1'
3738
select str_to_date('1','%Y-%m-%d') = '1';
3739
str_to_date('1','%Y-%m-%d') = '1'
3742
Warning 1292 Truncated incorrect date value: '1'
3743
select str_to_date('','%Y-%m-%d') = '';
3744
str_to_date('','%Y-%m-%d') = ''
3747
Warning 1292 Truncated incorrect date value: ''
3748
select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL;
3749
str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL
3751
select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00';
3752
str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'
3754
select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL;
3755
str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL
3759
3580
# Bug#30736: Row Size Too Large Error Creating a Table and
3664
CREATE TABLE t1 (a INT);
3665
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
3666
CREATE TABLE t2 (b INT);
3667
INSERT INTO t2 VALUES (2);
3668
SELECT * FROM t1 WHERE a = 1 + 1;
3671
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1 + 1;
3672
id select_type table type possible_keys key key_len ref rows filtered Extra
3673
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
3675
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = <cache>((1 + 1)))
3676
SELECT * FROM t1 HAVING a = 1 + 1;
3679
EXPLAIN EXTENDED SELECT * FROM t1 HAVING a = 1 + 1;
3680
id select_type table type possible_keys key key_len ref rows filtered Extra
3681
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
3683
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having (`test`.`t1`.`a` = <cache>((1 + 1)))
3684
SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
3687
EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
3688
id select_type table type possible_keys key key_len ref rows filtered Extra
3689
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00
3690
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer
3692
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + <cache>((1 + 1))))
3693
SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
3696
EXPLAIN EXTENDED SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
3697
id select_type table type possible_keys key key_len ref rows filtered Extra
3698
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00
3699
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
3701
Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where 1
3702
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00');
3703
id select_type table type possible_keys key key_len ref rows filtered Extra
3704
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
3706
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > <cache>(unix_timestamp('2009-03-10 00:00:00')))