This changeset belongs to

        WL#3397 Refactoring storage engine test cases (for falcon)
      It contains fixes according to second code review.
- Remove any occurence of hardcoded assignments of storage engines
- Use variable names exact telling what it is used for
- Updated comments
- remove trailing spaces
parent aaa9ed3e
# include/handler.inc # include/handler.inc
# #
# The variable # The variables
# $engine_type -- storage engine to be tested # $engine_type -- storage engine to be tested
# has to be set before sourcing this script. # $other_engine_type -- storage engine <> $engine_type
# $other_handler_engine_type -- storage engine <> $engine_type, if possible
# 1. $other_handler_engine_type must support handler
# 2. $other_handler_engine_type must point to an all
# time available storage engine
# 2006-08 MySQL 5.1 MyISAM and MEMORY only
# have to be set before sourcing this script.
# #
# test of HANDLER ... # test of HANDLER ...
# #
...@@ -108,7 +114,7 @@ insert into t1 values (17); ...@@ -108,7 +114,7 @@ insert into t1 values (17);
--error 1109 --error 1109
handler t2 read first; handler t2 read first;
handler t1 open as t2; handler t1 open as t2;
alter table t1 engine=MyISAM; eval alter table t1 engine=$other_engine_type;
--error 1109 --error 1109
handler t2 read first; handler t2 read first;
drop table t1; drop table t1;
...@@ -327,7 +333,7 @@ insert into t5 values ("t5"); ...@@ -327,7 +333,7 @@ insert into t5 values ("t5");
handler t5 open as h5; handler t5 open as h5;
handler h5 read first limit 9; handler h5 read first limit 9;
# close first # close first
alter table t1 engine=MyISAM; eval alter table t1 engine=$other_handler_engine_type;
--error 1109 --error 1109
handler h1 read first limit 9; handler h1 read first limit 9;
handler h2 read first limit 9; handler h2 read first limit 9;
...@@ -335,7 +341,7 @@ handler h3 read first limit 9; ...@@ -335,7 +341,7 @@ handler h3 read first limit 9;
handler h4 read first limit 9; handler h4 read first limit 9;
handler h5 read first limit 9; handler h5 read first limit 9;
# close last # close last
alter table t5 engine=MyISAM; eval alter table t5 engine=$other_handler_engine_type;
--error 1109 --error 1109
handler h1 read first limit 9; handler h1 read first limit 9;
handler h2 read first limit 9; handler h2 read first limit 9;
...@@ -344,7 +350,7 @@ handler h4 read first limit 9; ...@@ -344,7 +350,7 @@ handler h4 read first limit 9;
--error 1109 --error 1109
handler h5 read first limit 9; handler h5 read first limit 9;
# close middle # close middle
alter table t3 engine=MyISAM; eval alter table t3 engine=$other_handler_engine_type;
--error 1109 --error 1109
handler h1 read first limit 9; handler h1 read first limit 9;
handler h2 read first limit 9; handler h2 read first limit 9;
...@@ -362,7 +368,7 @@ handler t1 open as h1_3; ...@@ -362,7 +368,7 @@ handler t1 open as h1_3;
handler h1_1 read first limit 9; handler h1_1 read first limit 9;
handler h1_2 read first limit 9; handler h1_2 read first limit 9;
handler h1_3 read first limit 9; handler h1_3 read first limit 9;
alter table t1 engine=MyISAM; eval alter table t1 engine=$engine_type;
--error 1109 --error 1109
handler h1_1 read first limit 9; handler h1_1 read first limit 9;
--error 1109 --error 1109
......
# include/mix1.inc # include/mix1.inc
# #
# The variables # The variables
# $engine_type -- storage engine to be tested # $engine_type -- storage engine to be tested
# $other_engine_type -- storage engine <> $engine_type # $other_engine_type -- storage engine <> $engine_type
# $other_engine_type should be an alltime # $other_engine_type must point to an all
# available storage engine like MyISAM or MEMORY # time available storage engine
# 2006-08 MySQL 5.1 MyISAM and MEMORY only
# have to be set before sourcing this script. # have to be set before sourcing this script.
# #
# Note: The comments/expectations refer to InnoDB. # Note: The comments/expectations refer to InnoDB.
# They might be not valid for other storage engines. # They might be not valid for other storage engines.
# #
...@@ -15,12 +16,12 @@ ...@@ -15,12 +16,12 @@
# - shift main code of t/innodb_mysql.test to include/mix1.inc # - shift main code of t/innodb_mysql.test to include/mix1.inc
# - replace hardcoded assignment of storage engine by # - replace hardcoded assignment of storage engine by
# use of $engine_type and $other_engine_type variables # use of $engine_type and $other_engine_type variables
# - remove redundant replay testcase of # - remove redundant replay testcase of
# Bug#12882 min/max inconsistent on empty table # Bug#12882 min/max inconsistent on empty table
# - corrected analyze table t1; to analyze table t4; # - corrected analyze table t1; to analyze table t4;
# Much older versions of this test show that the table # Much older versions of this test show that the table
# where just some indexes have been created must be used. # where just some indexes have been created must be used.
# #
eval SET SESSION STORAGE_ENGINE = $engine_type; eval SET SESSION STORAGE_ENGINE = $engine_type;
...@@ -44,7 +45,7 @@ create table t1 ( ...@@ -44,7 +45,7 @@ create table t1 (
unique key contacts$c_id (c_id), unique key contacts$c_id (c_id),
key contacts$org_id (org_id) key contacts$org_id (org_id)
); );
insert into t1 values insert into t1 values
(2,null),(120,null),(141,null),(218,7), (128,1), (2,null),(120,null),(141,null),(218,7), (128,1),
(151,2),(234,2),(236,2),(243,2),(255,2),(259,2),(232,3),(235,3),(238,3), (151,2),(234,2),(236,2),(243,2),(255,2),(259,2),(232,3),(235,3),(238,3),
(246,3),(253,3),(269,3),(285,3),(291,3),(293,3),(131,4),(230,4),(231,4); (246,3),(253,3),(269,3),(285,3),(291,3),(293,3),(131,4),(230,4),(231,4);
...@@ -75,17 +76,17 @@ insert into t2(slai_id, owner_tbl, owner_id, sla_id) values ...@@ -75,17 +76,17 @@ insert into t2(slai_id, owner_tbl, owner_id, sla_id) values
flush tables; flush tables;
select si.slai_id select si.slai_id
from t1 c join t2 si on from t1 c join t2 si on
((si.owner_tbl = 3 and si.owner_id = c.org_id) or ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
( si.owner_tbl = 2 and si.owner_id = c.c_id)) ( si.owner_tbl = 2 and si.owner_id = c.c_id))
where where
c.c_id = 218 and expiredate is null; c.c_id = 218 and expiredate is null;
select * from t1 where org_id is null; select * from t1 where org_id is null;
select si.slai_id select si.slai_id
from t1 c join t2 si on from t1 c join t2 si on
((si.owner_tbl = 3 and si.owner_id = c.org_id) or ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
( si.owner_tbl = 2 and si.owner_id = c.c_id)) ( si.owner_tbl = 2 and si.owner_id = c.c_id))
where where
c.c_id = 218 and expiredate is null; c.c_id = 218 and expiredate is null;
drop table t1, t2; drop table t1, t2;
...@@ -94,14 +95,14 @@ drop table t1, t2; ...@@ -94,14 +95,14 @@ drop table t1, t2;
# Bug#17212: results not sorted correctly by ORDER BY when using index # Bug#17212: results not sorted correctly by ORDER BY when using index
# (repeatable only w/innodb because of index props) # (repeatable only w/innodb because of index props)
# #
CREATE TABLE t1 (a int, b int, KEY b (b)) Engine=InnoDB; CREATE TABLE t1 (a int, b int, KEY b (b));
CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b)) Engine=InnoDB; CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b));
CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY (a), CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY (a),
UNIQUE KEY b (b,c), KEY a (a,b,c)) Engine=InnoDB; UNIQUE KEY b (b,c), KEY a (a,b,c));
INSERT INTO t1 VALUES (1, 1); INSERT INTO t1 VALUES (1, 1);
INSERT INTO t1 SELECT a + 1, b + 1 FROM t1; INSERT INTO t1 SELECT a + 1, b + 1 FROM t1;
INSERT INTO t1 SELECT a + 2, b + 2 FROM t1; INSERT INTO t1 SELECT a + 2, b + 2 FROM t1;
INSERT INTO t2 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8); INSERT INTO t2 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8);
INSERT INTO t2 SELECT a + 1, b FROM t2; INSERT INTO t2 SELECT a + 1, b FROM t2;
...@@ -113,13 +114,13 @@ INSERT INTO t3 SELECT a + 4, a + 4, 3 FROM t3; ...@@ -113,13 +114,13 @@ INSERT INTO t3 SELECT a + 4, a + 4, 3 FROM t3;
# demonstrate a problem when a must-use-sort table flag # demonstrate a problem when a must-use-sort table flag
# (sort_by_table=1) is being neglected. # (sort_by_table=1) is being neglected.
SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2) t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
ORDER BY t1.b LIMIT 2; ORDER BY t1.b LIMIT 2;
# demonstrate the problem described in the bug report # demonstrate the problem described in the bug report
SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2) t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
ORDER BY t1.b LIMIT 5; ORDER BY t1.b LIMIT 5;
DROP TABLE t1, t2, t3; DROP TABLE t1, t2, t3;
...@@ -172,7 +173,7 @@ select count(*), min(7), max(7) from t2m, t1i; ...@@ -172,7 +173,7 @@ select count(*), min(7), max(7) from t2m, t1i;
drop table t1m, t1i, t2m, t2i; drop table t1m, t1i, t2m, t2i;
# #
# Bug #12882: primary key implcitly included in every innodb index # Bug #12882: primary key implcitly included in every innodb index
# (was part of group_min_max.test) # (was part of group_min_max.test)
# #
...@@ -230,7 +231,7 @@ select distinct a1 from t4 where pk_col not in (1,2,3,4); ...@@ -230,7 +231,7 @@ select distinct a1 from t4 where pk_col not in (1,2,3,4);
drop table t1,t4; drop table t1,t4;
# #
# Bug #6142: a problem with the empty innodb table # Bug #6142: a problem with the empty innodb table
# (was part of group_min_max.test) # (was part of group_min_max.test)
# #
...@@ -243,7 +244,7 @@ select distinct a from t1; ...@@ -243,7 +244,7 @@ select distinct a from t1;
drop table t1; drop table t1;
# #
# Bug #9798: group by with rollup # Bug #9798: group by with rollup
# (was part of group_min_max.test) # (was part of group_min_max.test)
# #
...@@ -255,7 +256,7 @@ select a, count(a) from t1 group by a with rollup; ...@@ -255,7 +256,7 @@ select a, count(a) from t1 group by a with rollup;
drop table t1; drop table t1;
# #
# Bug #13293 Wrongly used index results in endless loop. # Bug #13293 Wrongly used index results in endless loop.
# (was part of group_min_max.test) # (was part of group_min_max.test)
# #
create table t1 (f1 int, f2 char(1), primary key(f1,f2)); create table t1 (f1 int, f2 char(1), primary key(f1,f2));
...@@ -317,7 +318,7 @@ drop table t1,t2; ...@@ -317,7 +318,7 @@ drop table t1,t2;
# #
# Bug#17530: Incorrect key truncation on table creation caused server crash. # Bug#17530: Incorrect key truncation on table creation caused server crash.
# #
create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb create table t1(f1 varchar(800) binary not null, key(f1))
character set utf8 collate utf8_general_ci; character set utf8 collate utf8_general_ci;
insert into t1 values('aaa'); insert into t1 values('aaa');
drop table t1; drop table t1;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# # # #
# include/mix2.inc # # include/mix2.inc #
# # # #
# This is derivate of t/innodb.test and has to be maintained by MySQL # # This is a derivate of t/innodb.test and has to be maintained by MySQL #
# guys only. # # guys only. #
# # # #
# Please, DO NOT create a toplevel testcase mix2_innodb.test, because # # Please, DO NOT create a toplevel testcase mix2_innodb.test, because #
...@@ -11,10 +11,20 @@ ...@@ -11,10 +11,20 @@
# Variables which have to be set before calling this script: # # Variables which have to be set before calling this script: #
# $engine_type -- Storage engine to be tested # # $engine_type -- Storage engine to be tested #
# $other_engine_type -- storage engine <> $engine_type # # $other_engine_type -- storage engine <> $engine_type #
# 1. $other_engine_type should be an alltime # # $other_engine_type1 -- storage engine <> $engine_type #
# available storage engine like MyISAM or MEMORY # # storage engine <> $other_engine_type, if possible #
# 2. If $engine_type is transactional than # # $other_non_trans_engine_type -- storage engine <> $engine_type #
# $other_engine_type must be non transactional # # $other_non_trans_engine_type must be a non #
# transactional storage engine #
# $other_non_live_chks_engine_type #
# -- storage engine <> $engine_type, if possible #
# storage engine must not support live checksum #
# $other_live_chks_engine_type #
# -- storage engine <> $engine_type, if possible #
# storage engine must support live checksum #
# General Note: The $other_*_engine_type variables must point to all #
# time available storage engines #
# 2006-08 MySQL 5.1 MyISAM and MEMORY only #
# $test_transactions -- 0, skip transactional tests # # $test_transactions -- 0, skip transactional tests #
# -- 1, do not skip transactional tests # # -- 1, do not skip transactional tests #
# $test_foreign_keys -- 0, skip foreign key tests # # $test_foreign_keys -- 0, skip foreign key tests #
...@@ -25,7 +35,7 @@ ...@@ -25,7 +35,7 @@
# does not update the internal auto-increment value# # does not update the internal auto-increment value#
# -- 1, do not skip these tests # # -- 1, do not skip these tests #
# $no_spatial_key -- 0, skip tests where it is expected that keys on # # $no_spatial_key -- 0, skip tests where it is expected that keys on #
# are not allowed # # spatial data type are not allowed #
# -- 1, do not skip these tests # # -- 1, do not skip these tests #
# # # #
# The comments/expectations refer to InnoDB. # # The comments/expectations refer to InnoDB. #
...@@ -33,7 +43,7 @@ ...@@ -33,7 +43,7 @@
# # # #
# # # #
# Last update: # # Last update: #
# 2006-08-15 ML - introduce $other_engine_type variable # # 2006-08-15 ML - introduce several $variables #
# - correct some storage engine assignments # # - correct some storage engine assignments #
# - minor improvements like correct wrong table after analyze # # - minor improvements like correct wrong table after analyze #
# - let checksum testcase meet all table variants with/without # # - let checksum testcase meet all table variants with/without #
...@@ -87,7 +97,7 @@ update t1 set parent_id=parent_id+100; ...@@ -87,7 +97,7 @@ update t1 set parent_id=parent_id+100;
select * from t1 where parent_id=102; select * from t1 where parent_id=102;
update t1 set id=id+1000; update t1 set id=id+1000;
-- error 1062,1022 -- error 1062,1022
update t1 set id=1024 where id=1009; update t1 set id=1024 where id=1009;
select * from t1; select * from t1;
update ignore t1 set id=id+1; # This will change all rows update ignore t1 set id=id+1; # This will change all rows
select * from t1; select * from t1;
...@@ -245,7 +255,7 @@ drop table t1; ...@@ -245,7 +255,7 @@ drop table t1;
# #
# Simple not autocommit test # Simple not autocommit test
# #
eval CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=$engine_type; eval CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=$engine_type;
insert into t1 values ('pippo', 12); insert into t1 values ('pippo', 12);
...@@ -440,7 +450,7 @@ INSERT INTO t1 values (179,5,2); ...@@ -440,7 +450,7 @@ INSERT INTO t1 values (179,5,2);
update t1 set parent_id=parent_id+100; update t1 set parent_id=parent_id+100;
select * from t1 where parent_id=102; select * from t1 where parent_id=102;
update t1 set id=id+1000; update t1 set id=id+1000;
update t1 set id=1024 where id=1009; update t1 set id=1024 where id=1009;
select * from t1; select * from t1;
update ignore t1 set id=id+1; # This will change all rows update ignore t1 set id=id+1; # This will change all rows
select * from t1; select * from t1;
...@@ -528,7 +538,7 @@ eval CREATE TABLE t1 ( ...@@ -528,7 +538,7 @@ eval CREATE TABLE t1 (
b int1 unsigned NOT NULL, b int1 unsigned NOT NULL,
UNIQUE (a, b) UNIQUE (a, b)
) ENGINE = $engine_type; ) ENGINE = $engine_type;
INSERT INTO t1 VALUES (1, 1); INSERT INTO t1 VALUES (1, 1);
SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1; SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1;
drop table t1; drop table t1;
...@@ -630,15 +640,15 @@ drop table t1; ...@@ -630,15 +640,15 @@ drop table t1;
# #
# ML: Test logics # ML: Test logics
# Check that the creation of a table with engine = $engine_type does # Check that the creation of a table with engine = $engine_type does
# in a certain database does not prevent the the dropping of this # in a certain database (already containing some tables using other
# database. # storage engines) not prevent the dropping of this database.
create database mysqltest; create database mysqltest;
eval create table mysqltest.t1 (a int not null) engine= $engine_type; eval create table mysqltest.t1 (a int not null) engine= $engine_type;
insert into mysqltest.t1 values(1); insert into mysqltest.t1 values(1);
create table mysqltest.t2 (a int not null) engine= MyISAM; eval create table mysqltest.t2 (a int not null) engine= $other_engine_type;
insert into mysqltest.t2 values(1); insert into mysqltest.t2 values(1);
create table mysqltest.t3 (a int not null) engine= MEMORY; eval create table mysqltest.t3 (a int not null) engine= $other_engine_type1;
insert into mysqltest.t3 values(1); insert into mysqltest.t3 values(1);
commit; commit;
drop database mysqltest; drop database mysqltest;
...@@ -752,7 +762,7 @@ select * from t1; ...@@ -752,7 +762,7 @@ select * from t1;
select * from t2; select * from t2;
delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or (t1.carrier_id=90 and t2.number is null); delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or (t1.carrier_id=90 and t2.number is null);
select * from t1; select * from t1;
select * from t2; select * from t2;
select * from t2; select * from t2;
drop table t1,t2; drop table t1,t2;
...@@ -924,7 +934,7 @@ select * from t1; ...@@ -924,7 +934,7 @@ select * from t1;
select * from t2; select * from t2;
drop table t1,t2; drop table t1,t2;
eval CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=$other_engine_type; eval CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=$other_non_trans_engine_type;
eval CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=$engine_type; eval CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=$engine_type;
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
INSERT INTO t1 ( B_ID ) VALUES ( 1 ); INSERT INTO t1 ( B_ID ) VALUES ( 1 );
...@@ -1111,19 +1121,19 @@ eval CREATE TABLE t2 ( ...@@ -1111,19 +1121,19 @@ eval CREATE TABLE t2 (
INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9"); INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9");
SELECT t2.id, t1.`label` FROM t2 INNER JOIN SELECT t2.id, t1.`label` FROM t2 INNER JOIN
(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl (SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl
ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
drop table t1,t2; drop table t1,t2;
# Live checksum feature available + enabled # Live checksum feature available + enabled
create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=MyISAM; eval create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=$other_live_chks_engine_type;
# Live checksum feature available + disabled # Live checksum feature available + disabled
create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=MyISAM; eval create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=$other_live_chks_engine_type;
# #
# Live checksum feature not available + enabled # Live checksum feature not available + enabled
create table t3 (a int, b varchar(200), c varchar(200) not null) checksum=1 engine=MEMORY; eval create table t3 (a int, b varchar(200), c varchar(200) not null) checksum=1 engine=$other_non_live_chks_engine_type;
# Live checksum feature not available + disabled # Live checksum feature not available + disabled
create table t4 (a int, b varchar(200), c varchar(200) not null) checksum=0 engine=MEMORY; eval create table t4 (a int, b varchar(200), c varchar(200) not null) checksum=0 engine=$other_non_live_chks_engine_type;
# #
# Live checksum feature probably available + enabled # Live checksum feature probably available + enabled
eval create table t5 (a int, b varchar(200), c text not null) checksum=1 engine=$engine_type; eval create table t5 (a int, b varchar(200), c text not null) checksum=1 engine=$engine_type;
...@@ -1231,7 +1241,7 @@ drop table t2, t1; ...@@ -1231,7 +1241,7 @@ drop table t2, t1;
# #
# Let us test binlog_cache_use and binlog_cache_disk_use status vars. # Let us test binlog_cache_use and binlog_cache_disk_use status vars.
# Actually this test has nothing to do with innodb per se, it just requires # Actually this test has nothing to do with innodb per se, it just requires
# transactional table. # transactional table.
# #
flush status; flush status;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
...@@ -1239,7 +1249,7 @@ show status like "binlog_cache_disk_use"; ...@@ -1239,7 +1249,7 @@ show status like "binlog_cache_disk_use";
eval create table t1 (a int) engine=$engine_type; eval create table t1 (a int) engine=$engine_type;
# Now we are going to create transaction which is long enough so its # Now we are going to create transaction which is long enough so its
# transaction binlog will be flushed to disk... # transaction binlog will be flushed to disk...
let $1=2000; let $1=2000;
disable_query_log; disable_query_log;
...@@ -1297,7 +1307,7 @@ drop table t1; ...@@ -1297,7 +1307,7 @@ drop table t1;
if ($fulltext_query_unsupported) if ($fulltext_query_unsupported)
{ {
# #
# BUG#7709 test case - Boolean fulltext query against unsupported # BUG#7709 test case - Boolean fulltext query against unsupported
# engines does not fail # engines does not fail
# #
...@@ -1316,7 +1326,7 @@ if ($test_foreign_keys) ...@@ -1316,7 +1326,7 @@ if ($test_foreign_keys)
--disable_warnings --disable_warnings
eval CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=$engine_type DEFAULT CHARSET=latin1; eval CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=$engine_type DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t1 VALUES (1),(2),(3);
eval CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), eval CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=$engine_type DEFAULT CHARSET=latin1; CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=$engine_type DEFAULT CHARSET=latin1;
--enable_warnings --enable_warnings
INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
...@@ -2145,7 +2155,7 @@ drop table t1,t2; ...@@ -2145,7 +2155,7 @@ drop table t1,t2;
# tests for bug #14056 Column prefix index on UTF-8 primary key column causes 'Can't find record..' # tests for bug #14056 Column prefix index on UTF-8 primary key column causes 'Can't find record..'
eval create table t2 ( eval create table t2 (
a int, b char(10), filler char(10), primary key(a, b(2)) a int, b char(10), filler char(10), primary key(a, b(2))
) character set utf8 engine = $engine_type; ) character set utf8 engine = $engine_type;
insert into t2 values (1,'abcdefg','one'); insert into t2 values (1,'abcdefg','one');
...@@ -2154,7 +2164,7 @@ insert into t2 values (3, 'qrstuvw','three'); ...@@ -2154,7 +2164,7 @@ insert into t2 values (3, 'qrstuvw','three');
update t2 set a=5, filler='booo' where a=1; update t2 set a=5, filler='booo' where a=1;
drop table t2; drop table t2;
eval create table t2 ( eval create table t2 (
a int, b char(10), filler char(10), primary key(a, b(2)) a int, b char(10), filler char(10), primary key(a, b(2))
) character set ucs2 engine = $engine_type; ) character set ucs2 engine = $engine_type;
insert into t2 values (1,'abcdefg','one'); insert into t2 values (1,'abcdefg','one');
...@@ -2245,7 +2255,7 @@ insert into t4(a) values (5),(7),(8); ...@@ -2245,7 +2255,7 @@ insert into t4(a) values (5),(7),(8);
insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
delimiter |; delimiter |;
create trigger t1t before insert on t1 for each row begin create trigger t1t before insert on t1 for each row begin
INSERT INTO t2 SET a = NEW.a; INSERT INTO t2 SET a = NEW.a;
end | end |
...@@ -2253,7 +2263,7 @@ create trigger t2t before insert on t2 for each row begin ...@@ -2253,7 +2263,7 @@ create trigger t2t before insert on t2 for each row begin
DELETE FROM t3 WHERE a = NEW.a; DELETE FROM t3 WHERE a = NEW.a;
end | end |
create trigger t3t before delete on t3 for each row begin create trigger t3t before delete on t3 for each row begin
UPDATE t4 SET b = b + 1 WHERE a = OLD.a; UPDATE t4 SET b = b + 1 WHERE a = OLD.a;
end | end |
...@@ -2379,14 +2389,14 @@ connection a; ...@@ -2379,14 +2389,14 @@ connection a;
eval create table t1(a int not null, b int, primary key(a)) engine=$engine_type; eval create table t1(a int not null, b int, primary key(a)) engine=$engine_type;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit; commit;
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t1 set b = 5 where b = 1; update t1 set b = 5 where b = 1;
connection b; connection b;
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
# #
# X-lock to record (7,3) should be released in a update # X-lock to record (7,3) should be released in a update
# #
select * from t1 where a = 7 and b = 3 for update; select * from t1 where a = 7 and b = 3 for update;
connection a; connection a;
...@@ -2411,7 +2421,7 @@ connection a; ...@@ -2411,7 +2421,7 @@ connection a;
eval create table t1(a int not null, b int, primary key(a)) engine=$engine_type; eval create table t1(a int not null, b int, primary key(a)) engine=$engine_type;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2); insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);
commit; commit;
set autocommit = 0; set autocommit = 0;
select * from t1 lock in share mode; select * from t1 lock in share mode;
update t1 set b = 5 where b = 1; update t1 set b = 5 where b = 1;
connection b; connection b;
...@@ -2467,7 +2477,7 @@ disconnect b; ...@@ -2467,7 +2477,7 @@ disconnect b;
drop table t1, t2, t3; drop table t1, t2, t3;
# #
# Consistent read should not be used if # Consistent read should not be used if
# #
# (a) isolation level is serializable OR # (a) isolation level is serializable OR
# (b) select ... lock in share mode OR # (b) select ... lock in share mode OR
...@@ -2638,7 +2648,7 @@ eval CREATE TABLE t2 ( ...@@ -2638,7 +2648,7 @@ eval CREATE TABLE t2 (
c TEXT NOT NULL, c TEXT NOT NULL,
PRIMARY KEY (a,b), PRIMARY KEY (a,b),
KEY idx_t2_b_c (b,c(200)), KEY idx_t2_b_c (b,c(200)),
CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a) CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
ON DELETE CASCADE ON DELETE CASCADE
) ENGINE=$engine_type DEFAULT CHARSET=UTF8; ) ENGINE=$engine_type DEFAULT CHARSET=UTF8;
......
...@@ -3,9 +3,16 @@ ...@@ -3,9 +3,16 @@
# Test how filesort and buffered-record-reads works # Test how filesort and buffered-record-reads works
# This test needs a lot of time. # This test needs a lot of time.
# #
# The variable # The variables
# $engine_type -- storage engine to be tested # $engine_type -- storage engine to be tested
# has to be set before sourcing this script. # $other_engine_type -- storage engine <> $engine_type, if possible
# 1. $other_engine_type must allow to store many rows
# without using non standard server options
# (does not need a t/read_many_rows_*-master.opt file)
# 2. $other_engine_type must point to an all time
# available storage engine
# 2006-08 MySQL 5.1 MyISAM and MEMORY only
# have to be set before sourcing this script.
# #
# Last update: # Last update:
# 2006-08-03 ML test refactored (MySQL 5.1) # 2006-08-03 ML test refactored (MySQL 5.1)
...@@ -18,10 +25,10 @@ eval SET SESSION STORAGE_ENGINE = $engine_type; ...@@ -18,10 +25,10 @@ eval SET SESSION STORAGE_ENGINE = $engine_type;
DROP TABLE IF EXISTS t1, t2, t3, t4; DROP TABLE IF EXISTS t1, t2, t3, t4;
--enable_warnings --enable_warnings
CREATE TABLE t1 (id INTEGER) ENGINE=MYISAM; eval CREATE TABLE t1 (id INTEGER) ENGINE=$other_engine_type;
CREATE TABLE t2 (id INTEGER PRIMARY KEY); CREATE TABLE t2 (id INTEGER PRIMARY KEY);
CREATE TABLE t3 (a CHAR(32) PRIMARY KEY,id INTEGER); CREATE TABLE t3 (a CHAR(32) PRIMARY KEY,id INTEGER);
CREATE TABLE t4 (a CHAR(32) PRIMARY KEY,id INTEGER) ENGINE=MYISAM; eval CREATE TABLE t4 (a CHAR(32) PRIMARY KEY,id INTEGER) ENGINE=$other_engine_type;
INSERT INTO t1 (id) VALUES (1); INSERT INTO t1 (id) VALUES (1);
INSERT INTO t1 SELECT id+1 FROM t1; INSERT INTO t1 SELECT id+1 FROM t1;
......
# include/rowid_order.inc # include/rowid_order.inc
# #
# Test for rowid ordering (and comparison) functions. # Test for rowid ordering (and comparison) functions.
# do index_merge select for tables with PK of various types. # do index_merge select for tables with PK of various types.
# #
# The variable # The variable
# $engine_type -- storage engine to be tested # $engine_type -- storage engine to be tested
...@@ -22,8 +22,8 @@ eval SET SESSION STORAGE_ENGINE = $engine_type; ...@@ -22,8 +22,8 @@ eval SET SESSION STORAGE_ENGINE = $engine_type;
drop table if exists t1, t2, t3,t4; drop table if exists t1, t2, t3,t4;
--enable_warnings --enable_warnings
# Signed number as rowid # Signed number as rowid
create table t1 ( create table t1 (
pk1 int not NULL, pk1 int not NULL,
key1 int(11), key1 int(11),
key2 int(11), key2 int(11),
...@@ -40,8 +40,8 @@ explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3; ...@@ -40,8 +40,8 @@ explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3; select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1; drop table t1;
# Unsigned numbers as rowids # Unsigned numbers as rowids
create table t1 ( create table t1 (
pk1 int unsigned not NULL, pk1 int unsigned not NULL,
key1 int(11), key1 int(11),
key2 int(11), key2 int(11),
...@@ -58,7 +58,7 @@ select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3; ...@@ -58,7 +58,7 @@ select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1; drop table t1;
# Case-insensitive char(N) # Case-insensitive char(N)
create table t1 ( create table t1 (
pk1 char(4) not NULL, pk1 char(4) not NULL,
key1 int(11), key1 int(11),
key2 int(11), key2 int(11),
...@@ -84,7 +84,7 @@ create table t1 ( ...@@ -84,7 +84,7 @@ create table t1 (
KEY key1 (key1), KEY key1 (key1),
KEY key2 (key2) KEY key2 (key2)
); );
insert into t1 values insert into t1 values
(1, 'u', 'u', 1, 1), (1, 'u', 'u', 1, 1),
(1, 'u', char(0xEC), 1, 1), (1, 'u', char(0xEC), 1, 1),
(1, 'u', 'x', 1, 1); (1, 'u', 'x', 1, 1);
......
...@@ -168,7 +168,7 @@ insert into t1 values (17); ...@@ -168,7 +168,7 @@ insert into t1 values (17);
handler t2 read first; handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2; handler t1 open as t2;
alter table t1 engine=MyISAM; alter table t1 engine=MEMORY;
handler t2 read first; handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER ERROR 42S02: Unknown table 't2' in HANDLER
drop table t1; drop table t1;
...@@ -457,7 +457,7 @@ t1 ...@@ -457,7 +457,7 @@ t1
handler h1_3 read first limit 9; handler h1_3 read first limit 9;
c1 c1
t1 t1
alter table t1 engine=MyISAM; alter table t1 engine=InnoDB;
handler h1_1 read first limit 9; handler h1_1 read first limit 9;
ERROR 42S02: Unknown table 'h1_1' in HANDLER ERROR 42S02: Unknown table 'h1_1' in HANDLER
handler h1_2 read first limit 9; handler h1_2 read first limit 9;
......
...@@ -168,7 +168,7 @@ insert into t1 values (17); ...@@ -168,7 +168,7 @@ insert into t1 values (17);
handler t2 read first; handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2; handler t1 open as t2;
alter table t1 engine=MyISAM; alter table t1 engine=MEMORY;
handler t2 read first; handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER ERROR 42S02: Unknown table 't2' in HANDLER
drop table t1; drop table t1;
......
...@@ -12,7 +12,7 @@ org_id int(11) default null, ...@@ -12,7 +12,7 @@ org_id int(11) default null,
unique key contacts$c_id (c_id), unique key contacts$c_id (c_id),
key contacts$org_id (org_id) key contacts$org_id (org_id)
); );
insert into t1 values insert into t1 values
(2,null),(120,null),(141,null),(218,7), (128,1), (2,null),(120,null),(141,null),(218,7), (128,1),
(151,2),(234,2),(236,2),(243,2),(255,2),(259,2),(232,3),(235,3),(238,3), (151,2),(234,2),(236,2),(243,2),(255,2),(259,2),(232,3),(235,3),(238,3),
(246,3),(253,3),(269,3),(285,3),(291,3),(293,3),(131,4),(230,4),(231,4); (246,3),(253,3),(269,3),(285,3),(291,3),(293,3),(131,4),(230,4),(231,4);
...@@ -41,9 +41,9 @@ insert into t2(slai_id, owner_tbl, owner_id, sla_id) values ...@@ -41,9 +41,9 @@ insert into t2(slai_id, owner_tbl, owner_id, sla_id) values
flush tables; flush tables;
select si.slai_id select si.slai_id
from t1 c join t2 si on from t1 c join t2 si on
((si.owner_tbl = 3 and si.owner_id = c.org_id) or ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
( si.owner_tbl = 2 and si.owner_id = c.c_id)) ( si.owner_tbl = 2 and si.owner_id = c.c_id))
where where
c.c_id = 218 and expiredate is null; c.c_id = 218 and expiredate is null;
slai_id slai_id
12 12
...@@ -54,17 +54,17 @@ c_id org_id ...@@ -54,17 +54,17 @@ c_id org_id
141 NULL 141 NULL
select si.slai_id select si.slai_id
from t1 c join t2 si on from t1 c join t2 si on
((si.owner_tbl = 3 and si.owner_id = c.org_id) or ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
( si.owner_tbl = 2 and si.owner_id = c.c_id)) ( si.owner_tbl = 2 and si.owner_id = c.c_id))
where where
c.c_id = 218 and expiredate is null; c.c_id = 218 and expiredate is null;
slai_id slai_id
12 12
drop table t1, t2; drop table t1, t2;
CREATE TABLE t1 (a int, b int, KEY b (b)) Engine=InnoDB; CREATE TABLE t1 (a int, b int, KEY b (b));
CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b)) Engine=InnoDB; CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b));
CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY (a), CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY (a),
UNIQUE KEY b (b,c), KEY a (a,b,c)) Engine=InnoDB; UNIQUE KEY b (b,c), KEY a (a,b,c));
INSERT INTO t1 VALUES (1, 1); INSERT INTO t1 VALUES (1, 1);
INSERT INTO t1 SELECT a + 1, b + 1 FROM t1; INSERT INTO t1 SELECT a + 1, b + 1 FROM t1;
INSERT INTO t1 SELECT a + 2, b + 2 FROM t1; INSERT INTO t1 SELECT a + 2, b + 2 FROM t1;
...@@ -74,14 +74,14 @@ DELETE FROM t2 WHERE a = 1 AND b < 2; ...@@ -74,14 +74,14 @@ DELETE FROM t2 WHERE a = 1 AND b < 2;
INSERT INTO t3 VALUES (1,1,1),(2,1,2); INSERT INTO t3 VALUES (1,1,1),(2,1,2);
INSERT INTO t3 SELECT a + 2, a + 2, 3 FROM t3; INSERT INTO t3 SELECT a + 2, a + 2, 3 FROM t3;
INSERT INTO t3 SELECT a + 4, a + 4, 3 FROM t3; INSERT INTO t3 SELECT a + 4, a + 4, 3 FROM t3;
SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2) t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
ORDER BY t1.b LIMIT 2; ORDER BY t1.b LIMIT 2;
b a b a
1 1 1 1
2 2 2 2
SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2) t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
ORDER BY t1.b LIMIT 5; ORDER BY t1.b LIMIT 5;
b a b a
1 1 1 1
...@@ -307,7 +307,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ...@@ -307,7 +307,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2; SELECT * from t2;
a b a b
drop table t1,t2; drop table t1,t2;
create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb create table t1(f1 varchar(800) binary not null, key(f1))
character set utf8 collate utf8_general_ci; character set utf8 collate utf8_general_ci;
Warnings: Warnings:
Warning 1071 Specified key was too long; max key length is 765 bytes Warning 1071 Specified key was too long; max key length is 765 bytes
......
...@@ -764,7 +764,7 @@ drop table t1; ...@@ -764,7 +764,7 @@ drop table t1;
create database mysqltest; create database mysqltest;
create table mysqltest.t1 (a int not null) engine= MyISAM; create table mysqltest.t1 (a int not null) engine= MyISAM;
insert into mysqltest.t1 values(1); insert into mysqltest.t1 values(1);
create table mysqltest.t2 (a int not null) engine= MyISAM; create table mysqltest.t2 (a int not null) engine= MEMORY;
insert into mysqltest.t2 values(1); insert into mysqltest.t2 values(1);
create table mysqltest.t3 (a int not null) engine= MEMORY; create table mysqltest.t3 (a int not null) engine= MEMORY;
insert into mysqltest.t3 values(1); insert into mysqltest.t3 values(1);
...@@ -1208,7 +1208,7 @@ KEY `id_version` (`id_version`) ...@@ -1208,7 +1208,7 @@ KEY `id_version` (`id_version`)
) ENGINE=MyISAM; ) ENGINE=MyISAM;
INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9"); INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9");
SELECT t2.id, t1.`label` FROM t2 INNER JOIN SELECT t2.id, t1.`label` FROM t2 INNER JOIN
(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl (SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl
ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
id label id label
3382 Test 3382 Test
...@@ -2331,7 +2331,7 @@ hex(ind) hex(string1) ...@@ -2331,7 +2331,7 @@ hex(ind) hex(string1)
1 1
drop table t1,t2; drop table t1,t2;
create table t2 ( create table t2 (
a int, b char(10), filler char(10), primary key(a, b(2)) a int, b char(10), filler char(10), primary key(a, b(2))
) character set utf8 engine = MyISAM; ) character set utf8 engine = MyISAM;
insert into t2 values (1,'abcdefg','one'); insert into t2 values (1,'abcdefg','one');
insert into t2 values (2,'ijkilmn','two'); insert into t2 values (2,'ijkilmn','two');
...@@ -2339,7 +2339,7 @@ insert into t2 values (3, 'qrstuvw','three'); ...@@ -2339,7 +2339,7 @@ insert into t2 values (3, 'qrstuvw','three');
update t2 set a=5, filler='booo' where a=1; update t2 set a=5, filler='booo' where a=1;
drop table t2; drop table t2;
create table t2 ( create table t2 (
a int, b char(10), filler char(10), primary key(a, b(2)) a int, b char(10), filler char(10), primary key(a, b(2))
) character set ucs2 engine = MyISAM; ) character set ucs2 engine = MyISAM;
insert into t2 values (1,'abcdefg','one'); insert into t2 values (1,'abcdefg','one');
insert into t2 values (2,'ijkilmn','two'); insert into t2 values (2,'ijkilmn','two');
...@@ -2398,13 +2398,13 @@ insert into t4(a) values (1),(2),(3); ...@@ -2398,13 +2398,13 @@ insert into t4(a) values (1),(2),(3);
insert into t3(a) values (5),(7),(8); insert into t3(a) values (5),(7),(8);
insert into t4(a) values (5),(7),(8); insert into t4(a) values (5),(7),(8);
insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
create trigger t1t before insert on t1 for each row begin create trigger t1t before insert on t1 for each row begin
INSERT INTO t2 SET a = NEW.a; INSERT INTO t2 SET a = NEW.a;
end | end |
create trigger t2t before insert on t2 for each row begin create trigger t2t before insert on t2 for each row begin
DELETE FROM t3 WHERE a = NEW.a; DELETE FROM t3 WHERE a = NEW.a;
end | end |
create trigger t3t before delete on t3 for each row begin create trigger t3t before delete on t3 for each row begin
UPDATE t4 SET b = b + 1 WHERE a = OLD.a; UPDATE t4 SET b = b + 1 WHERE a = OLD.a;
end | end |
create trigger t4t before update on t4 for each row begin create trigger t4t before update on t4 for each row begin
......
SET SESSION STORAGE_ENGINE = InnoDB;
DROP TABLE IF EXISTS t1, t2, t3, t4; DROP TABLE IF EXISTS t1, t2, t3, t4;
CREATE TABLE t1 (id INTEGER) ENGINE=MYISAM; CREATE TABLE t1 (id INTEGER) ENGINE=MyISAM;
CREATE TABLE t2 (id INTEGER primary key) ENGINE=INNODB; CREATE TABLE t2 (id INTEGER PRIMARY KEY);
CREATE TABLE t3 (a char(32) primary key,id INTEGER) ENGINE=INNODB; CREATE TABLE t3 (a CHAR(32) PRIMARY KEY,id INTEGER);
CREATE TABLE t4 (a char(32) primary key,id INTEGER) ENGINE=MYISAM; CREATE TABLE t4 (a CHAR(32) PRIMARY KEY,id INTEGER) ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1); INSERT INTO t1 (id) VALUES (1);
INSERT INTO t1 SELECT id+1 FROM t1; INSERT INTO t1 SELECT id+1 FROM t1;
INSERT INTO t1 SELECT id+2 FROM t1; INSERT INTO t1 SELECT id+2 FROM t1;
...@@ -26,9 +27,9 @@ INSERT INTO t1 SELECT id+262144 FROM t1; ...@@ -26,9 +27,9 @@ INSERT INTO t1 SELECT id+262144 FROM t1;
INSERT INTO t1 SELECT id+524288 FROM t1; INSERT INTO t1 SELECT id+524288 FROM t1;
INSERT INTO t1 SELECT id+1048576 FROM t1; INSERT INTO t1 SELECT id+1048576 FROM t1;
INSERT INTO t2 SELECT * FROM t1; INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t3 SELECT concat(id),id from t2 ORDER BY -id; INSERT INTO t3 SELECT CONCAT(id),id FROM t2 ORDER BY -id;
INSERT INTO t4 SELECT * from t3 ORDER BY concat(a); INSERT INTO t4 SELECT * FROM t3 ORDER BY CONCAT(a);
select sum(id) from t3; SELECT SUM(id) FROM t3;
sum(id) SUM(id)
2199024304128 2199024304128
drop table t1,t2,t3,t4; DROP TABLE t1,t2,t3,t4;
SET SESSION STORAGE_ENGINE = InnoDB; SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1, t2, t3,t4; drop table if exists t1, t2, t3,t4;
create table t1 ( create table t1 (
pk1 int not NULL, pk1 int not NULL,
key1 int(11), key1 int(11),
key2 int(11), key2 int(11),
...@@ -24,7 +24,7 @@ pk1 key1 key2 ...@@ -24,7 +24,7 @@ pk1 key1 key2
3 1 1 3 1 1
10 1 1 10 1 1
drop table t1; drop table t1;
create table t1 ( create table t1 (
pk1 int unsigned not NULL, pk1 int unsigned not NULL,
key1 int(11), key1 int(11),
key2 int(11), key2 int(11),
...@@ -45,7 +45,7 @@ pk1 key1 key2 ...@@ -45,7 +45,7 @@ pk1 key1 key2
4294967294 1 1 4294967294 1 1
4294967295 1 1 4294967295 1 1
drop table t1; drop table t1;
create table t1 ( create table t1 (
pk1 char(4) not NULL, pk1 char(4) not NULL,
key1 int(11), key1 int(11),
key2 int(11), key2 int(11),
...@@ -74,7 +74,7 @@ PRIMARY KEY (pk1,pk2,pk3), ...@@ -74,7 +74,7 @@ PRIMARY KEY (pk1,pk2,pk3),
KEY key1 (key1), KEY key1 (key1),
KEY key2 (key2) KEY key2 (key2)
); );
insert into t1 values insert into t1 values
(1, 'u', 'u', 1, 1), (1, 'u', 'u', 1, 1),
(1, 'u', char(0xEC), 1, 1), (1, 'u', char(0xEC), 1, 1),
(1, 'u', 'x', 1, 1); (1, 'u', 'x', 1, 1);
......
...@@ -14,5 +14,7 @@ ...@@ -14,5 +14,7 @@
--source include/have_innodb.inc --source include/have_innodb.inc
let $engine_type= InnoDB; let $engine_type= InnoDB;
let $other_engine_type= MEMORY;
let $other_handler_engine_type= MyISAM;
--source include/handler.inc --source include/handler.inc
...@@ -13,5 +13,9 @@ ...@@ -13,5 +13,9 @@
--source include/not_embedded.inc --source include/not_embedded.inc
let $engine_type= MyISAM; let $engine_type= MyISAM;
let $other_engine_type= MEMORY;
# There is unfortunately no other all time available storage engine
# which supports the handler interface
let $other_handler_engine_type= MyISAM;
--source include/handler.inc --source include/handler.inc
...@@ -5,6 +5,13 @@ ...@@ -5,6 +5,13 @@
let $engine_type= MyISAM; let $engine_type= MyISAM;
let $other_engine_type= MEMORY; let $other_engine_type= MEMORY;
# There are unfortunately only MyISAM and MEMORY all time available
# Therefore use here MEMORY again.
let $other_engine_type1= MEMORY;
let $other_non_trans_engine_type= MEMORY;
let $other_non_live_chks_engine_type= MEMORY;
# Therefore use here MyISAM again.
let $other_live_chks_engine_type= MyISAM;
# MyISAM does not support transactions # MyISAM does not support transactions
let $test_transactions= 0; let $test_transactions= 0;
# MyISAM does not support FOREIGN KEYFOREIGN KEYs # MyISAM does not support FOREIGN KEYFOREIGN KEYs
......
...@@ -12,5 +12,6 @@ ...@@ -12,5 +12,6 @@
--source include/have_innodb.inc --source include/have_innodb.inc
let $engine_type= InnoDB; let $engine_type= InnoDB;
let $other_engine_type= MyISAM;
--source include/read_many_rows.inc --source include/read_many_rows.inc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment