mirror of
https://github.com/MariaDB/server.git
synced 2025-10-21 08:47:42 +03:00
Merge siva.hindu.god:/home/tsmith/m/bk/51
into siva.hindu.god:/home/tsmith/m/bk/maint/51 client/mysqltest.c: Auto merged configure.in: Auto merged include/my_global.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/type_datetime.result: Auto merged mysql-test/t/outfile.test: Auto merged mysql-test/t/type_datetime.test: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/log.cc: Auto merged sql/my_decimal.cc: Auto merged sql/my_decimal.h: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sp.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_show.cc: Auto merged sql/structs.h: Auto merged storage/myisam/ha_myisam.cc: Auto merged
This commit is contained in:
@@ -402,7 +402,7 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Using join cache
|
||||
1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00
|
||||
Warnings:
|
||||
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
|
||||
|
@@ -352,3 +352,13 @@ select c1 mod 50 as result from t1;
|
||||
result
|
||||
6
|
||||
drop table t1;
|
||||
create table t1 select -9223372036854775808 bi;
|
||||
describe t1;
|
||||
Field Type Null Key Default Extra
|
||||
bi bigint(20) NO 0
|
||||
drop table t1;
|
||||
create table t1 select -9223372036854775809 bi;
|
||||
describe t1;
|
||||
Field Type Null Key Default Extra
|
||||
bi decimal(19,0) NO 0
|
||||
drop table t1;
|
||||
|
@@ -351,6 +351,12 @@ DROP TABLE t1;
|
||||
select isnull(date(NULL)), isnull(cast(NULL as DATE));
|
||||
isnull(date(NULL)) isnull(cast(NULL as DATE))
|
||||
1 1
|
||||
SELECT CAST(cast('01-01-01' as date) AS UNSIGNED);
|
||||
CAST(cast('01-01-01' as date) AS UNSIGNED)
|
||||
20010101
|
||||
SELECT CAST(cast('01-01-01' as date) AS SIGNED);
|
||||
CAST(cast('01-01-01' as date) AS SIGNED)
|
||||
20010101
|
||||
End of 4.1 tests
|
||||
select cast('1.2' as decimal(3,2));
|
||||
cast('1.2' as decimal(3,2))
|
||||
|
@@ -611,11 +611,11 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 ref period period 4 test.t1.period 4181
|
||||
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 index period period 4 NULL 41810
|
||||
1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using filesort
|
||||
1 SIMPLE t1 ref period period 4 test.t3.period 4181
|
||||
explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index period period 4 NULL 41810
|
||||
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
|
||||
1 SIMPLE t3 ref period period 4 test.t1.period 4181
|
||||
select period from t1;
|
||||
period
|
||||
@@ -1434,7 +1434,7 @@ companynr companynr
|
||||
41 40
|
||||
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
|
||||
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
|
||||
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
|
||||
fld1 companynr fld3 period
|
||||
|
@@ -782,6 +782,100 @@ t1 CREATE TABLE `t1` (
|
||||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MAX_ROWS=4294967295
|
||||
drop table t1;
|
||||
create table t1 select * from t2;
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
create table t1 select * from t1;
|
||||
ERROR HY000: You can't specify target table 't1' for update in FROM clause
|
||||
create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'coalesce'
|
||||
create table t1 (primary key(a)) select "b" as b;
|
||||
ERROR 42000: Key column 'a' doesn't exist in table
|
||||
create table t1 (a int);
|
||||
create table if not exists t1 select 1 as a, 2 as b;
|
||||
ERROR 21S01: Column count doesn't match value count at row 1
|
||||
drop table t1;
|
||||
create table t1 (primary key (a)) (select 1 as a) union all (select 1 as a);
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
create table t1 (i int);
|
||||
create table t1 select 1 as i;
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
create table if not exists t1 select 1 as i;
|
||||
Warnings:
|
||||
Note 1050 Table 't1' already exists
|
||||
select * from t1;
|
||||
i
|
||||
1
|
||||
create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'coalesce'
|
||||
select * from t1;
|
||||
i
|
||||
1
|
||||
alter table t1 add primary key (i);
|
||||
create table if not exists t1 (select 2 as i) union all (select 2 as i);
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
select * from t1;
|
||||
i
|
||||
1
|
||||
2
|
||||
drop table t1;
|
||||
create temporary table t1 (j int);
|
||||
create table if not exists t1 select 1;
|
||||
Warnings:
|
||||
Note 1050 Table 't1' already exists
|
||||
select * from t1;
|
||||
j
|
||||
1
|
||||
drop temporary table t1;
|
||||
select * from t1;
|
||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||
drop table t1;
|
||||
ERROR 42S02: Unknown table 't1'
|
||||
create table t1 (i int);
|
||||
insert into t1 values (1), (2);
|
||||
lock tables t1 read;
|
||||
create table t2 select * from t1;
|
||||
ERROR HY000: Table 't2' was not locked with LOCK TABLES
|
||||
create table if not exists t2 select * from t1;
|
||||
ERROR HY000: Table 't2' was not locked with LOCK TABLES
|
||||
unlock tables;
|
||||
create table t2 (j int);
|
||||
lock tables t1 read;
|
||||
create table t2 select * from t1;
|
||||
ERROR HY000: Table 't2' was not locked with LOCK TABLES
|
||||
create table if not exists t2 select * from t1;
|
||||
ERROR HY000: Table 't2' was not locked with LOCK TABLES
|
||||
unlock tables;
|
||||
lock table t1 read, t2 read;
|
||||
create table t2 select * from t1;
|
||||
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
|
||||
create table if not exists t2 select * from t1;
|
||||
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
|
||||
unlock tables;
|
||||
lock table t1 read, t2 write;
|
||||
create table t2 select * from t1;
|
||||
ERROR 42S01: Table 't2' already exists
|
||||
create table if not exists t2 select * from t1;
|
||||
Warnings:
|
||||
Note 1050 Table 't2' already exists
|
||||
select * from t1;
|
||||
i
|
||||
1
|
||||
2
|
||||
unlock tables;
|
||||
drop table t2;
|
||||
lock tables t1 read;
|
||||
create temporary table t2 select * from t1;
|
||||
create temporary table if not exists t2 select * from t1;
|
||||
Warnings:
|
||||
Note 1050 Table 't2' already exists
|
||||
select * from t2;
|
||||
i
|
||||
1
|
||||
2
|
||||
1
|
||||
2
|
||||
unlock tables;
|
||||
drop table t1, t2;
|
||||
create table t1 (upgrade int);
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
164
mysql-test/r/create_select-big.result
Normal file
164
mysql-test/r/create_select-big.result
Normal file
@@ -0,0 +1,164 @@
|
||||
drop table if exists t1,t2,t3,t4,t5;
|
||||
set session debug="+d,sleep_create_select_before_create";
|
||||
create table t1 select 1 as i;;
|
||||
create table t1 (j char(5));
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`i` int(1) NOT NULL DEFAULT '0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 select 1 as i;;
|
||||
create table t1 select "Test" as j;
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`i` int(1) NOT NULL DEFAULT '0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t3 (j char(5));
|
||||
create table t1 select 1 as i;;
|
||||
create table t1 like t3;
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`i` int(1) NOT NULL DEFAULT '0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 select 1 as i;;
|
||||
rename table t3 to t1;
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`i` int(1) NOT NULL DEFAULT '0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 select 1 as i;;
|
||||
alter table t3 rename to t1;
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`i` int(1) NOT NULL DEFAULT '0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 select 1 as i;;
|
||||
alter table t3 rename to t1, add k int;
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`i` int(1) NOT NULL DEFAULT '0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1, t3;
|
||||
set session debug="-d,sleep_create_select_before_create:+d,sleep_create_select_before_open";
|
||||
create table t1 select 1 as i;;
|
||||
drop table t1;
|
||||
create table t1 select 1 as i;;
|
||||
rename table t1 to t2;
|
||||
drop table t2;
|
||||
create table t1 select 1 as i;;
|
||||
select * from t1;
|
||||
i
|
||||
1
|
||||
drop table t1;
|
||||
create table t1 select 1 as i;;
|
||||
insert into t1 values (2);
|
||||
select * from t1;
|
||||
i
|
||||
1
|
||||
2
|
||||
drop table t1;
|
||||
set @a:=0;
|
||||
create table t1 select 1 as i;;
|
||||
create trigger t1_bi before insert on t1 for each row set @a:=1;
|
||||
select @a;
|
||||
@a
|
||||
0
|
||||
drop table t1;
|
||||
set session debug="-d,sleep_create_select_before_open:+d,sleep_create_select_before_lock";
|
||||
create table t1 select 1 as i;;
|
||||
drop table t1;
|
||||
create table t1 select 1 as i;;
|
||||
rename table t1 to t2;
|
||||
drop table t2;
|
||||
create table t1 select 1 as i;;
|
||||
select * from t1;
|
||||
i
|
||||
1
|
||||
drop table t1;
|
||||
create table t1 select 1 as i;;
|
||||
insert into t1 values (2);
|
||||
select * from t1;
|
||||
i
|
||||
1
|
||||
2
|
||||
drop table t1;
|
||||
set @a:=0;
|
||||
create table t1 select 1 as i;;
|
||||
create trigger t1_bi before insert on t1 for each row set @a:=1;
|
||||
select @a;
|
||||
@a
|
||||
0
|
||||
drop table t1;
|
||||
set session debug="-d,sleep_create_select_before_lock:+d,sleep_create_select_before_check_if_exists";
|
||||
create table t1 (i int);
|
||||
create table if not exists t1 select 1 as i;;
|
||||
drop table t1;
|
||||
Warnings:
|
||||
Note 1050 Table 't1' already exists
|
||||
create table t1 (i int);
|
||||
set @a:=0;
|
||||
create table if not exists t1 select 1 as i;;
|
||||
create trigger t1_bi before insert on t1 for each row set @a:=1;
|
||||
Warnings:
|
||||
Note 1050 Table 't1' already exists
|
||||
select @a;
|
||||
@a
|
||||
0
|
||||
select * from t1;
|
||||
i
|
||||
1
|
||||
drop table t1;
|
||||
set session debug="-d,sleep_create_select_before_check_if_exists";
|
||||
create table t2 (a int);
|
||||
create table t4 (b int);
|
||||
lock table t4 write;
|
||||
select 1;
|
||||
1
|
||||
1
|
||||
create table t3 as select * from t4;;
|
||||
create table t1 select * from t2, t3;;
|
||||
unlock tables;
|
||||
select * from t1;
|
||||
a b
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1, t3;
|
||||
lock table t4 read;
|
||||
select 1;
|
||||
1
|
||||
1
|
||||
rename table t4 to t3;;
|
||||
create table if not exists t1 select 1 as i from t2, t3;;
|
||||
create table t5 (j int);
|
||||
rename table t5 to t1;
|
||||
unlock tables;
|
||||
Warnings:
|
||||
Note 1050 Table 't1' already exists
|
||||
select * from t1;
|
||||
j
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`j` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1, t2, t3;
|
@@ -1454,7 +1454,7 @@ insert into t1 values ('123'), ('456');
|
||||
explain
|
||||
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
|
||||
1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort; Using join cache
|
||||
1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where
|
||||
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
|
||||
substr(Z.a,-1) a
|
||||
|
@@ -57,7 +57,7 @@ a b a b
|
||||
3 c 3 c
|
||||
explain select * from t1 as x1, (select * from t1) as x2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY x1 ALL NULL NULL NULL NULL 4
|
||||
1 PRIMARY x1 ALL NULL NULL NULL NULL 4 Using join cache
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4
|
||||
2 DERIVED t1 ALL NULL NULL NULL NULL 4
|
||||
drop table if exists t2,t3;
|
||||
@@ -188,13 +188,13 @@ pla_id test
|
||||
105 3
|
||||
explain SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
|
||||
1 PRIMARY m2 ALL NULL NULL NULL NULL 9 Using join cache
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 Using where
|
||||
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
|
||||
2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
|
||||
explain SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
|
||||
1 PRIMARY m2 ALL NULL NULL NULL NULL 9 Using join cache
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 Using where
|
||||
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
|
||||
2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
|
||||
@@ -245,7 +245,7 @@ a a
|
||||
2 2
|
||||
explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using join cache
|
||||
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2
|
||||
4 DERIVED t1 ALL NULL NULL NULL NULL 2
|
||||
5 UNION t1 ALL NULL NULL NULL NULL 2
|
||||
@@ -312,7 +312,7 @@ b 3.5000
|
||||
explain SELECT s.name, AVG(s.val) AS median FROM (SELECT x.name, x.val FROM t1 x, t1 y WHERE x.name=y.name GROUP BY x.name, x.val HAVING SUM(y.val <= x.val) >= COUNT(*)/2 AND SUM(y.val >= x.val) >= COUNT(*)/2) AS s GROUP BY s.name;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 Using temporary; Using filesort
|
||||
2 DERIVED x ALL NULL NULL NULL NULL 17 Using temporary; Using filesort
|
||||
2 DERIVED x ALL NULL NULL NULL NULL 17 Using temporary; Using filesort; Using join cache
|
||||
2 DERIVED y ALL NULL NULL NULL NULL 17 Using where
|
||||
drop table t1;
|
||||
create table t2 (a int, b int, primary key (a));
|
||||
|
@@ -174,7 +174,7 @@ INSERT INTO t3 VALUES (1,'1'),(2,'2'),(1,'1'),(2,'2');
|
||||
explain SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using temporary
|
||||
1 SIMPLE t3 ref a a 5 test.t1.b 2 Using where; Using index
|
||||
1 SIMPLE t3 ref a a 5 test.t1.b 2 Using where; Using index; Using join cache
|
||||
1 SIMPLE t2 index a a 4 NULL 5 Using where; Using index; Distinct
|
||||
SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
|
||||
a
|
||||
@@ -299,11 +299,11 @@ WHERE
|
||||
((t1.id=j_lj_t2.id AND t2_lj.id IS NULL) OR (t1.id=t2.id AND t2.idx=2))
|
||||
AND ((t1.id=j_lj_t3.id AND t3_lj.id IS NULL) OR (t1.id=t3.id AND t3.idx=2));
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index id id 4 NULL 2 Using index; Using temporary
|
||||
1 SIMPLE t2 index id id 8 NULL 1 Using index; Distinct
|
||||
1 SIMPLE t3 index id id 8 NULL 1 Using index; Distinct
|
||||
1 SIMPLE t1 index id id 4 NULL 2 Using index; Using temporary; Using join cache
|
||||
1 SIMPLE t2 index id id 8 NULL 1 Using index; Distinct; Using join cache
|
||||
1 SIMPLE t3 index id id 8 NULL 1 Using index; Distinct; Using join cache
|
||||
1 SIMPLE j_lj_t2 index id id 4 NULL 2 Using where; Using index; Distinct
|
||||
1 SIMPLE t2_lj ref id id 4 test.j_lj_t2.id 1 Using where; Using index; Distinct
|
||||
1 SIMPLE t2_lj ref id id 4 test.j_lj_t2.id 1 Using where; Using index; Distinct; Using join cache
|
||||
1 SIMPLE j_lj_t3 index id id 4 NULL 2 Using where; Using index; Distinct
|
||||
1 SIMPLE t3_lj ref id id 4 test.j_lj_t3.id 1 Using where; Using index; Distinct
|
||||
SELECT DISTINCT
|
||||
@@ -514,7 +514,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1_1 ALL NULL NULL NULL NULL 3 Using temporary
|
||||
1 SIMPLE t1_1 ALL NULL NULL NULL NULL 3 Using temporary; Using join cache
|
||||
1 SIMPLE t1_2 index NULL PRIMARY 4 NULL 3 Using index; Distinct
|
||||
EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2
|
||||
WHERE t1_1.a = t1_2.a;
|
||||
|
@@ -4,9 +4,11 @@ show variables like 'log_bin%';
|
||||
Variable_name Value
|
||||
log_bin OFF
|
||||
log_bin_trust_function_creators ON
|
||||
log_bin_trust_routine_creators ON
|
||||
flush logs;
|
||||
show variables like 'log_bin%';
|
||||
Variable_name Value
|
||||
log_bin OFF
|
||||
log_bin_trust_function_creators ON
|
||||
log_bin_trust_routine_creators ON
|
||||
set global expire_logs_days = 0;
|
||||
|
@@ -613,7 +613,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
explain
|
||||
select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 > 'CA';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range k1 k1 7 NULL 1 Using where; Using index
|
||||
1 SIMPLE t1 range k1 k1 7 NULL 1 Using where; Using index; Using join cache
|
||||
1 SIMPLE t2 range k1 k1 3 NULL 4 Using where; Using index
|
||||
explain
|
||||
select min(a4 - 0.01) from t1;
|
||||
@@ -650,7 +650,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
explain
|
||||
select concat(min(t1.a1),min(t2.a4)) from t1, t2 where t2.a4 <> 'AME';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range k2 k2 4 NULL 6 Using where; Using index
|
||||
1 SIMPLE t2 range k2 k2 4 NULL 6 Using where; Using index; Using join cache
|
||||
1 SIMPLE t1 index NULL PRIMARY 3 NULL 15 Using index
|
||||
drop table t1, t2;
|
||||
create table t1 (a char(10));
|
||||
|
@@ -78,7 +78,7 @@ min(7)
|
||||
7
|
||||
explain select min(7) from t2i join t1i;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
|
||||
1 SIMPLE t2i ALL NULL NULL NULL NULL 1 Using join cache
|
||||
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
|
||||
select min(7) from t2i join t1i;
|
||||
min(7)
|
||||
@@ -94,7 +94,7 @@ max(7)
|
||||
7
|
||||
explain select max(7) from t2i join t1i;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
|
||||
1 SIMPLE t2i ALL NULL NULL NULL NULL 1 Using join cache
|
||||
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
|
||||
select max(7) from t2i join t1i;
|
||||
max(7)
|
||||
|
@@ -474,6 +474,7 @@ CREATE TABLE t4 (a DATE);
|
||||
INSERT INTO t4 VALUES ('1972-02-06'), ('1972-07-29');
|
||||
SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29');
|
||||
a
|
||||
1972-02-06
|
||||
Warnings:
|
||||
Warning 1292 Incorrect date value: '19772-07-29' for column 'a' at row 1
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
|
@@ -394,7 +394,7 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Using join cache
|
||||
1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00
|
||||
Warnings:
|
||||
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
|
||||
|
@@ -1194,6 +1194,25 @@ ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table '
|
||||
DROP DATABASE mysqltest1;
|
||||
DROP DATABASE mysqltest2;
|
||||
DROP USER mysqltest_1@localhost;
|
||||
use test;
|
||||
CREATE TABLE t1 (f1 int, f2 int);
|
||||
INSERT INTO t1 VALUES(1,1), (2,2);
|
||||
CREATE DATABASE db27878;
|
||||
GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost';
|
||||
GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost';
|
||||
GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost';
|
||||
use db27878;
|
||||
CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1;
|
||||
use db27878;
|
||||
UPDATE v1 SET f2 = 4;
|
||||
ERROR HY000: View 'db27878.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM test.t1;
|
||||
f1 f2
|
||||
1 1
|
||||
2 2
|
||||
DROP DATABASE db27878;
|
||||
use test;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
set names utf8;
|
||||
grant select on test.* to юзер_юзер@localhost;
|
||||
|
@@ -120,11 +120,11 @@ select @@optimizer_search_depth;
|
||||
63
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -132,11 +132,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -144,11 +144,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -156,11 +156,11 @@ Variable_name Value
|
||||
Last_query_cost 794.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -168,11 +168,11 @@ Variable_name Value
|
||||
Last_query_cost 794.837037
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
show status like 'Last_query_cost';
|
||||
@@ -180,11 +180,11 @@ Variable_name Value
|
||||
Last_query_cost 794.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
show status like 'Last_query_cost';
|
||||
@@ -200,11 +200,11 @@ select @@optimizer_search_depth;
|
||||
0
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -212,11 +212,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -224,11 +224,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -236,11 +236,11 @@ Variable_name Value
|
||||
Last_query_cost 289.418727
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -248,11 +248,11 @@ Variable_name Value
|
||||
Last_query_cost 289.418727
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
show status like 'Last_query_cost';
|
||||
@@ -260,11 +260,11 @@ Variable_name Value
|
||||
Last_query_cost 289.418727
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
show status like 'Last_query_cost';
|
||||
@@ -276,11 +276,11 @@ select @@optimizer_search_depth;
|
||||
1
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -288,11 +288,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -303,9 +303,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
@@ -315,9 +315,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
@@ -327,9 +327,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
@@ -339,9 +339,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
@@ -352,11 +352,11 @@ select @@optimizer_search_depth;
|
||||
62
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -364,11 +364,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -376,11 +376,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -388,11 +388,11 @@ Variable_name Value
|
||||
Last_query_cost 289.418727
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -400,11 +400,11 @@ Variable_name Value
|
||||
Last_query_cost 289.418727
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
show status like 'Last_query_cost';
|
||||
@@ -412,11 +412,11 @@ Variable_name Value
|
||||
Last_query_cost 289.418727
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
show status like 'Last_query_cost';
|
||||
@@ -432,11 +432,11 @@ select @@optimizer_search_depth;
|
||||
0
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -444,11 +444,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -456,11 +456,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -468,11 +468,11 @@ Variable_name Value
|
||||
Last_query_cost 794.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -480,11 +480,11 @@ Variable_name Value
|
||||
Last_query_cost 794.837037
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
show status like 'Last_query_cost';
|
||||
@@ -492,11 +492,11 @@ Variable_name Value
|
||||
Last_query_cost 794.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
show status like 'Last_query_cost';
|
||||
@@ -508,11 +508,11 @@ select @@optimizer_search_depth;
|
||||
1
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -520,11 +520,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -535,9 +535,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
@@ -547,9 +547,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
@@ -559,9 +559,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
@@ -571,9 +571,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
@@ -584,11 +584,11 @@ select @@optimizer_search_depth;
|
||||
62
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -596,11 +596,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -608,11 +608,11 @@ Variable_name Value
|
||||
Last_query_cost 821.837037
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -620,11 +620,11 @@ Variable_name Value
|
||||
Last_query_cost 794.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
|
||||
show status like 'Last_query_cost';
|
||||
@@ -632,11 +632,11 @@ Variable_name Value
|
||||
Last_query_cost 794.837037
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
show status like 'Last_query_cost';
|
||||
@@ -644,11 +644,11 @@ Variable_name Value
|
||||
Last_query_cost 794.837037
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
|
||||
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
|
||||
show status like 'Last_query_cost';
|
||||
|
@@ -536,11 +536,11 @@ a b
|
||||
1 1
|
||||
explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort; Using join cache
|
||||
1 SIMPLE t2 ALL a NULL NULL NULL 4 Using where
|
||||
explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using join cache
|
||||
1 SIMPLE t2 ALL a NULL NULL NULL 4 Using where
|
||||
drop table t1,t2;
|
||||
create table t1 (a int, b int);
|
||||
|
@@ -2266,7 +2266,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer1 JOIN t1 AS t1_outer2
|
||||
ON t1_outer1.a = (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2)
|
||||
AND t1_outer1.b = t1_outer2.b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index
|
||||
1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index; Using join cache
|
||||
1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index
|
||||
2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by
|
||||
EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x
|
||||
|
@@ -21,8 +21,8 @@ basedir VALUE
|
||||
server_id VALUE
|
||||
shutdown-delay VALUE
|
||||
skip-stack-trace VALUE
|
||||
skip-innodb VALUE
|
||||
skip-ndbcluster VALUE
|
||||
loose-skip-innodb VALUE
|
||||
loose-skip-ndbcluster VALUE
|
||||
log-output VALUE
|
||||
SHOW INSTANCE OPTIONS mysqld2;
|
||||
option_name value
|
||||
@@ -40,8 +40,8 @@ basedir VALUE
|
||||
server_id VALUE
|
||||
shutdown-delay VALUE
|
||||
skip-stack-trace VALUE
|
||||
skip-innodb VALUE
|
||||
skip-ndbcluster VALUE
|
||||
loose-skip-innodb VALUE
|
||||
loose-skip-ndbcluster VALUE
|
||||
nonguarded VALUE
|
||||
log-output VALUE
|
||||
START INSTANCE mysqld2;
|
||||
|
@@ -270,7 +270,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
explain select * from t0,t1 where t0.key1 = 5 and
|
||||
(t1.key1 = t0.key1 or t1.key8 = t0.key1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t0 ref i1 i1 4 const 1
|
||||
1 SIMPLE t0 ref i1 i1 4 const 1 Using join cache
|
||||
1 SIMPLE t1 index_merge i1,i8 i1,i8 4,4 NULL 2 Using union(i1,i8); Using where
|
||||
explain select * from t0,t1 where t0.key1 < 3 and
|
||||
(t1.key1 = t0.key1 or t1.key8 = t0.key1);
|
||||
@@ -347,7 +347,7 @@ from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
|
||||
where (A.key1 < 500000 or A.key2 < 3)
|
||||
and (B.key1 < 500000 or B.key2 < 3);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE A index_merge i1,i2 i1,i2 4,4 NULL 1013 Using sort_union(i1,i2); Using where
|
||||
1 SIMPLE A index_merge i1,i2 i1,i2 4,4 NULL 1013 Using sort_union(i1,i2); Using where; Using join cache
|
||||
1 SIMPLE B index_merge i1,i2 i1,i2 4,4 NULL 1013 Using sort_union(i1,i2); Using where
|
||||
select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
|
||||
from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
|
||||
@@ -361,7 +361,7 @@ from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
|
||||
where (A.key1 = 1 or A.key2 = 1)
|
||||
and (B.key1 = 1 or B.key2 = 1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE A index_merge i1,i2 i1,i2 4,4 NULL 1020 Using union(i1,i2); Using where
|
||||
1 SIMPLE A index_merge i1,i2 i1,i2 4,4 NULL 1020 Using union(i1,i2); Using where; Using join cache
|
||||
1 SIMPLE B index_merge i1,i2 i1,i2 4,4 NULL 1020 Using union(i1,i2); Using where
|
||||
select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
|
||||
from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
|
||||
@@ -376,7 +376,7 @@ from t0 as A, t0 as B
|
||||
where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7 = 1 or A.key8=1)
|
||||
and (B.key1 = 1 and B.key2 = 1 and B.key3 = 1 and B.key4=1 and B.key5=1 and B.key6=1 and B.key7 = 1 or B.key8=1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE A index_merge i1,i2,i3,i4,i5,i6,i7?,i8 i2,i3,i4,i5,i6,i7?,i8 X NULL # Using union(intersect(i2,i3,i4,i5,i6,i7?),i8); Using where
|
||||
1 SIMPLE A index_merge i1,i2,i3,i4,i5,i6,i7?,i8 i2,i3,i4,i5,i6,i7?,i8 X NULL # Using union(intersect(i2,i3,i4,i5,i6,i7?),i8); Using where; Using join cache
|
||||
1 SIMPLE B index_merge i1,i2,i3,i4,i5,i6,i7?,i8 i2,i3,i4,i5,i6,i7?,i8 X NULL # Using union(intersect(i2,i3,i4,i5,i6,i7?),i8); Using where
|
||||
select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
|
||||
from t0 as A, t0 as B
|
||||
|
@@ -289,7 +289,7 @@ explain select a.ROUTINE_NAME from information_schema.ROUTINES a,
|
||||
information_schema.SCHEMATA b where
|
||||
a.ROUTINE_SCHEMA = b.SCHEMA_NAME;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE # ALL NULL NULL NULL NULL 2
|
||||
1 SIMPLE # ALL NULL NULL NULL NULL 2 Using join cache
|
||||
1 SIMPLE # ALL NULL NULL NULL NULL 2 Using where
|
||||
select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a,
|
||||
mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) order by 1;
|
||||
|
@@ -402,7 +402,7 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Using join cache
|
||||
1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00
|
||||
Warnings:
|
||||
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
|
||||
|
@@ -163,7 +163,7 @@ min(7)
|
||||
7
|
||||
explain select min(7) from t2i join t1i;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
|
||||
1 SIMPLE t2i ALL NULL NULL NULL NULL 1 Using join cache
|
||||
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
|
||||
select min(7) from t2i join t1i;
|
||||
min(7)
|
||||
@@ -179,7 +179,7 @@ max(7)
|
||||
7
|
||||
explain select max(7) from t2i join t1i;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
|
||||
1 SIMPLE t2i ALL NULL NULL NULL NULL 1 Using join cache
|
||||
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
|
||||
select max(7) from t2i join t1i;
|
||||
max(7)
|
||||
@@ -548,6 +548,58 @@ id c counter
|
||||
3 b 2
|
||||
4 a 2
|
||||
drop table t1;
|
||||
CREATE TABLE t1(
|
||||
id int AUTO_INCREMENT PRIMARY KEY,
|
||||
stat_id int NOT NULL,
|
||||
acct_id int DEFAULT NULL,
|
||||
INDEX idx1 (stat_id, acct_id),
|
||||
INDEX idx2 (acct_id)
|
||||
) ENGINE=MyISAM;
|
||||
CREATE TABLE t2(
|
||||
id int AUTO_INCREMENT PRIMARY KEY,
|
||||
stat_id int NOT NULL,
|
||||
acct_id int DEFAULT NULL,
|
||||
INDEX idx1 (stat_id, acct_id),
|
||||
INDEX idx2 (acct_id)
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO t1(stat_id,acct_id) VALUES
|
||||
(1,759), (2,831), (3,785), (4,854), (1,921),
|
||||
(1,553), (2,589), (3,743), (2,827), (2,545),
|
||||
(4,779), (4,783), (1,597), (1,785), (4,832),
|
||||
(1,741), (1,833), (3,788), (2,973), (1,907);
|
||||
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
|
||||
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
|
||||
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
|
||||
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
|
||||
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
|
||||
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
|
||||
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
|
||||
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
|
||||
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
|
||||
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
|
||||
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
|
||||
UPDATE t1 SET acct_id=785
|
||||
WHERE MOD(stat_id,2)=0 AND MOD(id,stat_id)=MOD(acct_id,stat_id);
|
||||
OPTIMIZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
40960
|
||||
SELECT COUNT(*) FROM t1 WHERE acct_id=785;
|
||||
COUNT(*)
|
||||
8702
|
||||
EXPLAIN SELECT COUNT(*) FROM t1 WHERE stat_id IN (1,3) AND acct_id=785;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range idx1,idx2 idx1 9 NULL 2 Using where; Using index
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
OPTIMIZE TABLE t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t2 optimize status OK
|
||||
EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx1,idx2 idx1 9 NULL 2 Using where; Using index
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.0 tests
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
insert into t1 values (1,1),(1,2);
|
||||
@@ -733,4 +785,15 @@ k a c
|
||||
11 15 1
|
||||
12 20 1
|
||||
drop table t2;
|
||||
drop table if exists t1, t2;
|
||||
create table t1 (i int);
|
||||
alter table t1 modify i int default 1;
|
||||
alter table t1 modify i int default 2, rename t2;
|
||||
lock table t2 write;
|
||||
alter table t2 modify i int default 3;
|
||||
unlock tables;
|
||||
lock table t2 write;
|
||||
alter table t2 modify i int default 4, rename t1;
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
@@ -384,3 +384,119 @@ id data
|
||||
8 140
|
||||
9 150
|
||||
drop table t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
DROP FUNCTION IF EXISTS f2;
|
||||
CREATE TABLE t1 (i INT);
|
||||
CREATE FUNCTION f1() RETURNS INT
|
||||
BEGIN
|
||||
INSERT INTO t1 VALUES (1);
|
||||
RETURN 1;
|
||||
END |
|
||||
CREATE FUNCTION f2() RETURNS INT
|
||||
BEGIN
|
||||
INSERT DELAYED INTO t1 VALUES (2);
|
||||
RETURN 1;
|
||||
END |
|
||||
SELECT f1();
|
||||
f1()
|
||||
1
|
||||
SELECT f2();
|
||||
f2()
|
||||
1
|
||||
INSERT INTO t1 VALUES (3);
|
||||
INSERT DELAYED INTO t1 VALUES (4);
|
||||
INSERT INTO t1 VALUES (f1());
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
INSERT DELAYED INTO t1 VALUES (f1());
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
INSERT INTO t1 VALUES (f2());
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
INSERT DELAYED INTO t1 VALUES (f2());
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
INSERT INTO t1 VALUES (NEW.i);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
INSERT DELAYED INTO t1 VALUES (1);
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
DROP FUNCTION f2;
|
||||
DROP FUNCTION f1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
CREATE TABLE t1 (i INT);
|
||||
CREATE TABLE t2 (i INT);
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
INSERT DELAYED INTO t2 VALUES (NEW.i);
|
||||
CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
|
||||
INSERT DELAYED INTO t2 VALUES (NEW.i);
|
||||
CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROW
|
||||
INSERT DELAYED INTO t2 VALUES (OLD.i);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT DELAYED INTO t1 VALUES (2);
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
1
|
||||
2
|
||||
UPDATE t1 SET i = 3 WHERE i = 1;
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
3
|
||||
2
|
||||
DELETE FROM t1 WHERE i = 3;
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
2
|
||||
SELECT * FROM t2;
|
||||
i
|
||||
1
|
||||
2
|
||||
3
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
CREATE TABLE t1 (i INT);
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
SET @a= NEW.i;
|
||||
SET @a= 0;
|
||||
INSERT DELAYED INTO t1 VALUES (1);
|
||||
SELECT @a;
|
||||
@a
|
||||
1
|
||||
INSERT DELAYED INTO t1 VALUES (2);
|
||||
SELECT @a;
|
||||
@a
|
||||
2
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (i INT);
|
||||
CREATE TABLE t2 (i INT);
|
||||
CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
|
||||
INSERT INTO t2 VALUES (NEW.i);
|
||||
CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROW
|
||||
INSERT DELAYED INTO t2 VALUES (NEW.i);
|
||||
CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW
|
||||
INSERT DELAYED INTO t2 VALUES (OLD.i);
|
||||
INSERT DELAYED INTO t1 VALUES (1);
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
1
|
||||
UPDATE t1 SET i = 2 WHERE i = 1;
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
2
|
||||
DELETE FROM t1 WHERE i = 2;
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
SELECT * FROM t2;
|
||||
i
|
||||
1
|
||||
2
|
||||
2
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests.
|
||||
|
@@ -336,3 +336,60 @@ id f1
|
||||
0 test1
|
||||
DROP TABLE t1;
|
||||
SET SQL_MODE='';
|
||||
CREATE TABLE t1 (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
c1 CHAR(1) UNIQUE KEY,
|
||||
cnt INT DEFAULT 1
|
||||
);
|
||||
INSERT INTO t1 (c1) VALUES ('A'), ('B'), ('C');
|
||||
SELECT * FROM t1;
|
||||
id c1 cnt
|
||||
1 A 1
|
||||
2 B 1
|
||||
3 C 1
|
||||
INSERT INTO t1 (c1) VALUES ('A'), ('X'), ('Y'), ('Z')
|
||||
ON DUPLICATE KEY UPDATE cnt=cnt+1;
|
||||
SELECT * FROM t1;
|
||||
id c1 cnt
|
||||
1 A 2
|
||||
2 B 1
|
||||
3 C 1
|
||||
4 X 1
|
||||
5 Y 1
|
||||
6 Z 1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
c1 INT NOT NULL,
|
||||
cnt INT DEFAULT 1
|
||||
);
|
||||
INSERT INTO t1 (id,c1) VALUES (1,10);
|
||||
SELECT * FROM t1;
|
||||
id c1 cnt
|
||||
1 10 1
|
||||
CREATE TABLE t2 (id INT, c1 INT);
|
||||
INSERT INTO t2 VALUES (1,NULL), (2,2);
|
||||
INSERT INTO t1 (id,c1) SELECT 1,NULL
|
||||
ON DUPLICATE KEY UPDATE c1=NULL;
|
||||
ERROR 23000: Column 'c1' cannot be null
|
||||
SELECT * FROM t1;
|
||||
id c1 cnt
|
||||
1 10 1
|
||||
INSERT IGNORE INTO t1 (id,c1) SELECT 1,NULL
|
||||
ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
|
||||
Warnings:
|
||||
Warning 1048 Column 'c1' cannot be null
|
||||
Error 1048 Column 'c1' cannot be null
|
||||
SELECT * FROM t1;
|
||||
id c1 cnt
|
||||
1 0 2
|
||||
INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2
|
||||
ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
|
||||
Warnings:
|
||||
Warning 1048 Column 'c1' cannot be null
|
||||
Error 1048 Column 'c1' cannot be null
|
||||
SELECT * FROM t1;
|
||||
id c1 cnt
|
||||
1 0 3
|
||||
2 2 1
|
||||
DROP TABLE t1;
|
||||
|
@@ -391,6 +391,56 @@ i i i
|
||||
2 NULL 4
|
||||
2 2 2
|
||||
drop table t1,t2,t3;
|
||||
CREATE TABLE t1 (a int, b int default 0, c int default 1);
|
||||
INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8);
|
||||
INSERT INTO t1 (a) SELECT a + 8 FROM t1;
|
||||
INSERT INTO t1 (a) SELECT a + 16 FROM t1;
|
||||
CREATE TABLE t2 (a int, d int, e int default 0);
|
||||
INSERT INTO t2 (a, d) VALUES (1,1),(2,2),(3,3),(4,4);
|
||||
INSERT INTO t2 (a, d) SELECT a+4, a+4 FROM t2;
|
||||
INSERT INTO t2 (a, d) SELECT a+8, a+8 FROM t2;
|
||||
EXPLAIN
|
||||
SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
|
||||
ORDER BY t1.b, t1.c;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 16 Using where
|
||||
SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
|
||||
ORDER BY t1.b, t1.c;
|
||||
e
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
DROP TABLE t1,t2;
|
||||
create table t1 (c int, b int);
|
||||
create table t2 (a int, b int);
|
||||
create table t3 (b int, c int);
|
||||
|
@@ -228,7 +228,7 @@ LEFT JOIN
|
||||
t8
|
||||
ON t7.b=t8.b AND t6.b < 10;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using join cache
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00
|
||||
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00
|
||||
Warnings:
|
||||
@@ -543,7 +543,7 @@ WHERE t0.a=1 AND
|
||||
t0.b=t1.b AND
|
||||
(t2.a >= 4 OR t2.c IS NULL);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
|
||||
@@ -638,7 +638,7 @@ t0.b=t1.b AND
|
||||
(t8.b=t9.b OR t8.c IS NULL) AND
|
||||
(t9.a=1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
@@ -646,7 +646,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join cache
|
||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
|
||||
@@ -835,7 +835,7 @@ t2
|
||||
ON t3.a=1 AND t2.b=t4.b
|
||||
WHERE t1.a <= 2;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00
|
||||
@@ -849,7 +849,7 @@ LEFT JOIN
|
||||
(t1,t2)
|
||||
ON t3.a=1 AND t3.b=t2.b AND t2.b=t4.b;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using join cache
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 2 100.00
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
|
||||
@@ -905,7 +905,7 @@ t0.b=t1.b AND
|
||||
(t8.b=t9.b OR t8.c IS NULL) AND
|
||||
(t9.a=1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
@@ -913,7 +913,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join cache
|
||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
|
||||
@@ -955,7 +955,7 @@ t0.b=t1.b AND
|
||||
(t8.b=t9.b OR t8.c IS NULL) AND
|
||||
(t9.a=1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
@@ -963,7 +963,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join cache
|
||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
|
||||
@@ -1004,7 +1004,7 @@ t0.b=t1.b AND
|
||||
(t8.b=t9.b OR t8.c IS NULL) AND
|
||||
(t9.a=1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
@@ -1012,7 +1012,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where
|
||||
1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where; Using join cache
|
||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
|
||||
@@ -1062,7 +1062,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where
|
||||
1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where; Using join cache
|
||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
|
||||
|
@@ -1214,3 +1214,28 @@ SELECT * FROM t1 LEFT JOIN t2 USING(f1) WHERE f1='Bla';
|
||||
f1 f2 f3
|
||||
bla blah sheep
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (id int PRIMARY KEY, a varchar(8));
|
||||
CREATE TABLE t2 (id int NOT NULL, b int NOT NULL, INDEX idx(id));
|
||||
INSERT INTO t1 VALUES
|
||||
(1,'aaaaaaa'), (5,'eeeeeee'), (4,'ddddddd'), (2,'bbbbbbb'), (3,'ccccccc');
|
||||
INSERT INTO t2 VALUES
|
||||
(3,10), (2,20), (5,30), (3,20), (5,10), (3,40), (3,30), (2,10), (2,40);
|
||||
EXPLAIN
|
||||
SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
|
||||
1 SIMPLE t2 ref idx idx 4 test.t1.id 2 Using where; Not exists
|
||||
flush status;
|
||||
SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
|
||||
id a
|
||||
1 aaaaaaa
|
||||
4 ddddddd
|
||||
show status like 'Handler_read%';
|
||||
Variable_name Value
|
||||
Handler_read_first 0
|
||||
Handler_read_key 5
|
||||
Handler_read_next 0
|
||||
Handler_read_prev 0
|
||||
Handler_read_rnd 0
|
||||
Handler_read_rnd_next 6
|
||||
DROP TABLE t1,t2;
|
||||
|
@@ -35,7 +35,7 @@ D E a a
|
||||
a a a a
|
||||
explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 5
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 5 Using join cache
|
||||
1 SIMPLE t2 ALL b NULL NULL NULL 5 Using where
|
||||
select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a;
|
||||
a b a b
|
||||
|
@@ -174,6 +174,25 @@ f2
|
||||
2
|
||||
SET @@SQL_MODE=@OLD_SQL_MODE;
|
||||
drop table t1,t2;
|
||||
create table t1(f1 int, f2 timestamp not null default current_timestamp);
|
||||
create table t2(f1 int);
|
||||
insert into t2 values(1),(2);
|
||||
Warnings:
|
||||
Warning 1261 Row 1 doesn't contain data for all columns
|
||||
Warning 1261 Row 2 doesn't contain data for all columns
|
||||
select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
|
||||
f1
|
||||
1
|
||||
2
|
||||
delete from t1;
|
||||
Warnings:
|
||||
Warning 1261 Row 1 doesn't contain data for all columns
|
||||
Warning 1261 Row 2 doesn't contain data for all columns
|
||||
select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
|
||||
f1
|
||||
1
|
||||
2
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (a int);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SET NAMES latin1;
|
||||
|
@@ -169,6 +169,8 @@ lock tables mysql.slow_log READ LOCAL, mysql.general_log READ LOCAL;
|
||||
unlock tables;
|
||||
set global general_log='OFF';
|
||||
set global slow_query_log='OFF';
|
||||
set @save_storage_engine= @@session.storage_engine;
|
||||
set storage_engine= MEMORY;
|
||||
alter table mysql.slow_log engine=ndb;
|
||||
ERROR HY000: This storage engine cannot be used for log tables"
|
||||
alter table mysql.slow_log engine=innodb;
|
||||
@@ -177,6 +179,7 @@ alter table mysql.slow_log engine=archive;
|
||||
ERROR HY000: This storage engine cannot be used for log tables"
|
||||
alter table mysql.slow_log engine=blackhole;
|
||||
ERROR HY000: This storage engine cannot be used for log tables"
|
||||
set storage_engine= @save_storage_engine;
|
||||
drop table mysql.slow_log;
|
||||
drop table mysql.general_log;
|
||||
drop table mysql.general_log;
|
||||
|
@@ -345,11 +345,11 @@ t1 1 c_2 1 c A 5 NULL NULL YES BTREE
|
||||
t1 1 c_2 2 a A 5 NULL NULL BTREE
|
||||
explain select * from t1,t2 where t1.a=t2.a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL a NULL NULL NULL 2
|
||||
1 SIMPLE t2 ALL a NULL NULL NULL 2 Using join cache
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where
|
||||
explain select * from t1,t2 force index(a) where t1.a=t2.a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL a NULL NULL NULL 2
|
||||
1 SIMPLE t2 ALL a NULL NULL NULL 2 Using join cache
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where
|
||||
explain select * from t1 force index(a),t2 force index(a) where t1.a=t2.a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -361,7 +361,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref b b 5 test.t2.b 1 Using where
|
||||
explain select * from t1,t2 force index(c) where t1.a=t2.a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 2
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using join cache
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where
|
||||
explain select * from t1 where a=0 or a=2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
|
@@ -382,7 +382,7 @@ create table t1 (a int primary key) engine=ndb;
|
||||
select * from t1;
|
||||
a
|
||||
select * from t1;
|
||||
ERROR HY000: Can't lock file (errno: 4009)
|
||||
ERROR HY000: Can't lock file (errno: 157)
|
||||
use test;
|
||||
drop database test_only_ndb_tables;
|
||||
CREATE TABLE t9 (
|
||||
|
@@ -667,6 +667,12 @@ counter datavalue
|
||||
31 newval
|
||||
32 newval
|
||||
drop table t1;
|
||||
create table t1 (a int primary key auto_increment) engine = ndb;
|
||||
insert into t1() values (),(),(),(),(),(),(),(),(),(),(),();
|
||||
insert into t1(a) values (20),(28);
|
||||
insert into t1() values (),(),(),(),(),(),(),(),(),(),(),();
|
||||
insert into t1() values (21), (22);
|
||||
drop table t1;
|
||||
CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
|
||||
select * from t1;
|
||||
b
|
||||
|
@@ -1730,7 +1730,7 @@ pk1 attr1 attr2 attr3 attr4
|
||||
explain
|
||||
select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where with pushed condition; Using temporary; Using filesort
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where with pushed condition; Using temporary; Using filesort; Using join cache
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where with pushed condition
|
||||
select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
|
||||
pk1 attr1 attr2 attr3 pk1 attr1 attr2 attr3 attr4
|
||||
@@ -1746,7 +1746,7 @@ pk1 attr1 attr2 attr3 attr4
|
||||
explain
|
||||
select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t4 range attr1 attr1 4 NULL # Using where with pushed condition; Using temporary; Using filesort
|
||||
1 SIMPLE t4 range attr1 attr1 4 NULL # Using where with pushed condition; Using temporary; Using filesort; Using join cache
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where
|
||||
select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
|
||||
pk1 attr1 attr2 attr3 attr4 pk1 attr1 attr2 attr3 attr4
|
||||
|
@@ -402,7 +402,7 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Using join cache
|
||||
1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00
|
||||
Warnings:
|
||||
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
|
||||
@@ -952,7 +952,7 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Using join cache
|
||||
1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00
|
||||
Warnings:
|
||||
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
|
||||
|
@@ -649,3 +649,11 @@ pk a
|
||||
6 NULL
|
||||
7 4
|
||||
DROP TABLE t1;
|
||||
create table t1(a int primary key, b int, unique key(b)) engine=ndb;
|
||||
insert ignore into t1 values (1,0), (2,0), (2,null), (3,null);
|
||||
select * from t1 order by a;
|
||||
a b
|
||||
1 0
|
||||
2 NULL
|
||||
3 NULL
|
||||
drop table t1;
|
||||
|
@@ -37,3 +37,29 @@ ROW_FORMAT=DYNAMIC
|
||||
ENGINE=NDB;
|
||||
ForceVarPart: 1
|
||||
DROP TABLE t1;
|
||||
create table t1 (a int auto_increment primary key, b varchar(1000)) engine = ndb;
|
||||
insert into t1(b) values ('0123456789');
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
1024
|
||||
begin;
|
||||
update t1 set b = concat(b,b);
|
||||
update t1 set b = concat(b,b);
|
||||
update t1 set b = concat(b,b);
|
||||
update t1 set b = concat(b,b);
|
||||
update t1 set b = concat(b,b);
|
||||
rollback;
|
||||
select count(*),b from t1 group by b;
|
||||
count(*) b
|
||||
1024 0123456789
|
||||
drop table t1;
|
||||
|
Binary file not shown.
@@ -1225,4 +1225,14 @@ t2 CREATE TABLE `t2` (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
|
||||
DROP TABLE t1, t2;
|
||||
set @@sql_mode=@org_mode;
|
||||
create table t1 (c1 varchar(255),c2 tinyint,primary key(c1))
|
||||
partition by key (c1) partitions 10 ;
|
||||
insert into t1 values ('aaa','1') on duplicate key update c2 = c2 + 1;
|
||||
insert into t1 values ('aaa','1') on duplicate key update c2 = c2 + 1;
|
||||
select * from t1;
|
||||
c1 c2
|
||||
aaa 2
|
||||
drop table t1;
|
||||
create table t1 (s1 bigint) partition by list (s1) (partition p1 values in (-9223372036854775808));
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
@@ -55,6 +55,7 @@ engine = x
|
||||
partition by key (a);
|
||||
Warnings:
|
||||
Warning 1286 Unknown table engine 'x'
|
||||
Warning 1266 Using storage engine MyISAM for table 't1'
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
@@ -26,11 +26,11 @@ ERROR HY000: Unknown prepared statement handler (no_such_statement) given to DEA
|
||||
execute stmt1;
|
||||
ERROR HY000: Incorrect arguments to EXECUTE
|
||||
prepare stmt2 from 'prepare nested_stmt from "select 1"';
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"select 1"' at line 1
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt2 from 'execute stmt1';
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'stmt1' at line 1
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt2 from 'deallocate prepare z';
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'z' at line 1
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt3 from 'insert into t1 values (?,?)';
|
||||
set @arg1=5, @arg2='five';
|
||||
execute stmt3 using @arg1, @arg2;
|
||||
|
@@ -303,10 +303,9 @@ prepare stmt4 from ' show variables like ''sql_mode'' ';
|
||||
execute stmt4;
|
||||
Variable_name Value
|
||||
sql_mode
|
||||
prepare stmt4 from ' show engine bdb logs ';
|
||||
ERROR 42000: Unknown table engine 'bdb'
|
||||
prepare stmt4 from ' show engine foo logs ';
|
||||
ERROR 42000: Unknown table engine 'foo'
|
||||
prepare stmt4 from ' show engine myisam logs ';
|
||||
execute stmt4;
|
||||
Type Name Status
|
||||
prepare stmt4 from ' show grants for user ';
|
||||
prepare stmt4 from ' show create table t2 ';
|
||||
prepare stmt4 from ' show master status ';
|
||||
@@ -374,11 +373,11 @@ drop table t5 ;
|
||||
deallocate prepare stmt_do ;
|
||||
deallocate prepare stmt_set ;
|
||||
prepare stmt1 from ' prepare stmt2 from '' select 1 '' ' ;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' select 1 '' at line 1
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' execute stmt2 ' ;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'stmt2' at line 1
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' deallocate prepare never_prepared ' ;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'never_prepared' at line 1
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt4 from ' use test ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt3 from ' create database mysqltest ';
|
||||
|
@@ -1343,3 +1343,97 @@ c1
|
||||
100
|
||||
drop table t1;
|
||||
set global query_cache_size=0;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2),(3);
|
||||
set GLOBAL query_cache_type=1;
|
||||
set GLOBAL query_cache_limit=10000;
|
||||
set GLOBAL query_cache_min_res_unit=0;
|
||||
set GLOBAL query_cache_size= 100000;
|
||||
reset query cache;
|
||||
set LOCAL default_week_format = 0;
|
||||
select week('2007-01-04');
|
||||
week('2007-01-04')
|
||||
0
|
||||
select week('2007-01-04') from t1;
|
||||
week('2007-01-04')
|
||||
0
|
||||
0
|
||||
0
|
||||
select extract(WEEK FROM '2007-01-04') from t1;
|
||||
extract(WEEK FROM '2007-01-04')
|
||||
0
|
||||
0
|
||||
0
|
||||
set LOCAL default_week_format = 2;
|
||||
select week('2007-01-04');
|
||||
week('2007-01-04')
|
||||
53
|
||||
select week('2007-01-04') from t1;
|
||||
week('2007-01-04')
|
||||
53
|
||||
53
|
||||
53
|
||||
select extract(WEEK FROM '2007-01-04') from t1;
|
||||
extract(WEEK FROM '2007-01-04')
|
||||
53
|
||||
53
|
||||
53
|
||||
reset query cache;
|
||||
set LOCAL div_precision_increment=2;
|
||||
select 1/7;
|
||||
1/7
|
||||
0.14
|
||||
select 1/7 from t1;
|
||||
1/7
|
||||
0.14
|
||||
0.14
|
||||
0.14
|
||||
set LOCAL div_precision_increment=4;
|
||||
select 1/7;
|
||||
1/7
|
||||
0.1429
|
||||
select 1/7 from t1;
|
||||
1/7
|
||||
0.1429
|
||||
0.1429
|
||||
0.1429
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
|
||||
INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
|
||||
('Full-text indexes', 'are called collections'),
|
||||
('Only MyISAM tables','support collections'),
|
||||
('Function MATCH ... AGAINST()','is used to do a search'),
|
||||
('Full-text search in MySQL', 'implements vector space model');
|
||||
set GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
|
||||
select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
|
||||
a b x
|
||||
MySQL has now support for full-text search 0
|
||||
Full-text indexes are called collections 1
|
||||
Only MyISAM tables support collections 0
|
||||
Function MATCH ... AGAINST() is used to do a search 0
|
||||
Full-text search in MySQL implements vector space model 0
|
||||
set GLOBAL ft_boolean_syntax='- +><()~*:""&|';
|
||||
select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
|
||||
a b x
|
||||
MySQL has now support for full-text search 0
|
||||
Full-text indexes are called collections 0
|
||||
Only MyISAM tables support collections 0
|
||||
Function MATCH ... AGAINST() is used to do a search 0
|
||||
Full-text search in MySQL implements vector space model 0
|
||||
create function change_global() returns integer deterministic
|
||||
begin
|
||||
set global ft_boolean_syntax='+ -><()~*:""&|';
|
||||
return 1;
|
||||
end|
|
||||
select *, change_global() from t1;
|
||||
a b change_global()
|
||||
MySQL has now support for full-text search 1
|
||||
Full-text indexes are called collections 1
|
||||
Only MyISAM tables support collections 1
|
||||
Function MATCH ... AGAINST() is used to do a search 1
|
||||
Full-text search in MySQL implements vector space model 1
|
||||
drop function change_global;
|
||||
set GLOBAL query_cache_type=default;
|
||||
set GLOBAL query_cache_limit=default;
|
||||
set GLOBAL query_cache_min_res_unit=default;
|
||||
set GLOBAL query_cache_size= default;
|
||||
|
@@ -220,27 +220,27 @@ insert into t1 (x) values (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
update t1 set y=x;
|
||||
explain select * from t1, t1 t2 where t1.y = 8 and t2.x between 7 and t1.y+0;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
|
||||
1 SIMPLE t2 range x x 5 NULL 2 Using where
|
||||
explain select * from t1, t1 t2 where t1.y = 8 and t2.x >= 7 and t2.x <= t1.y+0;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
|
||||
1 SIMPLE t2 range x x 5 NULL 2 Using where
|
||||
explain select * from t1, t1 t2 where t1.y = 2 and t2.x between t1.y-1 and t1.y+1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
|
||||
1 SIMPLE t2 range x x 5 NULL 3 Using where
|
||||
explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= t1.y-1 and t2.x <= t1.y+1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
|
||||
1 SIMPLE t2 range x x 5 NULL 3 Using where
|
||||
explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
|
||||
1 SIMPLE t2 range x x 5 NULL 2 Using where
|
||||
explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
|
||||
1 SIMPLE t2 range x x 5 NULL 2 Using where
|
||||
explain select count(*) from t1 where x in (1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -255,12 +255,12 @@ CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
|
||||
INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
|
||||
explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using index
|
||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using index; Using join cache
|
||||
1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index
|
||||
explain select * from t1 force index(i1), t2 force index(j1) where
|
||||
(t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using index
|
||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using index; Using join cache
|
||||
1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
|
@@ -376,7 +376,7 @@ a b a b c
|
||||
3 2 3 1 3
|
||||
EXPLAIN EXTENDED SELECT * FROM t1,t2 WHERE (t1.a-1,t1.b)=(t2.a-1,t2.b+1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 index NULL PRIMARY 8 NULL 6 100.00 Using index
|
||||
1 SIMPLE t1 index NULL PRIMARY 8 NULL 6 100.00 Using index; Using join cache
|
||||
1 SIMPLE t2 index NULL PRIMARY 12 NULL 7 100.00 Using where; Using index
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where (((`test`.`t1`.`a` - 1) = (`test`.`t2`.`a` - 1)) and (`test`.`t1`.`b` = (`test`.`t2`.`b` + 1)))
|
||||
|
@@ -607,11 +607,11 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 ref period period 4 test.t1.period 4181
|
||||
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 index period period 4 NULL 41810
|
||||
1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using filesort
|
||||
1 SIMPLE t1 ref period period 4 test.t3.period 4181
|
||||
explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index period period 4 NULL 41810
|
||||
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
|
||||
1 SIMPLE t3 ref period period 4 test.t1.period 4181
|
||||
select period from t1;
|
||||
period
|
||||
@@ -1430,7 +1430,7 @@ companynr companynr
|
||||
41 40
|
||||
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
|
||||
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
|
||||
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
|
||||
fld1 companynr fld3 period
|
||||
@@ -2362,7 +2362,7 @@ insert into t1 values (1,2), (2,2), (3,2), (4,2);
|
||||
insert into t2 values (1,3), (2,3), (3,4), (4,4);
|
||||
explain select * from t1 left join t2 on a=c where d in (4);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref c,d d 5 const 2 Using where
|
||||
1 SIMPLE t2 ref c,d d 5 const 2 Using where; Using join cache
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where
|
||||
select * from t1 left join t2 on a=c where d in (4);
|
||||
a b c d
|
||||
@@ -2370,7 +2370,7 @@ a b c d
|
||||
4 2 4 4
|
||||
explain select * from t1 left join t2 on a=c where d = 4;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref c,d d 5 const 2 Using where
|
||||
1 SIMPLE t2 ref c,d d 5 const 2 Using where; Using join cache
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where
|
||||
select * from t1 left join t2 on a=c where d = 4;
|
||||
a b c d
|
||||
@@ -2716,7 +2716,7 @@ explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2
|
||||
where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and
|
||||
t2.b like '%%' order by t2.b limit 0,1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref b,c b 5 const 1 Using where; Using temporary; Using filesort
|
||||
1 SIMPLE t1 ref b,c b 5 const 1 Using where; Using temporary; Using filesort; Using join cache
|
||||
1 SIMPLE t3 index PRIMARY,a,b PRIMARY 8 NULL 2 Using index
|
||||
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 2 Range checked for each record (index map: 0x1)
|
||||
DROP TABLE t1,t2,t3;
|
||||
@@ -2737,7 +2737,7 @@ INSERT INTO t2 VALUES (1,NULL), (2,10);
|
||||
ALTER TABLE t1 ENABLE KEYS;
|
||||
EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index b b 5 NULL 2 Using index
|
||||
1 SIMPLE t2 index b b 5 NULL 2 Using index; Using join cache
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
|
||||
SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
|
||||
a b a b
|
||||
@@ -2747,7 +2747,7 @@ a b a b
|
||||
2 10 4 10
|
||||
EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index b b 5 NULL 2 Using index
|
||||
1 SIMPLE t2 index b b 5 NULL 2 Using index; Using join cache
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
|
||||
SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
|
||||
a b a b
|
||||
@@ -2901,11 +2901,11 @@ a
|
||||
4
|
||||
EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
|
||||
EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using join cache
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
|
||||
DROP TABLE t1,t2;
|
||||
select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
|
||||
|
@@ -620,6 +620,119 @@ SHOW PROCEDURE CODE p1;
|
||||
Pos Instruction
|
||||
0 stmt 2 "CREATE INDEX idx ON t1 (c1)"
|
||||
DROP PROCEDURE p1;
|
||||
drop table if exists t1;
|
||||
drop procedure if exists proc_26977_broken;
|
||||
drop procedure if exists proc_26977_works;
|
||||
create table t1(a int unique);
|
||||
create procedure proc_26977_broken(v int)
|
||||
begin
|
||||
declare i int default 5;
|
||||
declare continue handler for sqlexception
|
||||
begin
|
||||
select 'caught something';
|
||||
retry:
|
||||
while i > 0 do
|
||||
begin
|
||||
set i = i - 1;
|
||||
select 'looping', i;
|
||||
end;
|
||||
end while retry;
|
||||
end;
|
||||
select 'do something';
|
||||
insert into t1 values (v);
|
||||
select 'do something again';
|
||||
insert into t1 values (v);
|
||||
end//
|
||||
create procedure proc_26977_works(v int)
|
||||
begin
|
||||
declare i int default 5;
|
||||
declare continue handler for sqlexception
|
||||
begin
|
||||
select 'caught something';
|
||||
retry:
|
||||
while i > 0 do
|
||||
begin
|
||||
set i = i - 1;
|
||||
select 'looping', i;
|
||||
end;
|
||||
end while retry;
|
||||
select 'optimizer: keep hreturn';
|
||||
end;
|
||||
select 'do something';
|
||||
insert into t1 values (v);
|
||||
select 'do something again';
|
||||
insert into t1 values (v);
|
||||
end//
|
||||
show procedure code proc_26977_broken;
|
||||
Pos Instruction
|
||||
0 set i@1 5
|
||||
1 hpush_jump 8 2 CONTINUE
|
||||
2 stmt 0 "select 'caught something'"
|
||||
3 jump_if_not 7(7) (i@1 > 0)
|
||||
4 set i@1 (i@1 - 1)
|
||||
5 stmt 0 "select 'looping', i"
|
||||
6 jump 3
|
||||
7 hreturn 2
|
||||
8 stmt 0 "select 'do something'"
|
||||
9 stmt 5 "insert into t1 values (v)"
|
||||
10 stmt 0 "select 'do something again'"
|
||||
11 stmt 5 "insert into t1 values (v)"
|
||||
12 hpop 1
|
||||
show procedure code proc_26977_works;
|
||||
Pos Instruction
|
||||
0 set i@1 5
|
||||
1 hpush_jump 9 2 CONTINUE
|
||||
2 stmt 0 "select 'caught something'"
|
||||
3 jump_if_not 7(7) (i@1 > 0)
|
||||
4 set i@1 (i@1 - 1)
|
||||
5 stmt 0 "select 'looping', i"
|
||||
6 jump 3
|
||||
7 stmt 0 "select 'optimizer: keep hreturn'"
|
||||
8 hreturn 2
|
||||
9 stmt 0 "select 'do something'"
|
||||
10 stmt 5 "insert into t1 values (v)"
|
||||
11 stmt 0 "select 'do something again'"
|
||||
12 stmt 5 "insert into t1 values (v)"
|
||||
13 hpop 1
|
||||
call proc_26977_broken(1);
|
||||
do something
|
||||
do something
|
||||
do something again
|
||||
do something again
|
||||
caught something
|
||||
caught something
|
||||
looping i
|
||||
looping 4
|
||||
looping i
|
||||
looping 3
|
||||
looping i
|
||||
looping 2
|
||||
looping i
|
||||
looping 1
|
||||
looping i
|
||||
looping 0
|
||||
call proc_26977_works(2);
|
||||
do something
|
||||
do something
|
||||
do something again
|
||||
do something again
|
||||
caught something
|
||||
caught something
|
||||
looping i
|
||||
looping 4
|
||||
looping i
|
||||
looping 3
|
||||
looping i
|
||||
looping 2
|
||||
looping i
|
||||
looping 1
|
||||
looping i
|
||||
looping 0
|
||||
optimizer: keep hreturn
|
||||
optimizer: keep hreturn
|
||||
drop table t1;
|
||||
drop procedure proc_26977_broken;
|
||||
drop procedure proc_26977_works;
|
||||
End of 5.0 tests.
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
|
@@ -690,12 +690,12 @@ END|
|
||||
CALL p1(NOW());
|
||||
Table Create Table
|
||||
t1 CREATE TABLE "t1" (
|
||||
"x" varbinary(19) DEFAULT NULL
|
||||
"x" datetime DEFAULT NULL
|
||||
)
|
||||
CALL p1('test');
|
||||
Table Create Table
|
||||
t1 CREATE TABLE "t1" (
|
||||
"x" varbinary(19) DEFAULT NULL
|
||||
"x" datetime DEFAULT NULL
|
||||
)
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'x' at row 1
|
||||
|
@@ -6210,6 +6210,13 @@ Warning 1265 Data truncated for column 'bug5274_f1' at row 1
|
||||
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
|
||||
DROP FUNCTION bug5274_f1|
|
||||
DROP FUNCTION bug5274_f2|
|
||||
drop procedure if exists proc_21513|
|
||||
create procedure proc_21513()`my_label`:BEGIN END|
|
||||
show create procedure proc_21513|
|
||||
Procedure sql_mode Create Procedure
|
||||
proc_21513 CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_21513`()
|
||||
`my_label`:BEGIN END
|
||||
drop procedure proc_21513|
|
||||
End of 5.0 tests.
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
|
||||
|
@@ -608,11 +608,11 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 ref period period 4 test.t1.period 4181
|
||||
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 index period period 4 NULL 41810
|
||||
1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using filesort
|
||||
1 SIMPLE t1 ref period period 4 test.t3.period 4181
|
||||
explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index period period 4 NULL 41810
|
||||
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
|
||||
1 SIMPLE t3 ref period period 4 test.t1.period 4181
|
||||
select period from t1;
|
||||
period
|
||||
@@ -1431,7 +1431,7 @@ companynr companynr
|
||||
41 40
|
||||
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
|
||||
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
|
||||
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
|
||||
fld1 companynr fld3 period
|
||||
|
@@ -611,11 +611,11 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 ref period period 4 test.t1.period 4181
|
||||
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 index period period 4 NULL 41810
|
||||
1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using filesort
|
||||
1 SIMPLE t1 ref period period 4 test.t3.period 4181
|
||||
explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index period period 4 NULL 41810
|
||||
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
|
||||
1 SIMPLE t3 ref period period 4 test.t1.period 4181
|
||||
select period from t1;
|
||||
period
|
||||
@@ -1434,7 +1434,7 @@ companynr companynr
|
||||
41 40
|
||||
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
|
||||
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary; Using join cache
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
|
||||
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
|
||||
fld1 companynr fld3 period
|
||||
|
@@ -904,7 +904,7 @@ a t1.a in (select t2.a from t2,t3 where t3.a=t2.a)
|
||||
explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index
|
||||
2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index; Using join cache
|
||||
2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,<in_optimizer>(`test`.`t1`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`) or isnull(`test`.`t2`.`a`))) having <is_not_null_test>(`test`.`t2`.`a`))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1`
|
||||
@@ -1354,7 +1354,7 @@ a
|
||||
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 100.00 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 100.00 Using where; Using index; Using join cache
|
||||
2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 100.00 Using where; Using index
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
|
||||
@@ -4034,6 +4034,13 @@ SUM( (SELECT AVG( (SELECT COUNT(*) FROM t1 t HAVING XXA < 12) ) FROM t2) )
|
||||
FROM t1;
|
||||
ERROR HY000: Invalid use of group function
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a int, b int, KEY (a));
|
||||
INSERT INTO t1 VALUES (1,1),(2,1);
|
||||
EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ref a a 5 const 1 Using where; Using index
|
||||
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests.
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
|
||||
|
@@ -254,7 +254,7 @@ select a,b, oref,
|
||||
from t2;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
|
||||
2 DEPENDENT SUBQUERY t1 ref_or_null a a 5 func 2 100.00 Using where; Full scan on NULL key
|
||||
2 DEPENDENT SUBQUERY t1 ref_or_null a a 5 func 2 100.00 Using where; Full scan on NULL key; Using join cache
|
||||
2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 100 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1
|
||||
@@ -711,3 +711,34 @@ a
|
||||
1
|
||||
4
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (id int);
|
||||
CREATE TABLE t2 (id int PRIMARY KEY);
|
||||
CREATE TABLE t3 (id int PRIMARY KEY, name varchar(10));
|
||||
INSERT INTO t1 VALUES (2), (NULL), (3), (1);
|
||||
INSERT INTO t2 VALUES (234), (345), (457);
|
||||
INSERT INTO t3 VALUES (222,'bbb'), (333,'ccc'), (111,'aaa');
|
||||
EXPLAIN
|
||||
SELECT * FROM t1
|
||||
WHERE t1.id NOT IN (SELECT t2.id FROM t2,t3
|
||||
WHERE t3.name='xxx' AND t2.id=t3.id);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
2 DEPENDENT SUBQUERY t2 eq_ref PRIMARY PRIMARY 4 func 1 Using where; Using index; Full scan on NULL key
|
||||
2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 func 1 Using where; Full scan on NULL key
|
||||
SELECT * FROM t1
|
||||
WHERE t1.id NOT IN (SELECT t2.id FROM t2,t3
|
||||
WHERE t3.name='xxx' AND t2.id=t3.id);
|
||||
id
|
||||
2
|
||||
NULL
|
||||
3
|
||||
1
|
||||
SELECT (t1.id IN (SELECT t2.id FROM t2,t3
|
||||
WHERE t3.name='xxx' AND t2.id=t3.id)) AS x
|
||||
FROM t1;
|
||||
x
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
@@ -1414,4 +1414,39 @@ id val
|
||||
DROP TRIGGER trg27006_a_insert;
|
||||
DROP TRIGGER trg27006_a_update;
|
||||
drop table t1,t2;
|
||||
drop table if exists t1, t2, t3;
|
||||
create table t1 (i int);
|
||||
create trigger t1_bi before insert on t1 for each row set new.i = 7;
|
||||
create trigger t1_ai after insert on t1 for each row set @a := 7;
|
||||
create table t2 (j int);
|
||||
insert into t2 values (1), (2);
|
||||
set @a:="";
|
||||
create table if not exists t1 select * from t2;
|
||||
Warnings:
|
||||
Note 1050 Table 't1' already exists
|
||||
select * from t1;
|
||||
i
|
||||
7
|
||||
7
|
||||
select @a;
|
||||
@a
|
||||
7
|
||||
drop trigger t1_bi;
|
||||
drop trigger t1_ai;
|
||||
create table t3 (isave int);
|
||||
create trigger t1_bi before insert on t1 for each row insert into t3 values (new.i);
|
||||
create table if not exists t1 select * from t2;
|
||||
Warnings:
|
||||
Note 1050 Table 't1' already exists
|
||||
select * from t1;
|
||||
i
|
||||
7
|
||||
7
|
||||
1
|
||||
2
|
||||
select * from t3;
|
||||
isave
|
||||
1
|
||||
2
|
||||
drop table t1, t2, t3;
|
||||
End of 5.0 tests
|
||||
|
@@ -299,6 +299,88 @@ f2
|
||||
SELECT 1 from dual where NOW() BETWEEN CURRENT_DATE() - INTERVAL 1 DAY AND CURRENT_DATE();
|
||||
1
|
||||
drop table t1;
|
||||
create table t1 (f1 date);
|
||||
insert into t1 values('01-01-01'),('01-01-02'),('01-01-03');
|
||||
select * from t1 where f1 in ('01-01-01','2001-01-02','2001-01-03 00:00:00');
|
||||
f1
|
||||
2001-01-01
|
||||
2001-01-02
|
||||
2001-01-03
|
||||
create table t2(f2 datetime);
|
||||
insert into t2 values('01-01-01 00:00:00'),('01-02-03 12:34:56'),('02-04-06 11:22:33');
|
||||
select * from t2 where f2 in ('01-01-01','01-02-03 12:34:56','01-02-03');
|
||||
f2
|
||||
2001-01-01 00:00:00
|
||||
2001-02-03 12:34:56
|
||||
select * from t1,t2 where '01-01-02' in (f1, cast(f2 as date));
|
||||
f1 f2
|
||||
2001-01-02 2001-01-01 00:00:00
|
||||
2001-01-02 2001-02-03 12:34:56
|
||||
2001-01-02 2002-04-06 11:22:33
|
||||
select * from t1,t2 where '01-01-01' in (f1, '01-02-03');
|
||||
f1 f2
|
||||
2001-01-01 2001-01-01 00:00:00
|
||||
2001-01-01 2001-02-03 12:34:56
|
||||
2001-01-01 2002-04-06 11:22:33
|
||||
select * from t1,t2 where if(1,'01-02-03 12:34:56','') in (f1, f2);
|
||||
f1 f2
|
||||
2001-01-01 2001-02-03 12:34:56
|
||||
2001-01-02 2001-02-03 12:34:56
|
||||
2001-01-03 2001-02-03 12:34:56
|
||||
create table t3(f3 varchar(20));
|
||||
insert into t3 select * from t2;
|
||||
select * from t2,t3 where f2 in (f3,'03-04-05');
|
||||
f2 f3
|
||||
2001-01-01 00:00:00 2001-01-01 00:00:00
|
||||
2001-02-03 12:34:56 2001-02-03 12:34:56
|
||||
2002-04-06 11:22:33 2002-04-06 11:22:33
|
||||
select f1,f2,f3 from t1,t2,t3 where (f1,'1') in ((f2,'1'),(f3,'1'));
|
||||
f1 f2 f3
|
||||
2001-01-01 2001-01-01 00:00:00 2001-01-01 00:00:00
|
||||
2001-01-01 2001-02-03 12:34:56 2001-01-01 00:00:00
|
||||
2001-01-01 2002-04-06 11:22:33 2001-01-01 00:00:00
|
||||
2001-01-01 2001-01-01 00:00:00 2001-02-03 12:34:56
|
||||
2001-01-01 2001-01-01 00:00:00 2002-04-06 11:22:33
|
||||
select f1 from t1 where ('1',f1) in (('1','01-01-01'),('1','2001-1-1 0:0:0'),('1','02-02-02'));
|
||||
f1
|
||||
2001-01-01
|
||||
drop table t1,t2,t3;
|
||||
select least(cast('01-01-01' as date), '01-01-02');
|
||||
least(cast('01-01-01' as date), '01-01-02')
|
||||
2001-01-01
|
||||
select greatest(cast('01-01-01' as date), '01-01-02');
|
||||
greatest(cast('01-01-01' as date), '01-01-02')
|
||||
01-01-02
|
||||
select least(cast('01-01-01' as date), '01-01-02') + 0;
|
||||
least(cast('01-01-01' as date), '01-01-02') + 0
|
||||
20010101
|
||||
select greatest(cast('01-01-01' as date), '01-01-02') + 0;
|
||||
greatest(cast('01-01-01' as date), '01-01-02') + 0
|
||||
20010102
|
||||
select least(cast('01-01-01' as datetime), '01-01-02') + 0;
|
||||
least(cast('01-01-01' as datetime), '01-01-02') + 0
|
||||
20010101000000
|
||||
select cast(least(cast('01-01-01' as datetime), '01-01-02') as signed);
|
||||
cast(least(cast('01-01-01' as datetime), '01-01-02') as signed)
|
||||
20010101000000
|
||||
select cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal(16,2));
|
||||
cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal(16,2))
|
||||
20010101000000.00
|
||||
DROP PROCEDURE IF EXISTS test27759 ;
|
||||
CREATE PROCEDURE test27759()
|
||||
BEGIN
|
||||
declare v_a date default '2007-4-10';
|
||||
declare v_b date default '2007-4-11';
|
||||
declare v_c datetime default '2004-4-9 0:0:0';
|
||||
select v_a as a,v_b as b,
|
||||
least( v_a, v_b ) as a_then_b,
|
||||
least( v_b, v_a ) as b_then_a,
|
||||
least( v_c, v_a ) as c_then_a;
|
||||
END;|
|
||||
call test27759();
|
||||
a b a_then_b b_then_a c_then_a
|
||||
2007-04-10 2007-04-11 2007-04-10 2007-04-10 2004-04-09 00:00:00
|
||||
drop procedure test27759;
|
||||
set @org_mode=@@sql_mode;
|
||||
create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03');
|
||||
Warnings:
|
||||
|
@@ -1440,6 +1440,41 @@ select * from t1;
|
||||
a
|
||||
123456789012345678
|
||||
drop table t1;
|
||||
select cast(11.1234 as DECIMAL(3,2));
|
||||
cast(11.1234 as DECIMAL(3,2))
|
||||
9.99
|
||||
Warnings:
|
||||
Error 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
|
||||
select * from (select cast(11.1234 as DECIMAL(3,2))) t;
|
||||
cast(11.1234 as DECIMAL(3,2))
|
||||
9.99
|
||||
Warnings:
|
||||
Error 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
|
||||
select cast(a as DECIMAL(3,2))
|
||||
from (select 11.1233 as a
|
||||
UNION select 11.1234
|
||||
UNION select 12.1234
|
||||
) t;
|
||||
cast(a as DECIMAL(3,2))
|
||||
9.99
|
||||
9.99
|
||||
9.99
|
||||
Warnings:
|
||||
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
|
||||
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
|
||||
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
|
||||
select cast(a as DECIMAL(3,2)), count(*)
|
||||
from (select 11.1233 as a
|
||||
UNION select 11.1234
|
||||
UNION select 12.1234
|
||||
) t group by 1;
|
||||
cast(a as DECIMAL(3,2)) count(*)
|
||||
9.99 3
|
||||
Warnings:
|
||||
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
|
||||
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
|
||||
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
|
||||
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
|
||||
End of 5.0 tests
|
||||
select cast(143.481 as decimal(4,1));
|
||||
cast(143.481 as decimal(4,1))
|
||||
|
@@ -499,7 +499,7 @@ a b
|
||||
explain (select * from t1 where a=1 and b=10) union (select straight_join t1.a,t2.a from t1,t2 where t1.a=t2.a);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
2 UNION t1 index PRIMARY PRIMARY 4 NULL 4 Using index
|
||||
2 UNION t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using join cache
|
||||
2 UNION t2 index PRIMARY PRIMARY 4 NULL 4 Using where; Using index
|
||||
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
|
||||
explain (select * from t1 where a=1) union (select * from t1 where b=1);
|
||||
|
@@ -235,7 +235,7 @@ net_buffer_length 1024
|
||||
net_read_timeout 300
|
||||
net_retry_count 10
|
||||
net_write_timeout 200
|
||||
select * from information_schema.global_variables where variable_name like 'net_%';
|
||||
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
NET_BUFFER_LENGTH 1024
|
||||
NET_READ_TIMEOUT 300
|
||||
@@ -247,7 +247,7 @@ net_buffer_length 2048
|
||||
net_read_timeout 600
|
||||
net_retry_count 10
|
||||
net_write_timeout 500
|
||||
select * from information_schema.session_variables where variable_name like 'net_%';
|
||||
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
NET_BUFFER_LENGTH 2048
|
||||
NET_READ_TIMEOUT 600
|
||||
@@ -260,7 +260,7 @@ net_buffer_length 1024
|
||||
net_read_timeout 900
|
||||
net_retry_count 10
|
||||
net_write_timeout 1000
|
||||
select * from information_schema.global_variables where variable_name like 'net_%';
|
||||
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
NET_BUFFER_LENGTH 1024
|
||||
NET_READ_TIMEOUT 900
|
||||
@@ -272,7 +272,7 @@ net_buffer_length 7168
|
||||
net_read_timeout 600
|
||||
net_retry_count 10
|
||||
net_write_timeout 500
|
||||
select * from information_schema.session_variables where variable_name like 'net_%';
|
||||
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
NET_BUFFER_LENGTH 7168
|
||||
NET_READ_TIMEOUT 600
|
||||
@@ -313,7 +313,7 @@ query_prealloc_size 8192
|
||||
range_alloc_block_size 2048
|
||||
transaction_alloc_block_size 8192
|
||||
transaction_prealloc_size 4096
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%';
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
QUERY_ALLOC_BLOCK_SIZE 8192
|
||||
QUERY_PREALLOC_SIZE 8192
|
||||
@@ -335,7 +335,7 @@ query_prealloc_size 18432
|
||||
range_alloc_block_size 16384
|
||||
transaction_alloc_block_size 19456
|
||||
transaction_prealloc_size 20480
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%';
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
QUERY_ALLOC_BLOCK_SIZE 17408
|
||||
QUERY_PREALLOC_SIZE 18432
|
||||
@@ -352,7 +352,7 @@ query_prealloc_size 8192
|
||||
range_alloc_block_size 2048
|
||||
transaction_alloc_block_size 8192
|
||||
transaction_prealloc_size 4096
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%';
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
QUERY_ALLOC_BLOCK_SIZE 8192
|
||||
QUERY_PREALLOC_SIZE 8192
|
||||
@@ -911,7 +911,7 @@ ssl_capath #
|
||||
ssl_cert #
|
||||
ssl_cipher #
|
||||
ssl_key #
|
||||
select * from information_schema.session_variables where variable_name like 'ssl%';
|
||||
select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
SSL_CA #
|
||||
SSL_CAPATH #
|
||||
|
@@ -2317,7 +2317,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref a a 10 const,test.t1.b 2 Using where; Using index
|
||||
EXPLAIN SELECT * FROM v2 WHERE a=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref a a 5 const 1 Using where; Using index
|
||||
1 SIMPLE t1 ref a a 5 const 1 Using where; Using index; Using join cache
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where
|
||||
DROP VIEW v1,v2;
|
||||
DROP TABLE t1,t2,t3;
|
||||
@@ -3346,6 +3346,19 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL Using filesort
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
CREATE VIEW v1 AS SELECT CAST( 1.23456789 AS DECIMAL( 7,5 ) ) AS col;
|
||||
SELECT * FROM v1;
|
||||
col
|
||||
1.23457
|
||||
DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
col decimal(7,5) NO 0.00000
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS SELECT CAST(1.23456789 AS DECIMAL(8,0)) AS col;
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(1.23456789 as decimal(8,0)) AS `col`
|
||||
DROP VIEW v1;
|
||||
End of 5.0 tests.
|
||||
DROP DATABASE IF EXISTS `d-1`;
|
||||
CREATE DATABASE `d-1`;
|
||||
|
Reference in New Issue
Block a user