diff options
author | monty@mashka.mysql.fi <> | 2002-11-21 15:56:48 +0200 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2002-11-21 15:56:48 +0200 |
commit | dac6498f9b5b28d94473baf46c6e6f174943728d (patch) | |
tree | d3df5d3fc1abf364dcbcc8eb2305a1cf62540192 /mysql-test/r/merge.result | |
parent | 305d16a7cb3955c20ab5d119b3eb0968008683b6 (diff) | |
parent | e60050c4dd652c7a431aebeb95b7dd944be87bf8 (diff) | |
download | mariadb-git-dac6498f9b5b28d94473baf46c6e6f174943728d.tar.gz |
Merge with 4.0
Diffstat (limited to 'mysql-test/r/merge.result')
-rw-r--r-- | mysql-test/r/merge.result | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 27ce8e1d915..45b5bd9ddb7 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -35,10 +35,10 @@ insert into t1 select NULL,message from t2; create table t3 (a int not null, b char(20), key(a)) type=MERGE UNION=(test.t1,test.t2); explain select * from t3 where a < 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 range a a 4 NULL 10 where used +1 SIMPLE t3 range a a 4 NULL 10 Using where explain select * from t3 where a > 10 and a < 20; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 range a a 4 NULL 10 where used +1 SIMPLE t3 range a a 4 NULL 10 Using where select * from t3 where a = 10; a b 10 Testing @@ -541,3 +541,58 @@ select max(b) from t1 where a = 2; max(b) 1 drop table if exists t,t1,t2; +drop table if exists t1, t2, t3, t4, t5, t6; +create table t1 (a int not null); +create table t2 (a int not null); +insert into t1 values (1); +insert into t2 values (2); +create temporary table t3 (a int not null) TYPE=MERGE UNION=(t1,t2); +select * from t3; +a +1 +2 +create temporary table t4 (a int not null); +create temporary table t5 (a int not null); +insert into t4 values (1); +insert into t5 values (2); +create temporary table t6 (a int not null) TYPE=MERGE UNION=(t4,t5); +select * from t6; +a +1 +2 +drop table if exists t1, t2, t3, t4, t5, t6; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( +fileset_id tinyint(3) unsigned NOT NULL default '0', +file_code varchar(32) NOT NULL default '', +fileset_root_id tinyint(3) unsigned NOT NULL default '0', +PRIMARY KEY (fileset_id,file_code), +KEY files (fileset_id,fileset_root_id) +) TYPE=MyISAM; +INSERT INTO t1 VALUES (2, '0000000111', 1), (2, '0000000112', 1), (2, '0000000113', 1), +(2, '0000000114', 1), (2, '0000000115', 1), (2, '0000000116', 1), (2, '0000000117', 1), +(2, '0000000118', 1), (2, '0000000119', 1), (2, '0000000120', 1); +CREATE TABLE t2 ( +fileset_id tinyint(3) unsigned NOT NULL default '0', +file_code varchar(32) NOT NULL default '', +fileset_root_id tinyint(3) unsigned NOT NULL default '0', +PRIMARY KEY (fileset_id,file_code), +KEY files (fileset_id,fileset_root_id) +) TYPE=MRG_MyISAM UNION=(t1); +EXPLAIN SELECT * FROM t2 IGNORE INDEX (files) WHERE fileset_id = 2 +AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1; +table type possible_keys key key_len ref rows Extra +t2 range PRIMARY PRIMARY 33 NULL 5 Using where +EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2 +AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1; +table type possible_keys key key_len ref rows Extra +t2 range PRIMARY,files PRIMARY 33 NULL 5 Using where +EXPLAIN SELECT * FROM t1 WHERE fileset_id = 2 +AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1; +table type possible_keys key key_len ref rows Extra +t1 range PRIMARY,files PRIMARY 33 NULL 5 Using where +EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2 +AND file_code = '0000000115' LIMIT 1; +table type possible_keys key key_len ref rows Extra +t2 const PRIMARY,files PRIMARY 33 const,const 1 +DROP TABLE IF EXISTS t1, t2; |