mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
After merge fixes
Added THD to add_to_xxx_list() functions for faster parsing.
This commit is contained in:
@ -199,29 +199,29 @@ select distinct 1 from t1,t3 where t1.a=t3.a;
|
||||
1
|
||||
1
|
||||
explain SELECT distinct t1.a from t1;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 index NULL PRIMARY 4 NULL 2 Using index
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
|
||||
explain SELECT distinct t1.a from t1 order by a desc;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 index NULL PRIMARY 4 NULL 2 Using index
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
|
||||
explain SELECT t1.a from t1 group by a order by a desc;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 index NULL PRIMARY 4 NULL 2 Using index
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
|
||||
explain SELECT distinct t1.a from t1 order by a desc limit 1;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 index NULL PRIMARY 4 NULL 2 Using index
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
|
||||
explain SELECT distinct a from t3 order by a desc limit 2;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t3 index NULL a 5 NULL 204 Using index
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 index NULL a 5 NULL 204 Using index
|
||||
explain SELECT distinct a,b from t3 order by a+1;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort
|
||||
explain SELECT distinct a,b from t3 order by a limit 10;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t3 index NULL a 5 NULL 204 Using temporary
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 index NULL a 5 NULL 204 Using temporary
|
||||
explain SELECT a,b from t3 group by a,b order by a+1;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort
|
||||
drop table t1,t2,t3,t4;
|
||||
CREATE TABLE t1 (name varchar(255));
|
||||
INSERT INTO t1 VALUES ('aa'),('ab'),('ac'),('ad'),('ae');
|
||||
|
@ -182,13 +182,13 @@ insert into t1 values(1,1,NULL);
|
||||
insert into t2 values(1,10,NULL),(2,20,NULL);
|
||||
set timestamp=1038000000;
|
||||
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
|
||||
select * from t1;
|
||||
n d t
|
||||
1 10 20021123002000
|
||||
select * from t2;
|
||||
n d t
|
||||
1 10 20021127154957
|
||||
2 20 20021127154957
|
||||
select n,d,unix_timestamp(t) from t1;
|
||||
n d unix_timestamp(t)
|
||||
1 10 1038000000
|
||||
select n,d,unix_timestamp(t) from t2;
|
||||
n d unix_timestamp(t)
|
||||
1 10 1038401397
|
||||
2 20 1038401397
|
||||
UPDATE t1,t2 SET 1=2 WHERE t1.n=t2.n;
|
||||
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 '1=2 WHERE t1.n=t2.n' at line 1
|
||||
drop table t1,t2;
|
||||
|
@ -183,8 +183,8 @@ insert into t1 values(1,1,NULL);
|
||||
insert into t2 values(1,10,NULL),(2,20,NULL);
|
||||
set timestamp=1038000000;
|
||||
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
select n,d,unix_timestamp(t) from t1;
|
||||
select n,d,unix_timestamp(t) from t2;
|
||||
--error 1064
|
||||
UPDATE t1,t2 SET 1=2 WHERE t1.n=t2.n;
|
||||
drop table t1,t2;
|
||||
|
Reference in New Issue
Block a user