mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
3a272c1fa9
Note: One sp.test still fails (prime), and rpl_server_id2.test fails (will be fixed by guilhem ASAP). mysql-test/r/index_merge.result: Fixed syntax error (no ',' after last index in create table any more). mysql-test/r/index_merge_bdb.result: Fixed syntax error (no ',' after last index in create table any more). mysql-test/r/index_merge_innodb.result: Fixed syntax error (no ',' after last index in create table any more). mysql-test/r/index_merge_innodb2.result: Fixed syntax error (no ',' after last index in create table any more). mysql-test/r/rpl_server_id1.result: Update result after merge. mysql-test/r/sp-error.result: Update result after merge. mysql-test/r/variables.result: Update result after merge. mysql-test/t/index_merge.test: Fixed syntax error (no ',' after last index in create table any more). mysql-test/t/index_merge_bdb.test: Fixed syntax error (no ',' after last index in create table any more). mysql-test/t/index_merge_innodb.test: Fixed syntax error (no ',' after last index in create table any more). mysql-test/t/index_merge_innodb2.test: Fixed syntax error (no ',' after last index in create table any more). mysql-test/t/sp-error.test: Post-merge fix of error codes. sql/opt_range.cc: Manually merged by Monty. sql/opt_range.h: Manually merged by Monty. sql/slave.cc: Post-merge fixes with some help from Guilhem. sql/slave.h: Post-merge fixes with some help from Guilhem. sql/sp_head.cc: Got rid of warning (reordering initialization). sql/sql_parse.cc: Post-merge fix: Need to set/reset select_limit at SP CALL time as well. tests/client_test.c: Post-merge fix: key_len length in explain has changed.
54 lines
1.3 KiB
Text
54 lines
1.3 KiB
Text
#
|
|
# Index merge tests
|
|
#
|
|
-- source include/have_innodb.inc
|
|
|
|
--disable_warnings
|
|
drop table if exists t1;
|
|
--enable_warnings
|
|
|
|
create table t1
|
|
(
|
|
key1 int not null,
|
|
key2 int not null,
|
|
|
|
INDEX i1(key1),
|
|
INDEX i2(key2)
|
|
) engine=innodb;
|
|
|
|
--disable_query_log
|
|
let $1=200;
|
|
while ($1)
|
|
{
|
|
eval insert into t1 values (200-$1, $1);
|
|
dec $1;
|
|
}
|
|
--enable_query_log
|
|
|
|
# No primary key
|
|
explain select * from t1 where key1 < 5 or key2 > 197;
|
|
|
|
select * from t1 where key1 < 5 or key2 > 197;
|
|
|
|
explain select * from t1 where key1 < 3 or key2 > 195;
|
|
select * from t1 where key1 < 3 or key2 > 195;
|
|
|
|
# Primary key as case-sensitive string with \0s.
|
|
# also make primary key be longer then max. index length of MyISAM.
|
|
alter table t1 add str1 char (255) not null,
|
|
add zeroval int not null default 0,
|
|
add str2 char (255) not null,
|
|
add str3 char (255) not null;
|
|
|
|
update t1 set str1='aaa', str2='bbb', str3=concat(key2, '-', key1 div 2, '_' ,if(key1 mod 2 = 0, 'a', 'A'));
|
|
|
|
alter table t1 add primary key (str1, zeroval, str2, str3);
|
|
|
|
explain select * from t1 where key1 < 5 or key2 > 197;
|
|
|
|
select * from t1 where key1 < 5 or key2 > 197;
|
|
|
|
explain select * from t1 where key1 < 3 or key2 > 195;
|
|
select * from t1 where key1 < 3 or key2 > 195;
|
|
|
|
drop table t1;
|