Commit 808237b0 authored by unknown's avatar unknown

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.
parent 829d70d0
# include/concurrent.inc
# #
# Concurrent InnoDB tests, mainly in UPDATE's # Concurrent tests for transactional storage engines, mainly in UPDATE's
# Bug#3300 # Bug#3300
# Designed and tested by Sinisa Milivojevic, sinisa@mysql.com # Designed and tested by Sinisa Milivojevic, sinisa@mysql.com
# #
# two non-interfering UPDATE's not changing result set # two non-interfering UPDATE's not changing result set
# #
# The variable
# test takes circa 5 minutes to run, so it's big # $engine_type -- storage engine to be tested
-- source include/big_test.inc # has to be set before sourcing this script.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was t/innodb_concurrent.test
# main code went into include/concurrent.inc
#
connection default; connection default;
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings
drop table if exists t1; drop table if exists t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; --enable_warnings
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
connect (thread1, localhost, mysqltest,,); connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
eval SET SESSION STORAGE_ENGINE = $engine_type;
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -57,7 +68,7 @@ drop table t1; ...@@ -57,7 +68,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -103,7 +114,7 @@ drop table t1; ...@@ -103,7 +114,7 @@ drop table t1;
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1 (a int not null, b int not null) engine=innodb; create table t1 (a int not null, b int not null);
insert into t1 values (1,1),(2,1),(3,1),(4,1); insert into t1 values (1,1),(2,1),(3,1),(4,1);
select get_lock("hello2",1000); select get_lock("hello2",1000);
#connect (thread2, localhost, mysqltest,,); #connect (thread2, localhost, mysqltest,,);
...@@ -132,7 +143,7 @@ drop table t1; ...@@ -132,7 +143,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -175,7 +186,7 @@ drop table t1; ...@@ -175,7 +186,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -218,7 +229,7 @@ drop table t1; ...@@ -218,7 +229,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -261,7 +272,7 @@ drop table t1; ...@@ -261,7 +272,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -305,7 +316,7 @@ drop table t1; ...@@ -305,7 +316,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......
-- source include/have_innodb.inc # include/deadlock.inc
# Can't test this with embedded server #
-- source include/not_embedded.inc # The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Last update:
# 2006-07-26 ML refactoring + print when connection is switched
# old name was t/innodb-deadlock.test
# main code went into include/deadlock.inc
#
--echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,); connect (con1,localhost,root,,);
--echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,); connect (con2,localhost,root,,);
--disable_warnings --disable_warnings
...@@ -13,29 +23,34 @@ drop table if exists t1,t2; ...@@ -13,29 +23,34 @@ drop table if exists t1,t2;
# Testing of FOR UPDATE # Testing of FOR UPDATE
# #
--echo # Switch to connection con1
connection con1; connection con1;
create table t1 (id integer, x integer) engine=INNODB; eval create table t1 (id integer, x integer) engine = $engine_type;
insert into t1 values(0, 0); insert into t1 values(0, 0);
set autocommit=0; set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE; SELECT * from t1 where id = 0 FOR UPDATE;
--echo # Switch to connection con2
connection con2; connection con2;
set autocommit=0; set autocommit=0;
# The following query should hang because con1 is locking the page # The following query should hang because con1 is locking the record
--send --send
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
--sleep 2 --sleep 2
--echo # Switch to connection con1
connection con1; connection con1;
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;
select * from t1; select * from t1;
commit; commit;
--echo # Switch to connection con2
connection con2; connection con2;
reap; reap;
commit; commit;
--echo # Switch to connection con1
connection con1; connection con1;
select * from t1; select * from t1;
commit; commit;
...@@ -45,9 +60,10 @@ drop table t1; ...@@ -45,9 +60,10 @@ drop table t1;
# Testing of FOR UPDATE # Testing of FOR UPDATE
# #
--echo # Switch to connection con1
connection con1; connection con1;
create table t1 (id integer, x integer) engine=INNODB; eval create table t1 (id integer, x integer) engine = $engine_type;
create table t2 (b integer, a integer) engine=INNODB; eval create table t2 (b integer, a integer) engine = $engine_type;
insert into t1 values(0, 0), (300, 300); insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 10), (1, 20), (2, 30); insert into t2 values(0, 10), (1, 20), (2, 30);
commit; commit;
...@@ -57,61 +73,75 @@ update t2 set a=100 where b=(SELECT x from t1 where id = b FOR UPDATE); ...@@ -57,61 +73,75 @@ update t2 set a=100 where b=(SELECT x from t1 where id = b FOR UPDATE);
select * from t2; select * from t2;
select * from t1; select * from t1;
--echo # Switch to connection con2
connection con2; connection con2;
set autocommit=0; set autocommit=0;
# The following query should hang because con1 is locking the page # The following query should hang because con1 is locking the record
--send --send
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
--sleep 2 --sleep 2
--echo # Switch to connection con1
connection con1; connection con1;
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;
select * from t1; select * from t1;
commit; commit;
--echo # Switch to connection con2
connection con2; connection con2;
reap; reap;
commit; commit;
--echo # Switch to connection con1
connection con1; connection con1;
select * from t1; select * from t1;
commit; commit;
drop table t1, t2; drop table t1, t2;
create table t1 (id integer, x integer) engine=INNODB; eval create table t1 (id integer, x integer) engine = $engine_type;
create table t2 (b integer, a integer) engine=INNODB; eval create table t2 (b integer, a integer) engine = $engine_type;
insert into t1 values(0, 0), (300, 300); insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 0), (1, 20), (2, 30); insert into t2 values(0, 0), (1, 20), (2, 30);
commit; commit;
--echo # Switch to connection con1
connection con1; connection con1;
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE; select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
select * from t2; select * from t2;
select * from t1; select * from t1;
--echo # Switch to connection con2
connection con2; connection con2;
# The following query should hang because con1 is locking the page # The following query should hang because con1 is locking the record
update t2 set a=2 where b = 0; update t2 set a=2 where b = 0;
select * from t2; select * from t2;
--send --send
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
--sleep 2 --sleep 2
--echo # Switch to connection con1
connection con1; connection con1;
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;
select * from t1; select * from t1;
commit; commit;
--echo # Switch to connection con2
connection con2; connection con2;
reap; reap;
commit; commit;
--echo # Switch to connection con1
connection con1; connection con1;
select * from t1; select * from t1;
commit; commit;
# Cleanup
--echo # Switch to connection default + disconnect con1 and con2
connection default;
disconnect con1;
disconnect con2;
drop table t1, t2; drop table t1, t2;
# End of 4.1 tests # End of 4.1 tests
# include/handler.inc
#
# The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
# #
# test of HANDLER ... # test of HANDLER ...
# #
# Last update:
# 2006-07-31 ML test refactored (MySQL 5.1)
# code of t/handler.test and t/innodb_handler.test united
# main testing code put into include/handler.inc
#
# should work in embedded server after mysqltest is fixed eval SET SESSION STORAGE_ENGINE = $engine_type;
-- source include/not_embedded.inc
--disable_warnings --disable_warnings
drop table if exists t1,t3,t4,t5; drop table if exists t1,t3,t4,t5;
...@@ -73,6 +82,22 @@ handler t2 read next; ...@@ -73,6 +82,22 @@ handler t2 read next;
handler t2 read last; handler t2 read last;
handler t2 close; handler t2 close;
handler t1 open;
handler t1 read a next; # this used to crash as a bug#5373
handler t1 read a next;
handler t1 close;
handler t1 open;
handler t1 read a prev; # this used to crash as a bug#5373
handler t1 read a prev;
handler t1 close;
handler t1 open as t2;
handler t2 read first;
eval alter table t1 engine = $engine_type;
--error 1109
handler t2 read first;
# #
# DROP TABLE / ALTER TABLE # DROP TABLE / ALTER TABLE
# #
...@@ -378,6 +403,13 @@ reap; ...@@ -378,6 +403,13 @@ reap;
connection default; connection default;
drop table t1; drop table t1;
CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY (no1,no2));
INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
HANDLER t1 OPEN;
HANDLER t1 READ `primary` = (1, 1000);
HANDLER t1 READ `primary` PREV;
DROP TABLE t1;
# End of 4.1 tests # End of 4.1 tests
# #
......
# include/index_merge1.inc
# #
# Index merge tests # Index merge tests
# #
# The variables
# $engine_type -- storage engine to be tested
# $merge_table_support -- 1 storage engine supports merge tables
# -- 0 storage engine does not support merge tables
# have to be set before sourcing this script.
#
# Note: The comments/expectations refer to MyISAM.
# They might be not valid for other storage engines.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was t/index_merge.test
# main code went into include/index_merge1.inc
#
--echo #---------------- Index merge test 1 -------------------------------------------
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings --disable_warnings
drop table if exists t0, t1, t2, t3, t4; drop table if exists t0, t1, t2, t3, t4;
--enable_warnings --enable_warnings
...@@ -48,6 +68,7 @@ explain select * from t0 where key1 < 3 or key2 <4; ...@@ -48,6 +68,7 @@ explain select * from t0 where key1 < 3 or key2 <4;
explain explain
select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40); select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40);
# Bug#21277: InnoDB, wrong result set, index_merge strategy, second index not evaluated
select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40); select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40);
# 3. Check that index_merge doesn't break "ignore/force/use index" # 3. Check that index_merge doesn't break "ignore/force/use index"
...@@ -186,10 +207,8 @@ create table t4 ( ...@@ -186,10 +207,8 @@ create table t4 (
key2_1 int not null, key2_1 int not null,
key2_2 int not null, key2_2 int not null,
key3 int not null, key3 int not null,
index i1a (key1a, key1b), index i1a (key1a, key1b),
index i1b (key1b, key1a), index i1b (key1b, key1a),
index i2_1(key2, key2_1), index i2_1(key2, key2_1),
index i2_2(key2, key2_1) index i2_2(key2, key2_1)
); );
...@@ -268,9 +287,11 @@ select * from t3 where ...@@ -268,9 +287,11 @@ select * from t3 where
# Test for Bug#3183 # Test for Bug#3183
explain select * from t0 where key1 < 3 or key2 < 4; explain select * from t0 where key1 < 3 or key2 < 4;
# Bug#21277: InnoDB, wrong result set, index_merge strategy, second index not evaluated
select * from t0 where key1 < 3 or key2 < 4; select * from t0 where key1 < 3 or key2 < 4;
update t0 set key8=123 where key1 < 3 or key2 < 4; update t0 set key8=123 where key1 < 3 or key2 < 4;
# Bug#21277: InnoDB, wrong result set, index_merge strategy, second index not evaluated
select * from t0 where key1 < 3 or key2 < 4; select * from t0 where key1 < 3 or key2 < 4;
delete from t0 where key1 < 3 or key2 < 4; delete from t0 where key1 < 3 or key2 < 4;
...@@ -357,6 +378,8 @@ explain select * from t1 WHERE cola = 'foo' AND colb = 'bar'; ...@@ -357,6 +378,8 @@ explain select * from t1 WHERE cola = 'foo' AND colb = 'bar';
explain select * from t1 force index(cola,colb) WHERE cola = 'foo' AND colb = 'bar'; explain select * from t1 force index(cola,colb) WHERE cola = 'foo' AND colb = 'bar';
drop table t1; drop table t1;
if ($merge_table_support)
{
# #
# BUG#17314: Index_merge/intersection not choosen by the optimizer for MERGE tables # BUG#17314: Index_merge/intersection not choosen by the optimizer for MERGE tables
# #
...@@ -383,3 +406,4 @@ explain select * from t3 where a=1 and b=1; ...@@ -383,3 +406,4 @@ explain select * from t3 where a=1 and b=1;
drop table t3; drop table t3;
drop table t0, t1, t2; drop table t0, t1, t2;
}
This diff is collapsed.
# include/index_merge_2sweeps.inc
# #
# 2-sweeps read Index_merge test # 2-sweeps read Index_merge test
# #
-- source include/have_innodb.inc # The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was index_merge_innodb2.test
# main code went into include/index_merge_2sweeps.inc
#
--echo #---------------- 2-sweeps read Index merge test 2 -------------------------------
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1;
...@@ -15,7 +28,7 @@ create table t1 ( ...@@ -15,7 +28,7 @@ create table t1 (
filler2 char(200), filler2 char(200),
index(key1), index(key1),
index(key2) index(key2)
) engine=innodb; );
--disable_query_log --disable_query_log
......
# include/index_merge_ror.inc
# #
# ROR-index_merge tests. # ROR-index_merge tests.
# #
# The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Note: The comments/expectations refer to MyISAM.
# They might be not valid for other storage engines.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was t/index_merge_ror.test
# main code went into include/index_merge_ror.inc
#
--echo #---------------- ROR-index_merge tests -----------------------
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings --disable_warnings
drop table if exists t0,t1,t2; drop table if exists t0,t1,t2;
--enable_warnings --enable_warnings
--disable_query_log
create table t1 create table t1
( (
/* Field names reflect value(rowid) distribution, st=STairs, swt= SaWTooth */ /* Field names reflect value(rowid) distribution, st=STairs, swt= SaWTooth */
...@@ -49,14 +66,19 @@ create table t1 ...@@ -49,14 +66,19 @@ create table t1
# Fill table # Fill table
create table t0 as select * from t1; create table t0 as select * from t1;
--disable_query_log
--echo # Printing of many insert into t0 values (....) disabled.
let $cnt=1000; let $cnt=1000;
while ($cnt) while ($cnt)
{ {
eval insert into t0 values (1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 'data1', 'data2', 'data3', 'data4', 'data5', 'data6'); eval insert into t0 values (1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 'data1', 'data2', 'data3', 'data4', 'data5', 'data6');
dec $cnt; dec $cnt;
} }
--enable_query_log
alter table t1 disable keys; alter table t1 disable keys;
--disable_query_log
--echo # Printing of many insert into t1 select .... from t0 disabled.
let $1=4; let $1=4;
while ($1) while ($1)
{ {
...@@ -74,6 +96,7 @@ while ($1) ...@@ -74,6 +96,7 @@ while ($1)
dec $1; dec $1;
} }
--echo # Printing of many insert into t1 (...) values (....) disabled.
# Row retrieval tests # Row retrieval tests
# -1 is used for values 'out of any range we are using' # -1 is used for values 'out of any range we are using'
# insert enough rows for index intersection to be used for (key1,key2) # insert enough rows for index intersection to be used for (key1,key2)
...@@ -90,8 +113,8 @@ while ($cnt) ...@@ -90,8 +113,8 @@ while ($cnt)
eval insert into t1 (key1, key2, key3, key4, filler1) values (-1, 100, -1, 100,'key2-key4'); eval insert into t1 (key1, key2, key3, key4, filler1) values (-1, 100, -1, 100,'key2-key4');
dec $cnt; dec $cnt;
} }
alter table t1 enable keys;
--enable_query_log --enable_query_log
alter table t1 enable keys;
select count(*) from t1; select count(*) from t1;
# One row results tests for cases where a single row matches all conditions # One row results tests for cases where a single row matches all conditions
......
# include/index_merge_ror_cpk.inc
# #
# Clustered PK ROR-index_merge tests # Clustered PK ROR-index_merge tests
# #
-- source include/have_innodb.inc # The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Note: The comments/expectations refer to InnoDB.
# They might be not valid for other storage engines.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was t/index_merge_ror_cpk.test
# main code went into include/index_merge_ror_cpk.inc
#
--echo #---------------- Clustered PK ROR-index_merge tests -----------------------------
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1;
...@@ -37,7 +53,7 @@ create table t1 ...@@ -37,7 +53,7 @@ create table t1
key (pktail5bad, pk1, pk2, pk2copy), key (pktail5bad, pk1, pk2, pk2copy),
primary key (pk1, pk2) primary key (pk1, pk2)
) engine=innodb; );
--disable_query_log --disable_query_log
set autocommit=0; set autocommit=0;
...@@ -70,7 +86,8 @@ explain select * from t1 where pk1 < 7500 and key1 = 10; ...@@ -70,7 +86,8 @@ explain select * from t1 where pk1 < 7500 and key1 = 10;
explain select * from t1 where pktail1ok=1 and key1=10; explain select * from t1 where pktail1ok=1 and key1=10;
explain select * from t1 where pktail2ok=1 and key1=10; explain select * from t1 where pktail2ok=1 and key1=10;
select ' The following is actually a deficiency, it uses sort_union currently:' as 'note:'; # Note: The following is actually a deficiency, it uses sort_union currently.
# This comment refers to InnoDB and is probably not valid for other engines.
explain select * from t1 where (pktail2ok=1 and pk1< 50000) or key1=10; explain select * from t1 where (pktail2ok=1 and pk1< 50000) or key1=10;
# The expected rows differs a bit from platform to platform # The expected rows differs a bit from platform to platform
...@@ -89,7 +106,7 @@ create table t1 ...@@ -89,7 +106,7 @@ create table t1
( (
RUNID varchar(22), RUNID varchar(22),
SUBMITNR varchar(5), SUBMITNR varchar(5),
ORDERNR char(1) , ORDERNR char(1),
PROGRAMM varchar(8), PROGRAMM varchar(8),
TESTID varchar(4), TESTID varchar(4),
UCCHECK char(1), UCCHECK char(1),
...@@ -100,7 +117,7 @@ create table t1 ...@@ -100,7 +117,7 @@ create table t1
TADIRFLAG char(1), TADIRFLAG char(1),
PRIMARY KEY (RUNID,SUBMITNR,ORDERNR,PROGRAMM,TESTID,UCCHECK), PRIMARY KEY (RUNID,SUBMITNR,ORDERNR,PROGRAMM,TESTID,UCCHECK),
KEY `TVERM~KEY` (PROGRAMM,TESTID,UCCHECK) KEY `TVERM~KEY` (PROGRAMM,TESTID,UCCHECK)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) DEFAULT CHARSET=latin1;
update t1 set `ETEXT` = '', `ETEXT_TYPE`='', `INFO`='', `SEVERITY`='', `TADIRFLAG`='' update t1 set `ETEXT` = '', `ETEXT_TYPE`='', `INFO`='', `SEVERITY`='', `TADIRFLAG`=''
WHERE WHERE
......
This diff is collapsed.
This diff is collapsed.
-- source include/have_innodb.inc # include/query_cache.inc
-- source include/have_query_cache.inc #
# The variables
# $engine_type -- storage engine to be tested
# $test_foreign_keys -- 0, skip foreign key tests
# -- 1, do not skip foreign key tests
# have to be set before sourcing this script.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was innodb_cache.test
# main code went into include/query_cache.inc
#
eval SET SESSION STORAGE_ENGINE = $engine_type;
# Initialise # Initialise
--disable_warnings --disable_warnings
...@@ -11,7 +24,7 @@ drop table if exists t1,t2,t3; ...@@ -11,7 +24,7 @@ drop table if exists t1,t2,t3;
# #
flush status; flush status;
set autocommit=0; set autocommit=0;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
select * from t1; select * from t1;
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
...@@ -19,15 +32,15 @@ drop table t1; ...@@ -19,15 +32,15 @@ drop table t1;
commit; commit;
set autocommit=1; set autocommit=1;
begin; begin;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
select * from t1; select * from t1;
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
drop table t1; drop table t1;
commit; commit;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
create table t2 (a int not null) engine=innodb; create table t2 (a int not null);
create table t3 (a int not null) engine=innodb; create table t3 (a int not null);
insert into t1 values (1),(2); insert into t1 values (1),(2);
insert into t2 values (1),(2); insert into t2 values (1),(2);
insert into t3 values (1),(2); insert into t3 values (1),(2);
...@@ -54,20 +67,22 @@ commit; ...@@ -54,20 +67,22 @@ commit;
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
drop table t3,t2,t1; drop table t3,t2,t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=InnoDB; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id));
select count(*) from t1; select count(*) from t1;
insert into t1 (id) values (0); insert into t1 (id) values (0);
select count(*) from t1; select count(*) from t1;
drop table t1; drop table t1;
if ($test_foreign_keys)
{
# #
# one statement roll back inside transation # one statement roll back inside transation
# #
let $save_query_cache_size=`select @@global.query_cache_size`; let $save_query_cache_size=`select @@global.query_cache_size`;
set GLOBAL query_cache_size=1355776; set GLOBAL query_cache_size=1355776;
CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) ENGINE=innodb; CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a));
CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) ENGINE=innodb; CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b));
CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) ENGINE=innodb; CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`));
INSERT INTO t1 VALUES (1,'me'); INSERT INTO t1 VALUES (1,'me');
INSERT INTO t2 VALUES (1,'you'); INSERT INTO t2 VALUES (1,'you');
INSERT INTO t3 VALUES (2,1,1,2); INSERT INTO t3 VALUES (2,1,1,2);
...@@ -83,5 +98,6 @@ drop table t3,t2,t1; ...@@ -83,5 +98,6 @@ drop table t3,t2,t1;
--disable_query_log --disable_query_log
eval set GLOBAL query_cache_size=$save_query_cache_size; eval set GLOBAL query_cache_size=$save_query_cache_size;
--enable_query_log --enable_query_log
}
# End of 4.1 tests # End of 4.1 tests
# include/read_many_rows.inc
#
# Test how filesort and buffered-record-reads works
# This test needs a lot of time.
#
# The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Last update:
# 2006-08-03 ML test refactored (MySQL 5.1)
# main code t/innodb-big.test --> include/read_many_rows.inc
# #
# Test some things that takes a long time
-- source include/big_test.inc eval SET SESSION STORAGE_ENGINE = $engine_type;
-- source include/have_innodb.inc
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t1, t2, t3, t4; DROP TABLE IF EXISTS t1, t2, t3, t4;
--enable_warnings --enable_warnings
#
# Test test how filesort and buffered-record-reads works with innodb
#
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;
...@@ -39,8 +45,10 @@ INSERT INTO t1 SELECT id+131072 FROM t1; ...@@ -39,8 +45,10 @@ INSERT INTO t1 SELECT id+131072 FROM t1;
INSERT INTO t1 SELECT id+262144 FROM t1; 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;
drop table t1,t2,t3,t4;
DROP TABLE t1,t2,t3,t4;
# include/rowid_order.inc
#
# Test for rowid ordering (and comparison) functions.
# do index_merge select for tables with PK of various types.
#
# The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Note: The comments/expections refer to InnoDB.
# They might be not valid for other storage engines.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was t/rowid_order.test
# main code went into include/rowid_order.inc
#
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings
drop table if exists t1, t2, t3,t4;
--enable_warnings
# Signed number as rowid
create table t1 (
pk1 int not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
);
insert into t1 values (-5, 1, 1),
(-100, 1, 1),
(3, 1, 1),
(0, 1, 1),
(10, 1, 1);
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;
drop table t1;
# Unsigned numbers as rowids
create table t1 (
pk1 int unsigned not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
);
insert into t1 values (0, 1, 1),
(0xFFFFFFFF, 1, 1),
(0xFFFFFFFE, 1, 1),
(1, 1, 1),
(2, 1, 1);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
# Case-insensitive char(N)
create table t1 (
pk1 char(4) not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
) collate latin2_general_ci;
insert into t1 values ('a1', 1, 1),
('b2', 1, 1),
('A3', 1, 1),
('B4', 1, 1);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
# Multi-part PK
create table t1 (
pk1 int not NULL,
pk2 char(4) not NULL collate latin1_german1_ci,
pk3 char(4) not NULL collate latin1_bin,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1,pk2,pk3),
KEY key1 (key1),
KEY key2 (key2)
);
insert into t1 values
(1, 'u', 'u', 1, 1),
(1, 'u', char(0xEC), 1, 1),
(1, 'u', 'x', 1, 1);
insert ignore into t1 select pk1, char(0xEC), pk3, key1, key2 from t1;
insert ignore into t1 select pk1, 'x', pk3, key1, key2 from t1 where pk2='u';
insert ignore into t1 select 2, pk2, pk3, key1, key2 from t1;
select * from t1;
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
# Hidden PK
alter table t1 drop primary key;
select * from t1;
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
# Variable-length PK
# this is also test for Bug#2688
create table t1 (
pk1 varchar(8) NOT NULL default '',
pk2 varchar(4) NOT NULL default '',
key1 int(11),
key2 int(11),
primary key(pk1, pk2),
KEY key1 (key1),
KEY key2 (key2)
);
insert into t1 values ('','empt',2,2),
('a','a--a',2,2),
('bb','b--b',2,2),
('ccc','c--c',2,2),
('dddd','d--d',2,2);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
-- source include/have_innodb.inc # include/unsafe_binlog.inc
# #
# Note that these tests uses options # The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Notes:
# 1. This test uses at least in case of InnoDB options
# innodb_locks_unsafe_for_binlog = true # innodb_locks_unsafe_for_binlog = true
# innodb_lock_timeout = 5 # innodb_lock_timeout = 5
# 2. The comments/expectations refer to InnoDB.
# They might be not valid for other storage engines.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was innodb_unsafe_binlog.test
# main code went into include/unsafe_binlog.inc
#
# #
# Test cases for a bug #15650 # Test cases for bug#15650
# DELETE with LEFT JOIN crashes server with innodb_locks_unsafe_for_binlog
# #
--disable_warnings --disable_warnings
drop table if exists t1,t2; drop table if exists t1,t2;
--enable_warnings --enable_warnings
create table t1 (id int not null, f_id int not null, f int not null, eval create table t1 (id int not null, f_id int not null, f int not null,
primary key(f_id, id)) engine=innodb; primary key(f_id, id)) engine = $engine_type;
create table t2 (id int not null,s_id int not null,s varchar(200), eval create table t2 (id int not null,s_id int not null,s varchar(200),
primary key(id)) engine=innodb; primary key(id)) engine = $engine_type;
INSERT INTO t1 VALUES (8, 1, 3); INSERT INTO t1 VALUES (8, 1, 3);
INSERT INTO t1 VALUES (1, 2, 1); INSERT INTO t1 VALUES (1, 2, 1);
INSERT INTO t2 VALUES (1, 0, ''); INSERT INTO t2 VALUES (1, 0, '');
...@@ -34,7 +48,7 @@ drop table t1,t2; ...@@ -34,7 +48,7 @@ drop table t1,t2;
connect (a,localhost,root,,); connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connection a; connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb; 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;
...@@ -63,7 +77,7 @@ disconnect b; ...@@ -63,7 +77,7 @@ disconnect b;
connect (a,localhost,root,,); connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connection a; connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb; 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;
...@@ -93,9 +107,9 @@ disconnect b; ...@@ -93,9 +107,9 @@ disconnect b;
connect (a,localhost,root,,); connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connection a; connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb; eval create table t1(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t1 values (1,2),(5,3),(4,2); insert into t1 values (1,2),(5,3),(4,2);
create table t2(d int not null, e int, primary key(d)) engine=innodb; eval create table t2(d int not null, e int, primary key(d)) engine = $engine_type;
insert into t2 values (8,6),(12,1),(3,1); insert into t2 values (8,6),(12,1),(3,1);
commit; commit;
set autocommit = 0; set autocommit = 0;
...@@ -104,7 +118,7 @@ connection b; ...@@ -104,7 +118,7 @@ connection b;
set autocommit = 0; set autocommit = 0;
insert into t1 select * from t2; insert into t1 select * from t2;
update t1 set b = (select e from t2 where a = d); update t1 set b = (select e from t2 where a = d);
create table t3(d int not null, e int, primary key(d)) engine=innodb eval create table t3(d int not null, e int, primary key(d)) engine = $engine_type
select * from t2; select * from t2;
commit; commit;
connection a; connection a;
...@@ -131,26 +145,29 @@ connect (a,localhost,root,,); ...@@ -131,26 +145,29 @@ connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connect (c,localhost,root,,); connect (c,localhost,root,,);
connect (d,localhost,root,,); connect (d,localhost,root,,);
eval SET SESSION STORAGE_ENGINE = $engine_type;
connect (e,localhost,root,,); connect (e,localhost,root,,);
connect (f,localhost,root,,); connect (f,localhost,root,,);
connect (g,localhost,root,,); connect (g,localhost,root,,);
eval SET SESSION STORAGE_ENGINE = $engine_type;
connect (h,localhost,root,,); connect (h,localhost,root,,);
connect (i,localhost,root,,); connect (i,localhost,root,,);
connect (j,localhost,root,,); connect (j,localhost,root,,);
eval SET SESSION STORAGE_ENGINE = $engine_type;
connection a; connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb; eval create table t1(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t1 values (1,2),(5,3),(4,2); insert into t1 values (1,2),(5,3),(4,2);
create table t2(a int not null, b int, primary key(a)) engine=innodb; eval create table t2(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t2 values (8,6),(12,1),(3,1); insert into t2 values (8,6),(12,1),(3,1);
create table t3(d int not null, b int, primary key(d)) engine=innodb; eval create table t3(d int not null, b int, primary key(d)) engine = $engine_type;
insert into t3 values (8,6),(12,1),(3,1); insert into t3 values (8,6),(12,1),(3,1);
create table t5(a int not null, b int, primary key(a)) engine=innodb; eval create table t5(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t5 values (1,2),(5,3),(4,2); insert into t5 values (1,2),(5,3),(4,2);
create table t6(d int not null, e int, primary key(d)) engine=innodb; eval create table t6(d int not null, e int, primary key(d)) engine = $engine_type;
insert into t6 values (8,6),(12,1),(3,1); insert into t6 values (8,6),(12,1),(3,1);
create table t8(a int not null, b int, primary key(a)) engine=innodb; eval create table t8(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t8 values (1,2),(5,3),(4,2); insert into t8 values (1,2),(5,3),(4,2);
create table t9(d int not null, e int, primary key(d)) engine=innodb; eval create table t9(d int not null, e int, primary key(d)) engine = $engine_type;
insert into t9 values (8,6),(12,1),(3,1); insert into t9 values (8,6),(12,1),(3,1);
commit; commit;
set autocommit = 0; set autocommit = 0;
...@@ -169,7 +186,7 @@ connection d; ...@@ -169,7 +186,7 @@ connection d;
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
--send --send
create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2; create table t4(a int not null, b int, primary key(a)) select * from t2;
connection e; connection e;
set autocommit = 0; set autocommit = 0;
--send --send
...@@ -181,7 +198,7 @@ update t6 set e = (select b from t2 where a = d lock in share mode); ...@@ -181,7 +198,7 @@ update t6 set e = (select b from t2 where a = d lock in share mode);
connection g; connection g;
set autocommit = 0; set autocommit = 0;
--send --send
create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode; create table t7(a int not null, b int, primary key(a)) select * from t2 lock in share mode;
connection h; connection h;
set autocommit = 0; set autocommit = 0;
--send --send
...@@ -193,7 +210,7 @@ update t9 set e = (select b from t2 where a = d for update); ...@@ -193,7 +210,7 @@ update t9 set e = (select b from t2 where a = d for update);
connection j; connection j;
set autocommit = 0; set autocommit = 0;
--send --send
create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update; create table t10(a int not null, b int, primary key(a)) select * from t2 for update;
connection b; connection b;
--error 1205 --error 1205
......
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1,t2,t3; drop table if exists t1,t2,t3;
flush status; flush status;
set autocommit=0; set autocommit=0;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
select * from t1; select * from t1;
a a
...@@ -15,7 +16,7 @@ drop table t1; ...@@ -15,7 +16,7 @@ drop table t1;
commit; commit;
set autocommit=1; set autocommit=1;
begin; begin;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
select * from t1; select * from t1;
a a
...@@ -27,9 +28,9 @@ Variable_name Value ...@@ -27,9 +28,9 @@ Variable_name Value
Qcache_queries_in_cache 1 Qcache_queries_in_cache 1
drop table t1; drop table t1;
commit; commit;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
create table t2 (a int not null) engine=innodb; create table t2 (a int not null);
create table t3 (a int not null) engine=innodb; create table t3 (a int not null);
insert into t1 values (1),(2); insert into t1 values (1),(2);
insert into t2 values (1),(2); insert into t2 values (1),(2);
insert into t3 values (1),(2); insert into t3 values (1),(2);
...@@ -99,7 +100,7 @@ show status like "Qcache_queries_in_cache"; ...@@ -99,7 +100,7 @@ show status like "Qcache_queries_in_cache";
Variable_name Value Variable_name Value
Qcache_queries_in_cache 1 Qcache_queries_in_cache 1
drop table t3,t2,t1; drop table t3,t2,t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=InnoDB; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id));
select count(*) from t1; select count(*) from t1;
count(*) count(*)
0 0
...@@ -109,9 +110,9 @@ count(*) ...@@ -109,9 +110,9 @@ count(*)
1 1
drop table t1; drop table t1;
set GLOBAL query_cache_size=1355776; set GLOBAL query_cache_size=1355776;
CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) ENGINE=innodb; CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a));
CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) ENGINE=innodb; CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b));
CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) ENGINE=innodb; CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`));
INSERT INTO t1 VALUES (1,'me'); INSERT INTO t1 VALUES (1,'me');
INSERT INTO t2 VALUES (1,'you'); INSERT INTO t2 VALUES (1,'you');
INSERT INTO t3 VALUES (2,1,1,2); INSERT INTO t3 VALUES (2,1,1,2);
......
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1; drop table if exists t1;
Warnings: create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Note 1051 Unknown table 't1' SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb;
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -106,9 +104,7 @@ eta tipo c ...@@ -106,9 +104,7 @@ eta tipo c
2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -211,7 +207,7 @@ eta tipo c ...@@ -211,7 +207,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1 (a int not null, b int not null) engine=innodb; create table t1 (a int not null, b int not null);
insert into t1 values (1,1),(2,1),(3,1),(4,1); insert into t1 values (1,1),(2,1),(3,1),(4,1);
select get_lock("hello2",1000); select get_lock("hello2",1000);
get_lock("hello2",1000) get_lock("hello2",1000)
...@@ -239,9 +235,7 @@ a b ...@@ -239,9 +235,7 @@ a b
1 1 1 1
commit; commit;
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -323,9 +317,7 @@ eta tipo c ...@@ -323,9 +317,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -407,9 +399,7 @@ eta tipo c ...@@ -407,9 +399,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -478,9 +468,7 @@ eta tipo c ...@@ -478,9 +468,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -549,9 +537,7 @@ eta tipo c ...@@ -549,9 +537,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......
# Establish connection con1 (user=root)
# Establish connection con2 (user=root)
drop table if exists t1,t2; drop table if exists t1,t2;
create table t1 (id integer, x integer) engine=INNODB; # Switch to connection con1
create table t1 (id integer, x integer) engine = InnoDB;
insert into t1 values(0, 0); insert into t1 values(0, 0);
set autocommit=0; set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE; SELECT * from t1 where id = 0 FOR UPDATE;
id x id x
0 0 0 0
# Switch to connection con2
set autocommit=0; set autocommit=0;
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
# Switch to connection con1
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;
select * from t1; select * from t1;
id x id x
0 1 0 1
commit; commit;
# Switch to connection con2
commit; commit;
# Switch to connection con1
select * from t1; select * from t1;
id x id x
0 2 0 2
commit; commit;
drop table t1; drop table t1;
create table t1 (id integer, x integer) engine=INNODB; # Switch to connection con1
create table t2 (b integer, a integer) engine=INNODB; create table t1 (id integer, x integer) engine = InnoDB;
create table t2 (b integer, a integer) engine = InnoDB;
insert into t1 values(0, 0), (300, 300); insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 10), (1, 20), (2, 30); insert into t2 values(0, 10), (1, 20), (2, 30);
commit; commit;
...@@ -39,26 +47,31 @@ select * from t1; ...@@ -39,26 +47,31 @@ select * from t1;
id x id x
0 0 0 0
300 300 300 300
# Switch to connection con2
set autocommit=0; set autocommit=0;
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
# Switch to connection con1
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;
select * from t1; select * from t1;
id x id x
0 1 0 1
300 300 300 300
commit; commit;
# Switch to connection con2
commit; commit;
# Switch to connection con1
select * from t1; select * from t1;
id x id x
0 2 0 2
300 300 300 300
commit; commit;
drop table t1, t2; drop table t1, t2;
create table t1 (id integer, x integer) engine=INNODB; create table t1 (id integer, x integer) engine = InnoDB;
create table t2 (b integer, a integer) engine=INNODB; create table t2 (b integer, a integer) engine = InnoDB;
insert into t1 values(0, 0), (300, 300); insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 0), (1, 20), (2, 30); insert into t2 values(0, 0), (1, 20), (2, 30);
commit; commit;
# Switch to connection con1
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE; select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
a b a b
0 0 0 0
...@@ -74,6 +87,7 @@ select * from t1; ...@@ -74,6 +87,7 @@ select * from t1;
id x id x
0 0 0 0
300 300 300 300
# Switch to connection con2
update t2 set a=2 where b = 0; update t2 set a=2 where b = 0;
select * from t2; select * from t2;
b a b a
...@@ -81,16 +95,20 @@ b a ...@@ -81,16 +95,20 @@ b a
1 20 1 20
2 30 2 30
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
# Switch to connection con1
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;
select * from t1; select * from t1;
id x id x
0 1 0 1
300 300 300 300
commit; commit;
# Switch to connection con2
commit; commit;
# Switch to connection con1
select * from t1; select * from t1;
id x id x
0 2 0 2
300 300 300 300
commit; commit;
# Switch to connection default + disconnect con1 and con2
drop table t1, t2; drop table t1, t2;
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1,t3,t4,t5; drop table if exists t1,t3,t4,t5;
create table t1 (a int, b char(10), key a(a), key b(a,b)); create table t1 (a int, b char(10), key a(a), key b(a,b));
insert into t1 values insert into t1 values
...@@ -137,6 +138,29 @@ a b ...@@ -137,6 +138,29 @@ a b
handler t2 read last; handler t2 read last;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
handler t2 close; handler t2 close;
handler t1 open;
handler t1 read a next;
a b
14 aaa
handler t1 read a next;
a b
15 bbb
handler t1 close;
handler t1 open;
handler t1 read a prev;
a b
22 iii
handler t1 read a prev;
a b
21 hhh
handler t1 close;
handler t1 open as t2;
handler t2 read first;
a b
17 ddd
alter table t1 engine = InnoDB;
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2; handler t1 open as t2;
drop table t1; drop table t1;
create table t1 (a int); create table t1 (a int);
...@@ -214,16 +238,16 @@ insert into t1 values (''); ...@@ -214,16 +238,16 @@ insert into t1 values ('');
handler t1 open; handler t1 open;
handler t1 read first limit 9; handler t1 read first limit 9;
table_id table_id
test_test.t1
test_test.t1
create table t2(table_id char(20) primary key); create table t2(table_id char(20) primary key);
insert into t2 values ('test_test.t2'); insert into t2 values ('test_test.t2');
insert into t2 values (''); insert into t2 values ('');
handler t2 open; handler t2 open;
handler t2 read first limit 9; handler t2 read first limit 9;
table_id table_id
test_test.t2
test_test.t2
use test; use test;
drop table if exists t1; drop table if exists t1;
create table t1(table_id char(20) primary key); create table t1(table_id char(20) primary key);
...@@ -238,14 +262,14 @@ handler test_test.t1 read first limit 9; ...@@ -238,14 +262,14 @@ handler test_test.t1 read first limit 9;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read first limit 9' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read first limit 9' at line 1
handler t1 read first limit 9; handler t1 read first limit 9;
table_id table_id
test_test.t1
test_test.t1
handler test_test.t2 read first limit 9; handler test_test.t2 read first limit 9;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read first limit 9' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read first limit 9' at line 1
handler t2 read first limit 9; handler t2 read first limit 9;
table_id table_id
test_test.t2
test_test.t2
handler test_test.t1 close; handler test_test.t1 close;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'close' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'close' at line 1
handler t1 close; handler t1 close;
...@@ -463,6 +487,15 @@ Table Op Msg_type Msg_text ...@@ -463,6 +487,15 @@ Table Op Msg_type Msg_text
test.t1 optimize status OK test.t1 optimize status OK
proceed with the normal connection proceed with the normal connection
drop table t1; drop table t1;
CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY (no1,no2));
INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
HANDLER t1 OPEN;
HANDLER t1 READ `primary` = (1, 1000);
no1 no2
HANDLER t1 READ `primary` PREV;
no1 no2
1 275
DROP TABLE t1;
create table t1 (c1 int); create table t1 (c1 int);
insert into t1 values (14397); insert into t1 values (14397);
flush tables with read lock; flush tables with read lock;
......
This diff is collapsed.
This diff is collapsed.
drop table if exists t1;
create table t1 (
pk int primary key,
key1 int,
key2 int,
filler char(200),
filler2 char(200),
index(key1),
index(key2)
) engine=innodb;
select * from t1 where (key1 >= 2 and key1 <= 10) or (pk >= 4 and pk <=8 );
pk key1 key2 filler filler2
2 2 2 filler-data filler-data-2
3 3 3 filler-data filler-data-2
9 9 9 filler-data filler-data-2
10 10 10 filler-data filler-data-2
4 4 4 filler-data filler-data-2
5 5 5 filler-data filler-data-2
6 6 6 filler-data filler-data-2
7 7 7 filler-data filler-data-2
8 8 8 filler-data filler-data-2
set @maxv=1000;
select * from t1 where
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
or key1=18 or key1=60;
pk key1 key2 filler filler2
18 18 18 filler-data filler-data-2
60 60 60 filler-data filler-data-2
1 1 1 filler-data filler-data-2
2 2 2 filler-data filler-data-2
3 3 3 filler-data filler-data-2
4 4 4 filler-data filler-data-2
11 11 11 filler-data filler-data-2
12 12 12 filler-data filler-data-2
13 13 13 filler-data filler-data-2
14 14 14 filler-data filler-data-2
50 50 50 filler-data filler-data-2
51 51 51 filler-data filler-data-2
52 52 52 filler-data filler-data-2
53 53 53 filler-data filler-data-2
54 54 54 filler-data filler-data-2
991 991 991 filler-data filler-data-2
992 992 992 filler-data filler-data-2
993 993 993 filler-data filler-data-2
994 994 994 filler-data filler-data-2
995 995 995 filler-data filler-data-2
996 996 996 filler-data filler-data-2
997 997 997 filler-data filler-data-2
998 998 998 filler-data filler-data-2
999 999 999 filler-data filler-data-2
1000 1000 1000 filler-data filler-data-2
select * from t1 where
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
or key1 < 3 or key1 > @maxv-11;
pk key1 key2 filler filler2
990 990 990 filler-data filler-data-2
1 1 1 filler-data filler-data-2
2 2 2 filler-data filler-data-2
3 3 3 filler-data filler-data-2
4 4 4 filler-data filler-data-2
11 11 11 filler-data filler-data-2
12 12 12 filler-data filler-data-2
13 13 13 filler-data filler-data-2
14 14 14 filler-data filler-data-2
50 50 50 filler-data filler-data-2
51 51 51 filler-data filler-data-2
52 52 52 filler-data filler-data-2
53 53 53 filler-data filler-data-2
54 54 54 filler-data filler-data-2
991 991 991 filler-data filler-data-2
992 992 992 filler-data filler-data-2
993 993 993 filler-data filler-data-2
994 994 994 filler-data filler-data-2
995 995 995 filler-data filler-data-2
996 996 996 filler-data filler-data-2
997 997 997 filler-data filler-data-2
998 998 998 filler-data filler-data-2
999 999 999 filler-data filler-data-2
1000 1000 1000 filler-data filler-data-2
select * from t1 where
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
or
(key1 < 5) or (key1 > 10 and key1 < 15) or (key1 >= 50 and key1 < 55 ) or (key1 > @maxv-10);
pk key1 key2 filler filler2
1 1 1 filler-data filler-data-2
2 2 2 filler-data filler-data-2
3 3 3 filler-data filler-data-2
4 4 4 filler-data filler-data-2
11 11 11 filler-data filler-data-2
12 12 12 filler-data filler-data-2
13 13 13 filler-data filler-data-2
14 14 14 filler-data filler-data-2
50 50 50 filler-data filler-data-2
51 51 51 filler-data filler-data-2
52 52 52 filler-data filler-data-2
53 53 53 filler-data filler-data-2
54 54 54 filler-data filler-data-2
991 991 991 filler-data filler-data-2
992 992 992 filler-data filler-data-2
993 993 993 filler-data filler-data-2
994 994 994 filler-data filler-data-2
995 995 995 filler-data filler-data-2
996 996 996 filler-data filler-data-2
997 997 997 filler-data filler-data-2
998 998 998 filler-data filler-data-2
999 999 999 filler-data filler-data-2
1000 1000 1000 filler-data filler-data-2
select * from t1 where
(pk > 10 and pk < 15) or (pk >= 50 and pk < 55 )
or
(key1 < 5) or (key1 > @maxv-10);
pk key1 key2 filler filler2
1 1 1 filler-data filler-data-2
2 2 2 filler-data filler-data-2
3 3 3 filler-data filler-data-2
4 4 4 filler-data filler-data-2
991 991 991 filler-data filler-data-2
992 992 992 filler-data filler-data-2
993 993 993 filler-data filler-data-2
994 994 994 filler-data filler-data-2
995 995 995 filler-data filler-data-2
996 996 996 filler-data filler-data-2
997 997 997 filler-data filler-data-2
998 998 998 filler-data filler-data-2
999 999 999 filler-data filler-data-2
1000 1000 1000 filler-data filler-data-2
11 11 11 filler-data filler-data-2
12 12 12 filler-data filler-data-2
13 13 13 filler-data filler-data-2
14 14 14 filler-data filler-data-2
50 50 50 filler-data filler-data-2
51 51 51 filler-data filler-data-2
52 52 52 filler-data filler-data-2
53 53 53 filler-data filler-data-2
54 54 54 filler-data filler-data-2
drop table t1;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#im_instance_conf : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly #im_instance_conf : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly
im_options : Bug#20294 2006-07-24 stewart Instance manager test im_instance_conf fails randomly im_options : Bug#20294 2006-07-24 stewart Instance manager test im_instance_conf fails randomly
#im_life_cycle : Bug#20368 2006-06-10 alik im_life_cycle test fails #im_life_cycle : Bug#20368 2006-06-10 alik im_life_cycle test fails
concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
ndb_binlog_ignore_db : BUG#21279 2006-07-25 ingo Randomly throws a warning ndb_binlog_ignore_db : BUG#21279 2006-07-25 ingo Randomly throws a warning
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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