mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Add innodb plugin tests to a new mysql test suite 'innodb'.
Created a test suite 'innodb' under mysql-test/suite/innodb for the innodb plugin tests. test suite 'innodb' has tests only which are not under any other mysql-test suites. Total 14 testcases are added to the test suite. Note: the patches in storage/innodb_plugin/mysql-test/patches are not applied yet
This commit is contained in:
21
mysql-test/suite/innodb/include/ctype_innodb_like.inc
Normal file
21
mysql-test/suite/innodb/include/ctype_innodb_like.inc
Normal file
@ -0,0 +1,21 @@
|
||||
#
|
||||
# Bug#11650: LIKE pattern matching using prefix index
|
||||
# doesn't return correct result
|
||||
#
|
||||
--disable_warnings
|
||||
#
|
||||
# This query creates a column using
|
||||
# character_set_connection and
|
||||
# collation_connection.
|
||||
#
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
--enable_warnings
|
||||
alter table t1 add index(c1(5));
|
||||
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
drop table t1;
|
4
mysql-test/suite/innodb/include/have_innodb.inc
Normal file
4
mysql-test/suite/innodb/include/have_innodb.inc
Normal file
@ -0,0 +1,4 @@
|
||||
disable_query_log;
|
||||
--require r/true.require
|
||||
select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'innodb';
|
||||
enable_query_log;
|
26
mysql-test/suite/innodb/include/innodb-index.inc
Normal file
26
mysql-test/suite/innodb/include/innodb-index.inc
Normal file
@ -0,0 +1,26 @@
|
||||
--eval create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb default charset=$charset
|
||||
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
|
||||
commit;
|
||||
--error ER_DUP_ENTRY
|
||||
alter table t1 add unique index (b);
|
||||
insert into t1 values(8,9,'fff','fff');
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
alter table t1 add index (b);
|
||||
insert into t1 values(10,10,'kkk','iii');
|
||||
select * from t1;
|
||||
select * from t1 force index(b) order by b;
|
||||
explain select * from t1 force index(b) order by b;
|
||||
show create table t1;
|
||||
alter table t1 add unique index (c), add index (d);
|
||||
insert into t1 values(11,11,'aaa','mmm');
|
||||
select * from t1;
|
||||
select * from t1 force index(b) order by b;
|
||||
select * from t1 force index(c) order by c;
|
||||
select * from t1 force index(d) order by d;
|
||||
explain select * from t1 force index(b) order by b;
|
||||
explain select * from t1 force index(c) order by c;
|
||||
explain select * from t1 force index(d) order by d;
|
||||
show create table t1;
|
||||
check table t1;
|
||||
drop table t1;
|
51
mysql-test/suite/innodb/include/innodb_trx_weight.inc
Normal file
51
mysql-test/suite/innodb/include/innodb_trx_weight.inc
Normal file
@ -0,0 +1,51 @@
|
||||
-- connect (con1,localhost,root,,)
|
||||
-- connect (con2,localhost,root,,)
|
||||
|
||||
-- connection con1
|
||||
SET autocommit=0;
|
||||
SELECT * FROM t1 FOR UPDATE;
|
||||
-- if ($con1_extra_sql_present) {
|
||||
-- eval $con1_extra_sql
|
||||
-- }
|
||||
|
||||
-- connection con2
|
||||
SET autocommit=0;
|
||||
SELECT * FROM t2 FOR UPDATE;
|
||||
-- if ($con2_extra_sql_present) {
|
||||
-- eval $con2_extra_sql
|
||||
-- }
|
||||
|
||||
-- if ($con1_should_be_rolledback) {
|
||||
-- connection con1
|
||||
-- send
|
||||
INSERT INTO t2 VALUES (0);
|
||||
|
||||
-- connection con2
|
||||
INSERT INTO t1 VALUES (0);
|
||||
ROLLBACK;
|
||||
|
||||
-- connection con1
|
||||
-- error ER_LOCK_DEADLOCK
|
||||
-- reap
|
||||
-- }
|
||||
# else
|
||||
-- if (!$con1_should_be_rolledback) {
|
||||
-- connection con2
|
||||
-- send
|
||||
INSERT INTO t1 VALUES (0);
|
||||
|
||||
-- connection con1
|
||||
INSERT INTO t2 VALUES (0);
|
||||
ROLLBACK;
|
||||
|
||||
-- connection con2
|
||||
-- error ER_LOCK_DEADLOCK
|
||||
-- reap
|
||||
-- }
|
||||
|
||||
-- connection default
|
||||
|
||||
DELETE FROM t5_nontrans;
|
||||
|
||||
-- disconnect con1
|
||||
-- disconnect con2
|
Reference in New Issue
Block a user