Commit 27990803 authored by unknown's avatar unknown

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


mysql-test/include/handler.inc:
  - Replace hardcoded MyISAM with assignments via variable
mysql-test/include/mix1.inc:
  - Replace hardcoded MyISAM with assignments via variable
  - Remove hardcoded InnoDB assignments (They were introduced by late push)
  - Remove trailing spaces
mysql-test/include/mix2.inc:
  - Replace hardcode MyISAM assignments
  - Remove trailing spaces
  - Engine assignments via variable refers to the use of the storage engine
    $other_non_trans_engine_type, $other_live_chcks_engine_type ...
mysql-test/include/read_many_rows.inc:
  Replace hardcoded MyISAM assignment
mysql-test/include/rowid_order.inc:
  remove trailing spaces
mysql-test/r/handler_innodb.result:
  Updated result
mysql-test/r/handler_myisam.result:
  Updated result
mysql-test/r/innodb_mysql.result:
  Updated result
mysql-test/r/mix2_myisam.result:
  Updated result
mysql-test/r/read_many_rows_innodb.result:
  Updated result
mysql-test/r/rowid_order_innodb.result:
  Updated result
mysql-test/t/handler_innodb.test:
  Introduce $variables
mysql-test/t/handler_myisam.test:
  Introduce $variables
mysql-test/t/mix2_myisam.test:
  Introduce $variables
mysql-test/t/read_many_rows_innodb.test:
  Introduce $variables
parent 808237b0
# include/handler.inc
#
# The variable
# The variables
# $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 ...
#
......@@ -108,7 +114,7 @@ insert into t1 values (17);
--error 1109
handler t2 read first;
handler t1 open as t2;
alter table t1 engine=MyISAM;
eval alter table t1 engine=$other_engine_type;
--error 1109
handler t2 read first;
drop table t1;
......@@ -327,7 +333,7 @@ insert into t5 values ("t5");
handler t5 open as h5;
handler h5 read first limit 9;
# close first
alter table t1 engine=MyISAM;
eval alter table t1 engine=$other_handler_engine_type;
--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
......@@ -335,7 +341,7 @@ handler h3 read first limit 9;
handler h4 read first limit 9;
handler h5 read first limit 9;
# close last
alter table t5 engine=MyISAM;
eval alter table t5 engine=$other_handler_engine_type;
--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
......@@ -344,7 +350,7 @@ handler h4 read first limit 9;
--error 1109
handler h5 read first limit 9;
# close middle
alter table t3 engine=MyISAM;
eval alter table t3 engine=$other_handler_engine_type;
--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
......@@ -362,7 +368,7 @@ handler t1 open as h1_3;
handler h1_1 read first limit 9;
handler h1_2 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
handler h1_1 read first limit 9;
--error 1109
......
......@@ -3,8 +3,9 @@
# The variables
# $engine_type -- storage engine to be tested
# $other_engine_type -- storage engine <> $engine_type
# $other_engine_type should be an alltime
# available storage engine like MyISAM or MEMORY
# $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.
#
# Note: The comments/expectations refer to InnoDB.
......@@ -94,10 +95,10 @@ drop table t1, t2;
# Bug#17212: results not sorted correctly by ORDER BY when using index
# (repeatable only w/innodb because of index props)
#
CREATE TABLE t1 (a int, b int, KEY b (b)) Engine=InnoDB;
CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b)) Engine=InnoDB;
CREATE TABLE t1 (a int, b int, KEY b (b));
CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b));
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 SELECT a + 1, b + 1 FROM t1;
......@@ -317,7 +318,7 @@ drop table t1,t2;
#
# 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;
insert into t1 values('aaa');
drop table t1;
......@@ -2,7 +2,7 @@
# #
# 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. #
# #
# Please, DO NOT create a toplevel testcase mix2_innodb.test, because #
......@@ -11,10 +11,20 @@
# Variables which have to be set before calling this script: #
# $engine_type -- Storage engine to be tested #
# $other_engine_type -- storage engine <> $engine_type #
# 1. $other_engine_type should be an alltime #
# available storage engine like MyISAM or MEMORY #
# 2. If $engine_type is transactional than #
# $other_engine_type must be non transactional #
# $other_engine_type1 -- storage engine <> $engine_type #
# storage engine <> $other_engine_type, if possible #
# $other_non_trans_engine_type -- storage engine <> $engine_type #
# $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 #
# -- 1, do not skip transactional tests #
# $test_foreign_keys -- 0, skip foreign key tests #
......@@ -25,7 +35,7 @@
# does not update the internal auto-increment value#
# -- 1, do not skip these tests #
# $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 #
# #
# The comments/expectations refer to InnoDB. #
......@@ -33,7 +43,7 @@
# #
# #
# Last update: #
# 2006-08-15 ML - introduce $other_engine_type variable #
# 2006-08-15 ML - introduce several $variables #
# - correct some storage engine assignments #
# - minor improvements like correct wrong table after analyze #
# - let checksum testcase meet all table variants with/without #
......@@ -630,15 +640,15 @@ drop table t1;
#
# ML: Test logics
# Check that the creation of a table with engine = $engine_type does
# in a certain database does not prevent the the dropping of this
# database.
# in a certain database (already containing some tables using other
# storage engines) not prevent the dropping of this database.
create database mysqltest;
eval create table mysqltest.t1 (a int not null) engine= $engine_type;
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);
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);
commit;
drop database mysqltest;
......@@ -924,7 +934,7 @@ select * from t1;
select * from 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;
SET AUTOCOMMIT=0;
INSERT INTO t1 ( B_ID ) VALUES ( 1 );
......@@ -1116,14 +1126,14 @@ ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
drop table t1,t2;
# 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
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
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
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
eval create table t5 (a int, b varchar(200), c text not null) checksum=1 engine=$engine_type;
......
......@@ -3,9 +3,16 @@
# Test how filesort and buffered-record-reads works
# This test needs a lot of time.
#
# The variable
# The variables
# $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:
# 2006-08-03 ML test refactored (MySQL 5.1)
......@@ -18,10 +25,10 @@ eval SET SESSION STORAGE_ENGINE = $engine_type;
DROP TABLE IF EXISTS t1, t2, t3, t4;
--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 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 SELECT id+1 FROM t1;
......
......@@ -168,7 +168,7 @@ insert into t1 values (17);
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2;
alter table t1 engine=MyISAM;
alter table t1 engine=MEMORY;
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
drop table t1;
......@@ -457,7 +457,7 @@ t1
handler h1_3 read first limit 9;
c1
t1
alter table t1 engine=MyISAM;
alter table t1 engine=InnoDB;
handler h1_1 read first limit 9;
ERROR 42S02: Unknown table 'h1_1' in HANDLER
handler h1_2 read first limit 9;
......
......@@ -168,7 +168,7 @@ insert into t1 values (17);
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2;
alter table t1 engine=MyISAM;
alter table t1 engine=MEMORY;
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
drop table t1;
......
......@@ -61,10 +61,10 @@ c.c_id = 218 and expiredate is null;
slai_id
12
drop table t1, t2;
CREATE TABLE t1 (a int, b int, KEY b (b)) Engine=InnoDB;
CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b)) Engine=InnoDB;
CREATE TABLE t1 (a int, b int, KEY b (b));
CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b));
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 SELECT a + 1, b + 1 FROM t1;
INSERT INTO t1 SELECT a + 2, b + 2 FROM t1;
......@@ -307,7 +307,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
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;
Warnings:
Warning 1071 Specified key was too long; max key length is 765 bytes
......
......@@ -764,7 +764,7 @@ drop table t1;
create database mysqltest;
create table mysqltest.t1 (a int not null) engine= MyISAM;
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);
create table mysqltest.t3 (a int not null) engine= MEMORY;
insert into mysqltest.t3 values(1);
......
SET SESSION STORAGE_ENGINE = InnoDB;
DROP TABLE IF EXISTS t1, t2, t3, t4;
CREATE TABLE t1 (id INTEGER) ENGINE=MYISAM;
CREATE TABLE t2 (id INTEGER primary key) ENGINE=INNODB;
CREATE TABLE t3 (a char(32) primary key,id INTEGER) ENGINE=INNODB;
CREATE TABLE t4 (a char(32) primary key,id INTEGER) ENGINE=MYISAM;
CREATE TABLE t1 (id INTEGER) ENGINE=MyISAM;
CREATE TABLE t2 (id INTEGER PRIMARY KEY);
CREATE TABLE t3 (a CHAR(32) PRIMARY KEY,id INTEGER);
CREATE TABLE t4 (a CHAR(32) PRIMARY KEY,id INTEGER) ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1);
INSERT INTO t1 SELECT id+1 FROM t1;
INSERT INTO t1 SELECT id+2 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+1048576 FROM t1;
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t3 SELECT concat(id),id from t2 ORDER BY -id;
INSERT INTO t4 SELECT * from t3 ORDER BY concat(a);
select sum(id) from t3;
sum(id)
INSERT INTO t3 SELECT CONCAT(id),id FROM t2 ORDER BY -id;
INSERT INTO t4 SELECT * FROM t3 ORDER BY CONCAT(a);
SELECT SUM(id) FROM t3;
SUM(id)
2199024304128
drop table t1,t2,t3,t4;
DROP TABLE t1,t2,t3,t4;
......@@ -14,5 +14,7 @@
--source include/have_innodb.inc
let $engine_type= InnoDB;
let $other_engine_type= MEMORY;
let $other_handler_engine_type= MyISAM;
--source include/handler.inc
......@@ -13,5 +13,9 @@
--source include/not_embedded.inc
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
......@@ -5,6 +5,13 @@
let $engine_type= MyISAM;
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
let $test_transactions= 0;
# MyISAM does not support FOREIGN KEYFOREIGN KEYs
......
......@@ -12,5 +12,6 @@
--source include/have_innodb.inc
let $engine_type= InnoDB;
let $other_engine_type= MyISAM;
--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