mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
36b6bf2ef3
into mysql.com:/home/my/mysql-5.0 BitKeeper/etc/ignore: auto-union BitKeeper/deleted/.del-ctype_cp932.test: Auto merged BitKeeper/deleted/.del-isam.test~834fb0ee8196c445: Auto merged include/thr_lock.h: Auto merged mysql-test/t/alias.test: Auto merged mysql-test/t/alter_table.test: Auto merged mysql-test/t/archive.test: Auto merged mysql-test/t/backup.test: Auto merged mysql-test/t/bool.test: Auto merged mysql-test/t/connect.test: Auto merged mysql-test/t/count_distinct2.test: Auto merged mysql-test/t/create.test: Auto merged mysql-test/t/ctype_many.test: Auto merged mysql-test/t/ctype_ucs_binlog.test: Auto merged mysql-test/t/date_formats.test: Auto merged mysql-test/t/delayed.test: Auto merged mysql-test/t/derived.test: Auto merged mysql-test/t/distinct.test: Auto merged mysql-test/t/drop.test: Auto merged mysql-test/t/endspace.test: Auto merged mysql-test/t/flush.test: Auto merged mysql-test/t/fulltext.test: Auto merged mysql-test/t/fulltext_order_by.test: Auto merged mysql-test/t/func_compress.test: Auto merged mysql-test/t/func_concat.test: Auto merged mysql-test/t/func_date_add.test: Auto merged mysql-test/t/func_equal.test: Auto merged mysql-test/t/func_if.test: Auto merged mysql-test/t/func_sapdb.test: Auto merged mysql-test/t/func_set.test: Auto merged mysql-test/t/func_str.test: Auto merged mysql-test/t/gis-rtree.test: Auto merged mysql-test/t/gis.test: Auto merged mysql-test/t/grant.test: Auto merged mysql-test/t/grant2.test: Auto merged mysql-test/t/grant_cache.test: Auto merged mysql-test/t/heap.test: Auto merged mysql-test/t/heap_btree.test: Auto merged mysql-test/t/heap_hash.test: Auto merged mysql-test/t/init_connect.test: Auto merged mysql-test/t/insert_select.test: Auto merged mysql-test/t/insert_update.test: Auto merged mysql-test/t/key.test: Auto merged mysql-test/t/keywords.test: Auto merged mysql-test/t/limit.test: Auto merged mysql-test/t/lock.test: Auto merged mysql-test/t/lowercase_table.test: Auto merged mysql-test/t/lowercase_table3.test: Auto merged mysql-test/t/merge.test: Auto merged mysql-test/t/mix_innodb_myisam_binlog.test: Auto merged mysql-test/t/myisam.test: Auto merged mysql-test/t/mysqlbinlog2.test: Auto merged mysql-test/t/ndb_alter_table.test: Auto merged mysql-test/t/ndb_autodiscover.test: Auto merged mysql-test/t/ndb_charset.test: Auto merged mysql-test/t/ndb_grant.later: Auto merged mysql-test/t/ndb_index_ordered.test: Auto merged mysql-test/t/ndb_index_unique.test: Auto merged mysql-test/t/ndb_restore.test: Auto merged mysql-test/t/ndb_types.test: Auto merged mysql-test/t/ndb_update.test: Auto merged mysql-test/t/null.test: Auto merged mysql-test/t/null_key.test: Auto merged mysql-test/t/olap.test: Auto merged mysql-test/t/openssl_1.test: Auto merged mysql-test/t/order_by.test: Auto merged mysql-test/t/ps.test: Auto merged mysql-test/t/ps_1general.test: Auto merged mysql-test/t/ps_4heap.test: Auto merged mysql-test/t/ps_5merge.test: Auto merged mysql-test/t/query_cache.test: Auto merged mysql-test/t/replace.test: Auto merged mysql-test/t/row.test: Auto merged mysql-test/t/rpl000001.test: Auto merged mysql-test/t/rpl000015.test: Auto merged mysql-test/t/rpl000017.test: Auto merged mysql-test/t/rpl000018.test: Auto merged mysql-test/t/rpl_EE_error.test: Auto merged mysql-test/t/rpl_change_master.test: Auto merged mysql-test/t/rpl_charset.test: Auto merged mysql-test/t/rpl_create_database.test: Auto merged mysql-test/t/rpl_ddl.test: Auto merged mysql-test/t/rpl_deadlock.test: Auto merged mysql-test/t/rpl_empty_master_crash.test: Auto merged mysql-test/t/rpl_error_ignored_table.test: Auto merged mysql-test/t/rpl_flush_log_loop.test: Auto merged mysql-test/t/rpl_flush_tables.test: Auto merged mysql-test/t/rpl_get_lock.test: Auto merged mysql-test/t/rpl_heap.test: Auto merged mysql-test/t/rpl_loaddata.test: Auto merged mysql-test/t/rpl_loaddata_rule_m.test: Auto merged mysql-test/t/rpl_log.test: Auto merged mysql-test/t/rpl_log_pos.test: Auto merged mysql-test/t/rpl_max_relay_size.test: Auto merged mysql-test/t/rpl_multi_query.test: Auto merged mysql-test/t/rpl_openssl.test: Auto merged mysql-test/t/rpl_redirect.test: Auto merged mysql-test/t/rpl_relayrotate.test: Auto merged mysql-test/t/rpl_replicate_do.test: Auto merged mysql-test/t/rpl_reset_slave.test: Auto merged mysql-test/t/rpl_server_id2.test: Auto merged mysql-test/t/rpl_temporary.test: Auto merged mysql-test/t/rpl_timezone.test: Auto merged mysql-test/t/rpl_user_variables.test: Auto merged mysql-test/t/show_check.test: Auto merged mysql-test/t/subselect.test: Auto merged mysql-test/t/symlink.test: Auto merged mysql-test/t/synchronization.test: Auto merged mysql-test/t/system_mysql_db.test: Auto merged mysql-test/t/system_mysql_db_fix.test: Auto merged mysql-test/t/temp_table.test: Auto merged mysql-test/t/timezone2.test: Auto merged mysql-test/t/timezone_grant.test: Auto merged mysql-test/t/type_float.test: Auto merged mysql-test/t/type_ranges.test: Auto merged mysql-test/t/type_timestamp.test: Auto merged mysql-test/t/union.test: Auto merged mysql-test/t/update.test: Auto merged mysql-test/t/user_var-binlog.test: Auto merged mysql-test/t/warnings.test: Auto merged mysys/thr_lock.c: Auto merged sql/slave.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_select.cc: Auto merged support-files/mysql.spec.sh: Auto merged BitKeeper/deleted/.del-rpl_trunc_binlog.test~961b1f6ac73d37c8: Simple merge mysql-test/r/ps_grant.result: Simple merge mysql-test/t/analyse.test: Simple merge mysql-test/t/auto_increment.test: Simple merge mysql-test/t/bdb.test: Simple merge mysql-test/t/bigint.test: Simple merge mysql-test/t/case.test: Simple merge mysql-test/t/cast.test: Simple merge mysql-test/t/check.test: Simple merge mysql-test/t/count_distinct.test: Simple merge mysql-test/t/ctype_latin1_de.test: Simple merge mysql-test/t/ctype_uca.test: Simple merge mysql-test/t/ctype_ucs.test: Simple merge mysql-test/t/ctype_utf8.test: Simple merge mysql-test/t/delete.test: Simple merge mysql-test/t/flush_block_commit.test: Simple merge mysql-test/t/func_default.test: Simple merge mysql-test/t/func_gconcat.test: Simple merge mysql-test/t/func_group.test: Aligned code with 4.1 mysql-test/t/func_in.test: Simple merge mysql-test/t/func_math.test: Simple merge mysql-test/t/func_misc.test: Simple merge mysql-test/t/func_test.test: Simple merge mysql-test/t/func_time.test: Simple merge mysql-test/t/group_by.test: Simple merge mysql-test/t/having.test: Simple merge mysql-test/t/innodb.test: Simple merge mysql-test/t/insert.test: Simple merge mysql-test/t/join_outer.test: Simple merge mysql-test/t/kill.test: Simple merge mysql-test/t/loaddata.test: Simple merge mysql-test/t/lock_multi.test: Simple merge mysql-test/t/multi_update.test: Simple merge mysql-test/t/mysqlbinlog.test: Simple merge mysql-test/t/mysqldump.test: Aligned code with 4.1 mysql-test/t/mysqltest.test: Simple merge mysql-test/t/ndb_basic.test: Simple merge mysql-test/t/ndb_cache.test: Simple merge mysql-test/t/ndb_subquery.test: Simple merge mysql-test/t/ps_grant.test: Simple merge mysql-test/t/range.test: Simple merge mysql-test/t/rpl_drop_temp.test: Simple merge mysql-test/t/rpl_loaddata_rule_s.test: Simple merge mysql-test/t/rpl_loaddatalocal.test: Simple merge mysql-test/t/rpl_rotate_logs.test: Simple merge mysql-test/t/rpl_until.test: Simple merge mysql-test/t/rpl_variables.test: Simple merge mysql-test/t/select.test: Simple merge mysql-test/t/sql_mode.test: Simple merge mysql-test/t/type_blob.test: Simple merge mysql-test/t/type_decimal.test: Simple merge mysql-test/t/user_var.test: Simple merge mysql-test/t/variables.test: Simple merge sql/lock.cc: Simple optimization sql/mysql_priv.h: Simple merge sql/sql_table.cc: Simple merge sql/table.cc: Simple merge sql/unireg.cc: Simple merge
323 lines
11 KiB
Text
323 lines
11 KiB
Text
#
|
|
# test of MERGE TABLES
|
|
#
|
|
|
|
--disable_warnings
|
|
drop table if exists t1,t2,t3,t4,t5,t6;
|
|
drop database if exists mysqltest;
|
|
--enable_warnings
|
|
|
|
create table t1 (a int not null primary key auto_increment, message char(20));
|
|
create table t2 (a int not null primary key auto_increment, message char(20));
|
|
INSERT INTO t1 (message) VALUES ("Testing"),("table"),("t1");
|
|
INSERT INTO t2 (message) VALUES ("Testing"),("table"),("t2");
|
|
create table t3 (a int not null, b char(20), key(a)) engine=MERGE UNION=(t1,t2);
|
|
select * from t3;
|
|
select * from t3 order by a desc;
|
|
drop table t3;
|
|
insert into t1 select NULL,message from t2;
|
|
insert into t2 select NULL,message from t1;
|
|
insert into t1 select NULL,message from t2;
|
|
insert into t2 select NULL,message from t1;
|
|
insert into t1 select NULL,message from t2;
|
|
insert into t2 select NULL,message from t1;
|
|
insert into t1 select NULL,message from t2;
|
|
insert into t2 select NULL,message from t1;
|
|
insert into t1 select NULL,message from t2;
|
|
insert into t2 select NULL,message from t1;
|
|
insert into t1 select NULL,message from t2;
|
|
create table t3 (a int not null, b char(20), key(a)) engine=MERGE UNION=(test.t1,test.t2);
|
|
explain select * from t3 where a < 10;
|
|
explain select * from t3 where a > 10 and a < 20;
|
|
select * from t3 where a = 10;
|
|
select * from t3 where a < 10;
|
|
select * from t3 where a > 10 and a < 20;
|
|
explain select a from t3 order by a desc limit 10;
|
|
select a from t3 order by a desc limit 10;
|
|
select a from t3 order by a desc limit 300,10;
|
|
delete from t3 where a=3;
|
|
select * from t3 where a < 10;
|
|
delete from t3 where a >= 6 and a <= 8;
|
|
select * from t3 where a < 10;
|
|
update t3 set a=3 where a=9;
|
|
select * from t3 where a < 10;
|
|
update t3 set a=6 where a=7;
|
|
select * from t3 where a < 10;
|
|
show create table t3;
|
|
|
|
# The following should give errors
|
|
create table t4 (a int not null, b char(10), key(a)) engine=MERGE UNION=(t1,t2);
|
|
--error 1168
|
|
select * from t4;
|
|
--error 1168
|
|
alter table t4 add column c int;
|
|
|
|
#
|
|
# Test tables in different databases
|
|
#
|
|
create database mysqltest;
|
|
create table mysqltest.t6 (a int not null primary key auto_increment, message char(20));
|
|
create table t5 (a int not null, b char(20), key(a)) engine=MERGE UNION=(test.t1,mysqltest.t6);
|
|
show create table t5;
|
|
alter table t5 engine=myisam;
|
|
drop table t5, mysqltest.t6;
|
|
drop database mysqltest;
|
|
|
|
# Because of windows, it's important that we drop the merge tables first!
|
|
drop table t4,t3,t1,t2;
|
|
|
|
create table t1 (c char(10)) engine=myisam;
|
|
create table t2 (c char(10)) engine=myisam;
|
|
create table t3 (c char(10)) union=(t1,t2) engine=merge;
|
|
insert into t1 (c) values ('test1');
|
|
insert into t1 (c) values ('test1');
|
|
insert into t1 (c) values ('test1');
|
|
insert into t2 (c) values ('test2');
|
|
insert into t2 (c) values ('test2');
|
|
insert into t2 (c) values ('test2');
|
|
select * from t3;
|
|
select * from t3;
|
|
delete from t3 where 1=1;
|
|
select * from t3;
|
|
select * from t1;
|
|
drop table t3,t2,t1;
|
|
|
|
#
|
|
# Test 2
|
|
#
|
|
|
|
CREATE TABLE t1 (incr int not null, othr int not null, primary key(incr));
|
|
CREATE TABLE t2 (incr int not null, othr int not null, primary key(incr));
|
|
CREATE TABLE t3 (incr int not null, othr int not null, primary key(incr))
|
|
ENGINE=MERGE UNION=(t1,t2);
|
|
|
|
SELECT * from t3;
|
|
|
|
INSERT INTO t1 VALUES ( 1,10),( 3,53),( 5,21),( 7,12),( 9,17);
|
|
INSERT INTO t2 VALUES ( 2,24),( 4,33),( 6,41),( 8,26),( 0,32);
|
|
INSERT INTO t1 VALUES (11,20),(13,43),(15,11),(17,22),(19,37);
|
|
INSERT INTO t2 VALUES (12,25),(14,31),(16,42),(18,27),(10,30);
|
|
|
|
SELECT * from t3 where incr in (1,2,3,4) order by othr;
|
|
alter table t3 UNION=(t1);
|
|
select count(*) from t3;
|
|
alter table t3 UNION=(t1,t2);
|
|
select count(*) from t3;
|
|
alter table t3 ENGINE=MYISAM;
|
|
select count(*) from t3;
|
|
|
|
# Test that ALTER TABLE rembers the old UNION
|
|
|
|
drop table t3;
|
|
CREATE TABLE t3 (incr int not null, othr int not null, primary key(incr))
|
|
ENGINE=MERGE UNION=(t1,t2);
|
|
show create table t3;
|
|
alter table t3 drop primary key;
|
|
show create table t3;
|
|
|
|
drop table t3,t2,t1;
|
|
|
|
#
|
|
# Test table without unions
|
|
#
|
|
create table t1 (a int not null, key(a)) engine=merge;
|
|
select * from t1;
|
|
drop table t1;
|
|
|
|
#
|
|
# Bug in flush tables combined with MERGE tables
|
|
#
|
|
|
|
create table t1 (a int not null, b int not null, key(a,b));
|
|
create table t2 (a int not null, b int not null, key(a,b));
|
|
create table t3 (a int not null, b int not null, key(a,b)) ENGINE=MERGE UNION=(t1,t2);
|
|
insert into t1 values (1,2),(2,1),(0,0),(4,4),(5,5),(6,6);
|
|
insert into t2 values (1,1),(2,2),(0,0),(4,4),(5,5),(6,6);
|
|
flush tables;
|
|
select * from t3 where a=1 order by b limit 2;
|
|
drop table t3,t1,t2;
|
|
|
|
#
|
|
# [phi] testing INSERT_METHOD stuff
|
|
#
|
|
|
|
# first testing of common stuff with new parameters
|
|
create table t1 (a int not null, b int not null auto_increment, primary key(a,b));
|
|
create table t2 (a int not null, b int not null auto_increment, primary key(a,b));
|
|
create table t3 (a int not null, b int not null, key(a,b)) UNION=(t1,t2) INSERT_METHOD=NO;
|
|
create table t4 (a int not null, b int not null, key(a,b)) ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=NO;
|
|
create table t5 (a int not null, b int not null auto_increment, primary key(a,b)) ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
|
|
create table t6 (a int not null, b int not null auto_increment, primary key(a,b)) ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
|
|
show create table t3;
|
|
show create table t4;
|
|
show create table t5;
|
|
show create table t6;
|
|
insert into t1 values (1,NULL),(1,NULL),(1,NULL),(1,NULL);
|
|
insert into t2 values (2,NULL),(2,NULL),(2,NULL),(2,NULL);
|
|
select * from t3 order by b,a limit 3;
|
|
select * from t4 order by b,a limit 3;
|
|
select * from t5 order by b,a limit 3,3;
|
|
select * from t6 order by b,a limit 6,3;
|
|
# now testing inserts and where the data gets written
|
|
insert into t5 values (5,1),(5,2);
|
|
insert into t6 values (6,1),(6,2);
|
|
select * from t1 order by a,b;
|
|
select * from t2 order by a,b;
|
|
select * from t4 order by a,b;
|
|
# preperation for next test
|
|
insert into t3 values (3,1),(3,2),(3,3),(3,4);
|
|
select * from t3 order by a,b;
|
|
# now testing whether options are kept by alter table
|
|
alter table t4 UNION=(t1,t2,t3);
|
|
show create table t4;
|
|
select * from t4 order by a,b;
|
|
# testing switching off insert method and inserts again
|
|
alter table t4 INSERT_METHOD=FIRST;
|
|
show create table t4;
|
|
insert into t4 values (4,1),(4,2);
|
|
select * from t1 order by a,b;
|
|
select * from t2 order by a,b;
|
|
select * from t3 order by a,b;
|
|
select * from t4 order by a,b;
|
|
select * from t5 order by a,b;
|
|
# auto_increment
|
|
select 1;
|
|
insert into t5 values (1,NULL),(5,NULL);
|
|
insert into t6 values (2,NULL),(6,NULL);
|
|
select * from t1 order by a,b;
|
|
select * from t2 order by a,b;
|
|
select * from t5 order by a,b;
|
|
select * from t6 order by a,b;
|
|
insert into t1 values (99,NULL);
|
|
select * from t4 where a+0 > 90;
|
|
# bug#4008 - cannot determine a unique key that caused "dupl. key error"
|
|
--error 1062
|
|
insert t5 values (1,1);
|
|
--error 1062
|
|
insert t6 values (2,1);
|
|
insert t5 values (1,1) on duplicate key update b=b+10;
|
|
insert t6 values (2,1) on duplicate key update b=b+20;
|
|
select * from t5 where a < 3;
|
|
drop table t6, t5, t4, t3, t2, t1;
|
|
|
|
CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) ENGINE=MyISAM;
|
|
INSERT INTO t1 VALUES (1,1), (2,1);
|
|
CREATE TABLE t2 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) ENGINE=MyISAM;
|
|
INSERT INTO t2 VALUES (1,2), (2,2);
|
|
CREATE TABLE t3 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) ENGINE=MRG_MyISAM UNION=(t1,t2);
|
|
select max(b) from t3 where a = 2;
|
|
select max(b) from t1 where a = 2;
|
|
drop table t3,t1,t2;
|
|
|
|
#
|
|
# temporary merge tables
|
|
#
|
|
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) ENGINE=MERGE UNION=(t1,t2);
|
|
select * from t3;
|
|
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) ENGINE=MERGE UNION=(t4,t5);
|
|
select * from t6;
|
|
drop table t6, t3, t1, t2, t4, t5;
|
|
|
|
#
|
|
# testing merge::records_in_range and optimizer
|
|
#
|
|
|
|
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)
|
|
) ENGINE=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)
|
|
) ENGINE=MRG_MyISAM UNION=(t1);
|
|
|
|
EXPLAIN SELECT * FROM t2 IGNORE INDEX (files) WHERE fileset_id = 2
|
|
AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1;
|
|
EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2
|
|
AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1;
|
|
EXPLAIN SELECT * FROM t1 WHERE fileset_id = 2
|
|
AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1;
|
|
EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2
|
|
AND file_code = '0000000115' LIMIT 1;
|
|
DROP TABLE t2, t1;
|
|
|
|
#
|
|
# Test of ORDER BY DESC on key (Bug #515)
|
|
#
|
|
|
|
create table t1 (x int, y int, index xy(x, y));
|
|
create table t2 (x int, y int, index xy(x, y));
|
|
create table t3 (x int, y int, index xy(x, y)) engine=merge union=(t1,t2);
|
|
insert into t1 values(1, 2);
|
|
insert into t2 values(1, 3);
|
|
select * from t3 where x = 1 and y < 5 order by y;
|
|
# Bug is that followng query returns empty set while it must be same as above
|
|
select * from t3 where x = 1 and y < 5 order by y desc;
|
|
drop table t1,t2,t3;
|
|
|
|
#
|
|
# Bug#5232: CREATE TABLE ... SELECT
|
|
#
|
|
|
|
create table t1 (a int);
|
|
create table t2 (a int);
|
|
insert into t1 values (0);
|
|
insert into t2 values (1);
|
|
--error 1093
|
|
create table t3 engine=merge union=(t1, t2) select * from t1;
|
|
--error 1093
|
|
create table t3 engine=merge union=(t1, t2) select * from t2;
|
|
--error 1093
|
|
create table t3 engine=merge union=(t1, t2) select (select max(a) from t2);
|
|
drop table t1, t2;
|
|
|
|
# BUG#6699 : no sorting on 'ref' retrieval
|
|
create table t1 (a int,b int,c int, index (a,b,c));
|
|
create table t2 (a int,b int,c int, index (a,b,c));
|
|
create table t3 (a int,b int,c int, index (a,b,c))
|
|
engine=merge union=(t1 ,t2);
|
|
insert into t1 (a,b,c) values (1,1,0),(1,2,0);
|
|
insert into t2 (a,b,c) values (1,1,1),(1,2,1);
|
|
|
|
explain select a,b,c from t3 force index (a) where a=1 order by a,b,c;
|
|
select a,b,c from t3 force index (a) where a=1 order by a,b,c;
|
|
|
|
# this actually wasn't affected:
|
|
explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
|
|
select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
|
|
|
|
# BUG#7377 SHOW index on MERGE table crashes debug server
|
|
show index from t3;
|
|
|
|
drop table t1, t2, t3;
|
|
|
|
#
|
|
# Bug#10400 - Improperly-defined MERGE table crashes with INSERT ... ON DUPLICATE KEY UPDATE
|
|
#
|
|
CREATE TABLE t1 ( a INT AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10), UNIQUE (b) )
|
|
ENGINE=MyISAM;
|
|
CREATE TABLE t2 ( a INT AUTO_INCREMENT, b VARCHAR(10), INDEX (a), INDEX (b) )
|
|
ENGINE=MERGE UNION (t1) INSERT_METHOD=FIRST;
|
|
INSERT INTO t2 (b) VALUES (1) ON DUPLICATE KEY UPDATE b=2;
|
|
INSERT INTO t2 (b) VALUES (1) ON DUPLICATE KEY UPDATE b=3;
|
|
SELECT b FROM t2;
|
|
DROP TABLE t1, t2;
|
|
|
|
# End of 4.1 tests
|