summaryrefslogtreecommitdiff
path: root/mysql-test/t/handler.test
diff options
context:
space:
mode:
authorunknown <mleich@three.local.lan>2006-08-16 14:58:49 +0200
committerunknown <mleich@three.local.lan>2006-08-16 14:58:49 +0200
commit808237b083fe36ea393b7e05e1f6c78d8213c106 (patch)
tree81f556e3b022838904a67ae5a3d1a96a1e3d439b /mysql-test/t/handler.test
parent829d70d09c1d092f6c507825b75fe45424f0d86a (diff)
downloadmariadb-git-808237b083fe36ea393b7e05e1f6c78d8213c106.tar.gz
This changeset belongs to
WL#3397 Refactoring storage engine test cases (for falcon) It contains also fixes according to code review. Contents: Testcases which were in history dedicated to InnoDB or MyISAM only. Modifications: 1. Shift the main testing code into include/<testing field>.inc Introduce $variables which can be used to omit tests for features which are not supported by certain storage engines. 2. The storage engine to be tested is assigned within the toplevel script (t/<whatever>_<engine>.test) via variable $engine_type and the the main testing code is sourced from include/<testing field>.inc 3. Some toplevel testscripts have to be renamed to - avoid immediate or future namespace clashes - show via filename which storage engine is tested 4. Minor code cleanup like remove trailing spaces, some additional comments .... mysql-test/t/unsafe_binlog_innodb-master.opt: Rename: mysql-test/t/innodb_unsafe_binlog-master.opt -> mysql-test/t/unsafe_binlog_innodb-master.opt mysql-test/r/read_many_rows_innodb.result: Rename: mysql-test/r/innodb-big.result -> mysql-test/r/read_many_rows_innodb.result mysql-test/t/cache_innodb-master.opt: Rename: mysql-test/t/innodb_cache-master.opt -> mysql-test/t/cache_innodb-master.opt mysql-test/t/concurrent_innodb-master.opt: Rename: mysql-test/t/innodb_concurrent-master.opt -> mysql-test/t/concurrent_innodb-master.opt BitKeeper/deleted/.del-index_merge.result: Delete: mysql-test/r/index_merge.result BitKeeper/deleted/.del-index_merge_innodb.result: Delete: mysql-test/r/index_merge_innodb.result BitKeeper/deleted/.del-index_merge_innodb2.result: Delete: mysql-test/r/index_merge_innodb2.result BitKeeper/deleted/.del-index_merge_ror.result: Delete: mysql-test/r/index_merge_ror.result BitKeeper/deleted/.del-index_merge_ror_cpk.result: Delete: mysql-test/r/index_merge_ror_cpk.result mysql-test/r/index_merge_innodb.result: BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/r/index_merge_innodb.result mysql-test/t/index_merge_innodb.test: BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/t/index_merge_innodb.test mysql-test/t/index_merge_myisam.test: BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/t/index_merge_myisam.test mysql-test/include/concurrent.inc: 1. This file contains now the main testing code of the former t/innodb_concurrent.test. 2. It is now sourced by t/concurrent_innodb.test. mysql-test/include/deadlock.inc: 1. This file contains now the main testing code of the former t/innodb-deadlock.test 2. It is now sourced by t/deadlock_innodb.test. mysql-test/include/handler.inc: 1. This file contains now the main testing code of the former t/innodb_handler.test + t/handler.test. 2. It is now sourced by t/handler_myisam.test and t/handler_innodb.test. mysql-test/include/index_merge1.inc: 1. This file contains now the main testing code of the former t/index_merge.test. 2. It is now sourced by t/index_merge_myisam.test. mysql-test/include/index_merge2.inc: 1. This file contains now the main code of t/index_merge_innodb.test. 2. It is sourced by t/index_merge_myisam.test and t/index_merge_innodb.test. mysql-test/include/index_merge_2sweeps.inc: 1. This file contains now the main code of the former t/index_merge_innodb2.test. 2. It is sourced by t/index_merge_myisam.test and t/index_merge_innodb.test. mysql-test/include/index_merge_ror.inc: 1. This file contains now the main code of the former t/index_merge_ror.test. 2. It is sourced by t/index_merge_myisam.test. mysql-test/include/index_merge_ror_cpk.inc: 1. This file contains now the main testing code of the former t/index_merge_ror_cpk.test. 2. It is now sourced by t/index_merge_myisam.test and t/index_merge_innodb.test. mysql-test/include/mix1.inc: 1. This file contains now the main testing code of the t/innodb_mysql.test 2. The name mix1.inc was used because the test contains subtests for different fields. 3. It is sourced by t/innodb_mysql.test. 4. Fixes: - Assign $other_engine_type instead of hardcoded MyISAM. - improve comment - remove redundant subtest - analyze table t4 instead of wrong table t1 - remove not needed "eval set storage_engine = $engine_type;" mysql-test/include/mix2.inc: 1. This file is a copy of the main testing code of the t/innodb.test A copy has to be used, because t/innodb.test is to be maintained by INNOBASE only. 2. The name mix2.inc was used because the test contains subtests for different fields. 3. It is sourced by t/mix2_myisam.test. 4. Fixes: - improved comment - additional "eval SET SESSION STORAGE_ENGINE = $other_engine_type;" at beginning of tests - assign $other_engine_type instead of hardcoded MyISAM or HEAP - assign $other_engine_type where it is needed to preserve test logics - correct logical bugs - improve(extend) "checksum table" test mysql-test/include/query_cache.inc: 1. This file contains now the main testing code of the former t/innodb_cache.test. 2. It is now sourced by t/cache_innodb.test mysql-test/include/read_many_rows.inc: 1. This file contains now the main testing code of the former t/innodb_big.test. 2. It is now sourced by t/read_many_rows_innodb.test. mysql-test/include/rowid_order.inc: 1. This file contains now the main testing code of t/rowid_order_innodb.test. 2. It is now sourced by t/rowid_order_innodb.test. mysql-test/include/unsafe_binlog.inc: 1. This file contains now the main testing code of the former t/innodb_unsafe_binlog.test. 2. It is now sourced by t/unsafe_binlog_innodb.test. mysql-test/r/cache_innodb.result: Updated result mysql-test/r/concurrent_innodb.result: Updated result mysql-test/r/deadlock_innodb.result: Updated result mysql-test/r/handler_innodb.result: Updated result mysql-test/r/handler_myisam.result: Updated result mysql-test/r/index_merge_myisam.result: Updated result mysql-test/r/innodb_mysql.result: Updated result mysql-test/r/mix2_myisam.result: Updated result mysql-test/r/rowid_order_innodb.result: Updated result mysql-test/r/unsafe_binlog_innodb.result: Updated result mysql-test/t/cache_innodb.test: 1. Renaming of t/innodb_cache.test to t/cache_innodb.test 2. Main code is now sourced from include/query_cache.inc. mysql-test/t/concurrent_innodb.test: 1. Renaming of t/innodb_concurrent.test to t/concurrent_innodb.test 2. Main code is now sourced from include/concurrent.inc. Attention: This test fails even in the old version. (BUG#21579). --> added to t/disabled.def mysql-test/t/deadlock_innodb.test: 1. Renaming of t/innodb_deadlock.test to t/deadlock_innodb.test 2. Main code is now sourced from include/deadlock.inc. mysql-test/t/disabled.def: Add the test concurrent_innodb because of BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences mysql-test/t/handler_innodb.test: 1. Renaming of t/innodb_handler.test to t/handler_innodb.test 2. Main code is now sourced from include/handler.inc. include/handler.inc = united code of former t/handler.test and t/innodb_handler.test mysql-test/t/handler_myisam.test: 1. Renaming of t/handler.test to t/handler_myisam.test 2. Main code is now sourced from include/handler.inc. include/handler.inc = united code of former t/handler.test and t/handler_innodb.test. mysql-test/t/innodb_mysql.test: 1. Main code is now sourced from include/mix1.inc. 2. Test was not renamed because t/innodb.test refers to it. mysql-test/t/mix2_myisam.test: New test: MyISAM variant of mix2 ( = t/innodb.test) mysql-test/t/read_many_rows_innodb.test: 1. Renaming of t/innodb_big.test to t/read_many_rows_innodb.test 2. Main code is now sourced from include/read_many_rows.inc. mysql-test/t/rowid_order_innodb.test: Main code is now sourced from t/rowid_order.inc. mysql-test/t/unsafe_binlog_innodb.test: 1. Renaming of t/innodb_unsafe_binlog.test to t/unsafe_binlog_innodb.test 2. Main code is now sourced from include/unsafe_binlog.inc.
Diffstat (limited to 'mysql-test/t/handler.test')
-rw-r--r--mysql-test/t/handler.test428
1 files changed, 0 insertions, 428 deletions
diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test
deleted file mode 100644
index a7f1eeaa2cc..00000000000
--- a/mysql-test/t/handler.test
+++ /dev/null
@@ -1,428 +0,0 @@
-#
-# test of HANDLER ...
-#
-
-# should work in embedded server after mysqltest is fixed
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1,t3,t4,t5;
---enable_warnings
-
-create table t1 (a int, b char(10), key a(a), key b(a,b));
-insert into t1 values
-(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
-(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
-(20,"ggg"),(21,"hhh"),(22,"iii");
-handler t1 open as t2;
--- error 1064
-handler t2 read a=(SELECT 1);
-handler t2 read a first;
-handler t2 read a next;
-handler t2 read a next;
-handler t2 read a prev;
-handler t2 read a last;
-handler t2 read a prev;
-handler t2 read a prev;
-
-handler t2 read a first;
-handler t2 read a prev;
-
-handler t2 read a last;
-handler t2 read a prev;
-handler t2 read a next;
-handler t2 read a next;
-
-handler t2 read a=(15);
-handler t2 read a=(16);
-
---error 1070
-handler t2 read a=(19,"fff");
-
-handler t2 read b=(19,"fff");
-handler t2 read b=(19,"yyy");
-handler t2 read b=(19);
-
---error 1109
-handler t1 read a last;
-
-handler t2 read a=(11);
-handler t2 read a>=(11);
-
-handler t2 read a=(18);
-handler t2 read a>=(18);
-handler t2 read a>(18);
-handler t2 read a<=(18);
-handler t2 read a<(18);
-
-handler t2 read a first limit 5;
-handler t2 read a next limit 3;
-handler t2 read a prev limit 10;
-
-handler t2 read a>=(16) limit 4;
-handler t2 read a>=(16) limit 2,2;
-handler t2 read a last limit 3;
-
-handler t2 read a=(19);
-handler t2 read a=(19) where b="yyy";
-
-handler t2 read first;
-handler t2 read next;
-handler t2 read next;
---error 1064
-handler t2 read last;
-handler t2 close;
-
-#
-# DROP TABLE / ALTER TABLE
-#
-handler t1 open as t2;
-drop table t1;
-create table t1 (a int);
-insert into t1 values (17);
---error 1109
-handler t2 read first;
-handler t1 open as t2;
-alter table t1 engine=MyISAM;
---error 1109
-handler t2 read first;
-drop table t1;
-
-#
-# Test case for the bug #787
-#
-create table t1 (a int);
-insert into t1 values (1),(2),(3),(4),(5),(6);
-delete from t1 limit 2;
-handler t1 open;
-handler t1 read first;
-handler t1 read first limit 1,1;
-handler t1 read first limit 2,2;
-delete from t1 limit 3;
-handler t1 read first;
-drop table t1;
-
-#
-# Test for #751
-#
-create table t1(a int, index(a));
-insert into t1 values (1), (2), (3);
-handler t1 open;
---error 1054
-handler t1 read a=(W);
---error 1210
-handler t1 read a=(a);
-drop table t1;
-#
-# BUG#2304
-#
-create table t1 (a char(5));
-insert into t1 values ("Ok");
-handler t1 open as t;
-handler t read first;
-use mysql;
-handler t read first;
-handler t close;
-handler test.t1 open as t;
-handler t read first;
-handler t close;
-use test;
-drop table t1;
-
-#
-# BUG#3649
-#
-create table t1 ( a int, b int, INDEX a (a) );
-insert into t1 values (1,2), (2,1);
-handler t1 open;
-handler t1 read a=(1) where b=2;
-handler t1 read a=(1) where b=3;
-handler t1 read a=(1) where b=1;
-handler t1 close;
-drop table t1;
-
-#
-# Check if two database names beginning the same are seen as different.
-#
-# This database begins like the usual 'test' database.
-#
---disable_warnings
-drop database if exists test_test;
---enable_warnings
-create database test_test;
-use test_test;
-create table t1(table_id char(20) primary key);
-insert into t1 values ('test_test.t1');
-insert into t1 values ('');
-handler t1 open;
-handler t1 read first limit 9;
-create table t2(table_id char(20) primary key);
-insert into t2 values ('test_test.t2');
-insert into t2 values ('');
-handler t2 open;
-handler t2 read first limit 9;
-#
-# This is the usual 'test' database.
-#
-use test;
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1(table_id char(20) primary key);
-insert into t1 values ('test.t1');
-insert into t1 values ('');
---error 1066
-handler t1 open;
-#
-# Check accesibility of all the tables.
-#
-use test;
---error 1064
-handler test.t1 read first limit 9;
---error 1064
-handler test_test.t1 read first limit 9;
-handler t1 read first limit 9;
---error 1064
-handler test_test.t2 read first limit 9;
-handler t2 read first limit 9;
-
-#
-# Cleanup.
-#
-
---error 1064
-handler test_test.t1 close;
-handler t1 close;
-drop table test_test.t1;
---error 1064
-handler test_test.t2 close;
-handler t2 close;
-drop table test_test.t2;
-drop database test_test;
-
-#
-use test;
---error 1064
-handler test.t1 close;
---error 1109
-handler t1 close;
-drop table test.t1;
-
-#
-# BUG#4335
-#
---disable_warnings
-drop database if exists test_test;
-drop table if exists t1;
-drop table if exists t2;
-drop table if exists t3;
---enable_warnings
-create database test_test;
-use test_test;
-create table t1 (c1 char(20));
-insert into t1 values ('test_test.t1');
-create table t3 (c1 char(20));
-insert into t3 values ('test_test.t3');
-handler t1 open;
-handler t1 read first limit 9;
-handler t1 open h1;
-handler h1 read first limit 9;
-use test;
-create table t1 (c1 char(20));
-create table t2 (c1 char(20));
-create table t3 (c1 char(20));
-insert into t1 values ('t1');
-insert into t2 values ('t2');
-insert into t3 values ('t3');
---error 1066
-handler t1 open;
---error 1066
-handler t2 open t1;
---error 1066
-handler t3 open t1;
-handler t1 read first limit 9;
---error 1064
-handler test.t1 close;
---error 1066
-handler test.t1 open h1;
---error 1066
-handler test_test.t1 open h1;
-handler test_test.t3 open h3;
-handler test.t1 open h2;
-handler t1 read first limit 9;
-handler h1 read first limit 9;
-handler h2 read first limit 9;
-handler h3 read first limit 9;
-handler h2 read first limit 9;
---error 1064
-handler test.h1 close;
-handler t1 close;
-handler h1 close;
-handler h2 close;
---error 1109
-handler t1 read first limit 9;
---error 1109
-handler h1 read first limit 9;
---error 1109
-handler h2 read first limit 9;
-handler h3 read first limit 9;
-handler h3 read first limit 9;
-use test_test;
-handler h3 read first limit 9;
---error 1064
-handler test.h3 read first limit 9;
-handler h3 close;
-use test;
-drop table t3;
-drop table t2;
-drop table t1;
-drop database test_test;
-
-#
-# Test if fix for BUG#4286 correctly closes handler tables.
-#
-create table t1 (c1 char(20));
-insert into t1 values ("t1");
-handler t1 open as h1;
-handler h1 read first limit 9;
-create table t2 (c1 char(20));
-insert into t2 values ("t2");
-handler t2 open as h2;
-handler h2 read first limit 9;
-create table t3 (c1 char(20));
-insert into t3 values ("t3");
-handler t3 open as h3;
-handler h3 read first limit 9;
-create table t4 (c1 char(20));
-insert into t4 values ("t4");
-handler t4 open as h4;
-handler h4 read first limit 9;
-create table t5 (c1 char(20));
-insert into t5 values ("t5");
-handler t5 open as h5;
-handler h5 read first limit 9;
-# close first
-alter table t1 engine=MyISAM;
---error 1109
-handler h1 read first limit 9;
-handler h2 read first limit 9;
-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;
---error 1109
-handler h1 read first limit 9;
-handler h2 read first limit 9;
-handler h3 read first limit 9;
-handler h4 read first limit 9;
---error 1109
-handler h5 read first limit 9;
-# close middle
-alter table t3 engine=MyISAM;
---error 1109
-handler h1 read first limit 9;
-handler h2 read first limit 9;
---error 1109
-handler h3 read first limit 9;
-handler h4 read first limit 9;
---error 1109
-handler h5 read first limit 9;
-handler h2 close;
-handler h4 close;
-# close all depending handler tables
-handler t1 open as h1_1;
-handler t1 open as h1_2;
-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;
---error 1109
-handler h1_1 read first limit 9;
---error 1109
-handler h1_2 read first limit 9;
---error 1109
-handler h1_3 read first limit 9;
-drop table t1;
-drop table t2;
-drop table t3;
-drop table t4;
-drop table t5;
-
-#
-# Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
-#
-create table t1 (c1 int);
-insert into t1 values (1);
-# client 1
-handler t1 open;
-handler t1 read first;
-# client 2
-connect (con2,localhost,root,,);
-connection con2;
---exec echo send the below to another connection, do not wait for the result
-send optimize table t1;
---sleep 1
-# client 1
---exec echo proceed with the normal connection
-connection default;
-handler t1 read next;
-handler t1 close;
-# client 2
---exec echo read the result from the other connection
-connection con2;
-reap;
-# client 1
---exec echo proceed with the normal connection
-connection default;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Addendum to Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
-# Show that DROP TABLE can no longer deadlock against
-# FLUSH TABLES WITH READ LOCK. This is a 5.0 issue.
-#
-create table t1 (c1 int);
-insert into t1 values (14397);
-flush tables with read lock;
-# The thread with the global read lock cannot drop the table itself:
---error 1223
-drop table t1;
-#
-# client 2
-# We need a second connection to try the drop.
-# The drop waits for the global read lock to go away.
-# Without the addendum fix it locked LOCK_open before entering the wait loop.
-connection con2;
---exec echo send the below to another connection, do not wait for the result
-send drop table t1;
---sleep 1
-#
-# client 1
-# Now we need something that wants LOCK_open. A simple table access which
-# opens the table does the trick.
---exec echo proceed with the normal connection
-connection default;
-# This would hang on LOCK_open without the 5.0 addendum fix.
-select * from t1;
-# Release the read lock. This should make the DROP go through.
-unlock tables;
-#
-# client 2
-# Read the result of the drop command.
-connection con2;
---exec echo read the result from the other connection
-reap;
-#
-# client 1
-# Now back to normal operation. The table should not exist any more.
---exec echo proceed with the normal connection
-connection default;
---error 1146
-select * from t1;
-# Just to be sure and not confuse the next test case writer.
-drop table if exists t1;
-