Commit 22d8c89d authored by istruewing@chilla.local's avatar istruewing@chilla.local

Merge chilla.local:/home/mydev/mysql-5.1--main

into  chilla.local:/home/mydev/mysql-5.1-toteam
parents fad645f2 8dba18f7
# include/concurrent.inc
#
# Concurrent InnoDB tests, mainly in UPDATE's
# Concurrent tests for transactional storage engines, mainly in UPDATE's
# Bug#3300
# Designed and tested by Sinisa Milivojevic, sinisa@mysql.com
#
# two non-interfering UPDATE's not changing result set
#
# test takes circa 5 minutes to run, so it's big
-- source include/big_test.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 t/innodb_concurrent.test
# main code went into include/concurrent.inc
#
connection default;
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings
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,,);
connection thread1;
eval SET SESSION STORAGE_ENGINE = $engine_type;
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -57,7 +68,7 @@ drop table t1;
#
#connect (thread1, localhost, mysqltest,,);
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -103,7 +114,7 @@ drop table t1;
#connect (thread1, localhost, mysqltest,,);
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);
select get_lock("hello2",1000);
#connect (thread2, localhost, mysqltest,,);
......@@ -132,7 +143,7 @@ drop table t1;
#
#connect (thread1, localhost, mysqltest,,);
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -175,7 +186,7 @@ drop table t1;
#
#connect (thread1, localhost, mysqltest,,);
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -218,7 +229,7 @@ drop table t1;
#
#connect (thread1, localhost, mysqltest,,);
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -261,7 +272,7 @@ drop table t1;
#
#connect (thread1, localhost, mysqltest,,);
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -305,7 +316,7 @@ drop table t1;
#
#connect (thread1, localhost, mysqltest,,);
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......
-- source include/have_innodb.inc
# Can't test this with embedded server
-- source include/not_embedded.inc
# include/deadlock.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,,);
--echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
--disable_warnings
......@@ -13,29 +23,34 @@ drop table if exists t1,t2;
# Testing of FOR UPDATE
#
--echo # Switch to 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);
set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE;
--echo # Switch to connection con2
connection con2;
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
update t1 set x=2 where id = 0;
--sleep 2
--echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
--echo # Switch to connection con2
connection con2;
reap;
commit;
--echo # Switch to connection con1
connection con1;
select * from t1;
commit;
......@@ -45,9 +60,10 @@ drop table t1;
# Testing of FOR UPDATE
#
--echo # Switch to connection con1
connection con1;
create table t1 (id integer, x integer) engine=INNODB;
create table t2 (b integer, a integer) engine=INNODB;
eval create table t1 (id integer, x integer) engine = $engine_type;
eval create table t2 (b integer, a integer) engine = $engine_type;
insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 10), (1, 20), (2, 30);
commit;
......@@ -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 t1;
--echo # Switch to connection con2
connection con2;
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
update t1 set x=2 where id = 0;
--sleep 2
--echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
--echo # Switch to connection con2
connection con2;
reap;
commit;
--echo # Switch to connection con1
connection con1;
select * from t1;
commit;
drop table t1, t2;
create table t1 (id integer, x integer) engine=INNODB;
create table t2 (b integer, a integer) engine=INNODB;
eval create table t1 (id integer, x integer) engine = $engine_type;
eval create table t2 (b integer, a integer) engine = $engine_type;
insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 0), (1, 20), (2, 30);
commit;
--echo # Switch to connection con1
connection con1;
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
select * from t2;
select * from t1;
--echo # Switch to 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;
select * from t2;
--send
update t1 set x=2 where id = 0;
--sleep 2
--echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
--echo # Switch to connection con2
connection con2;
reap;
commit;
--echo # Switch to connection con1
connection con1;
select * from t1;
commit;
# Cleanup
--echo # Switch to connection default + disconnect con1 and con2
connection default;
disconnect con1;
disconnect con2;
drop table t1, t2;
# End of 4.1 tests
# include/handler.inc
#
# The variables
# $engine_type -- storage engine to be tested
# $other_engine_type -- storage engine <> $engine_type
# $other_handler_engine_type -- storage engine <> $engine_type, if possible
# 1. $other_handler_engine_type must support handler
# 2. $other_handler_engine_type must point to an all
# time available storage engine
# 2006-08 MySQL 5.1 MyISAM and MEMORY only
# have to be set before sourcing this script.
-- source include/not_embedded.inc
#
# 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
-- source include/not_embedded.inc
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings
drop table if exists t1,t3,t4,t5;
......@@ -74,6 +89,22 @@ handler t2 read next;
handler t2 read last;
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
#
......@@ -84,7 +115,7 @@ insert into t1 values (17);
--error 1109
handler t2 read first;
handler t1 open as t2;
alter table t1 engine=MyISAM;
eval alter table t1 engine=$other_engine_type;
--error 1109
handler t2 read first;
drop table t1;
......@@ -303,7 +334,7 @@ insert into t5 values ("t5");
handler t5 open as h5;
handler h5 read first limit 9;
# close first
alter table t1 engine=MyISAM;
eval alter table t1 engine=$other_handler_engine_type;
--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
......@@ -311,7 +342,7 @@ handler h3 read first limit 9;
handler h4 read first limit 9;
handler h5 read first limit 9;
# close last
alter table t5 engine=MyISAM;
eval alter table t5 engine=$other_handler_engine_type;
--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
......@@ -320,7 +351,7 @@ handler h4 read first limit 9;
--error 1109
handler h5 read first limit 9;
# close middle
alter table t3 engine=MyISAM;
eval alter table t3 engine=$other_handler_engine_type;
--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
......@@ -338,7 +369,7 @@ handler t1 open as h1_3;
handler h1_1 read first limit 9;
handler h1_2 read first limit 9;
handler h1_3 read first limit 9;
alter table t1 engine=MyISAM;
eval alter table t1 engine=$engine_type;
--error 1109
handler h1_1 read first limit 9;
--error 1109
......@@ -379,6 +410,13 @@ reap;
connection default;
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
#
......
# include/index_merge1.inc
#
# 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
drop table if exists t0, t1, t2, t3, t4;
--enable_warnings
......@@ -48,6 +68,7 @@ explain select * from t0 where key1 < 3 or key2 <4;
explain
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);
# 3. Check that index_merge doesn't break "ignore/force/use index"
......@@ -186,10 +207,8 @@ create table t4 (
key2_1 int not null,
key2_2 int not null,
key3 int not null,
index i1a (key1a, key1b),
index i1b (key1b, key1a),
index i2_1(key2, key2_1),
index i2_2(key2, key2_1)
);
......@@ -268,9 +287,11 @@ select * from t3 where
# Test for Bug#3183
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;
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;
delete from t0 where key1 < 3 or key2 < 4;
......@@ -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';
drop table t1;
if ($merge_table_support)
{
#
# BUG#17314: Index_merge/intersection not choosen by the optimizer for MERGE tables
#
......@@ -383,3 +406,36 @@ explain select * from t3 where a=1 and b=1;
drop table t3;
drop table t0, t1, t2;
}
#
# BUG#20256 - LOCK WRITE - MyISAM
#
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(a INT, b INT, dummy CHAR(16) DEFAULT '', KEY(a), KEY(b));
INSERT INTO t2(a,b) VALUES
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(1,2);
LOCK TABLES t1 WRITE, t2 WRITE;
INSERT INTO t2(a,b) VALUES(1,2);
SELECT t2.a FROM t1,t2 WHERE t2.b=2 AND t2.a=1;
UNLOCK TABLES;
DROP TABLE t1, t2;
This diff is collapsed.
# include/index_merge_2sweeps.inc
#
# 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
drop table if exists t1;
......@@ -15,7 +28,7 @@ create table t1 (
filler2 char(200),
index(key1),
index(key2)
) engine=innodb;
);
--disable_query_log
......
# include/index_merge_ror.inc
#
# 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
drop table if exists t0,t1,t2;
--enable_warnings
--disable_query_log
create table t1
(
/* Field names reflect value(rowid) distribution, st=STairs, swt= SaWTooth */
......@@ -49,14 +66,19 @@ create table t1
# Fill table
create table t0 as select * from t1;
--disable_query_log
--echo # Printing of many insert into t0 values (....) disabled.
let $cnt=1000;
while ($cnt)
{
eval insert into t0 values (1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 'data1', 'data2', 'data3', 'data4', 'data5', 'data6');
dec $cnt;
}
--enable_query_log
alter table t1 disable keys;
--disable_query_log
--echo # Printing of many insert into t1 select .... from t0 disabled.
let $1=4;
while ($1)
{
......@@ -74,6 +96,7 @@ while ($1)
dec $1;
}
--echo # Printing of many insert into t1 (...) values (....) disabled.
# Row retrieval tests
# -1 is used for values 'out of any range we are using'
# insert enough rows for index intersection to be used for (key1,key2)
......@@ -90,8 +113,8 @@ while ($cnt)
eval insert into t1 (key1, key2, key3, key4, filler1) values (-1, 100, -1, 100,'key2-key4');
dec $cnt;
}
alter table t1 enable keys;
--enable_query_log
alter table t1 enable keys;
select count(*) from t1;
# 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
#
-- 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
drop table if exists t1;
......@@ -37,7 +53,7 @@ create table t1
key (pktail5bad, pk1, pk2, pk2copy),
primary key (pk1, pk2)
) engine=innodb;
);
--disable_query_log
set autocommit=0;
......@@ -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 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;
# The expected rows differs a bit from platform to platform
......@@ -89,7 +106,7 @@ create table t1
(
RUNID varchar(22),
SUBMITNR varchar(5),
ORDERNR char(1) ,
ORDERNR char(1),
PROGRAMM varchar(8),
TESTID varchar(4),
UCCHECK char(1),
......@@ -100,7 +117,7 @@ create table t1
TADIRFLAG char(1),
PRIMARY KEY (RUNID,SUBMITNR,ORDERNR,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`=''
WHERE
......
This diff is collapsed.
This diff is collapsed.
-- source include/have_innodb.inc
-- source include/have_query_cache.inc
# include/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
--disable_warnings
......@@ -11,7 +24,7 @@ drop table if exists t1,t2,t3;
#
flush status;
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);
select * from t1;
show status like "Qcache_queries_in_cache";
......@@ -19,15 +32,15 @@ drop table t1;
commit;
set autocommit=1;
begin;
create table t1 (a int not null) engine=innodb;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
select * from t1;
show status like "Qcache_queries_in_cache";
drop table t1;
commit;
create table t1 (a int not null) engine=innodb;
create table t2 (a int not null) engine=innodb;
create table t3 (a int not null) engine=innodb;
create table t1 (a int not null);
create table t2 (a int not null);
create table t3 (a int not null);
insert into t1 values (1),(2);
insert into t2 values (1),(2);
insert into t3 values (1),(2);
......@@ -54,20 +67,22 @@ commit;
show status like "Qcache_queries_in_cache";
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;
insert into t1 (id) values (0);
select count(*) from t1;
drop table t1;
if ($test_foreign_keys)
{
#
# one statement roll back inside transation
#
let $save_query_cache_size=`select @@global.query_cache_size`;
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 t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) 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`)) 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));
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 t2 VALUES (1,'you');
INSERT INTO t3 VALUES (2,1,1,2);
......@@ -83,5 +98,6 @@ drop table t3,t2,t1;
--disable_query_log
eval set GLOBAL query_cache_size=$save_query_cache_size;
--enable_query_log
}
# 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 variables
# $engine_type -- storage engine to be tested
# $other_engine_type -- storage engine <> $engine_type, if possible
# 1. $other_engine_type must allow to store many rows
# without using non standard server options
# (does not need a t/read_many_rows_*-master.opt file)
# 2. $other_engine_type must point to an all time
# available storage engine
# 2006-08 MySQL 5.1 MyISAM and MEMORY only
# have to be set before sourcing this script.
#
# Last update:
# 2006-08-03 ML test refactored (MySQL 5.1)
# main code t/innodb-big.test --> include/read_many_rows.inc
#
# Test some things that takes a long time
-- source include/big_test.inc
-- source include/have_innodb.inc
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings
DROP TABLE IF EXISTS t1, t2, t3, t4;
--enable_warnings
#
# Test test how filesort and buffered-record-reads works with innodb
#
CREATE TABLE t1 (id INTEGER) ENGINE=MYISAM;
CREATE TABLE t2 (id INTEGER primary key) ENGINE=INNODB;
CREATE TABLE t3 (a char(32) primary key,id INTEGER) ENGINE=INNODB;
CREATE TABLE t4 (a char(32) primary key,id INTEGER) ENGINE=MYISAM;
eval CREATE TABLE t1 (id INTEGER) ENGINE=$other_engine_type;
CREATE TABLE t2 (id INTEGER PRIMARY KEY);
CREATE TABLE t3 (a CHAR(32) PRIMARY KEY,id INTEGER);
eval CREATE TABLE t4 (a CHAR(32) PRIMARY KEY,id INTEGER) ENGINE=$other_engine_type;
INSERT INTO t1 (id) VALUES (1);
INSERT INTO t1 SELECT id+1 FROM t1;
......@@ -39,8 +52,10 @@ INSERT INTO t1 SELECT id+131072 FROM t1;
INSERT INTO t1 SELECT id+262144 FROM t1;
INSERT INTO t1 SELECT id+524288 FROM t1;
INSERT INTO t1 SELECT id+1048576 FROM t1;
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t3 SELECT concat(id),id from t2 ORDER BY -id;
INSERT INTO t4 SELECT * from t3 ORDER BY concat(a);
select sum(id) from t3;
drop table t1,t2,t3,t4;
INSERT INTO t3 SELECT CONCAT(id),id FROM t2 ORDER BY -id;
INSERT INTO t4 SELECT * FROM t3 ORDER BY CONCAT(a);
SELECT SUM(id) FROM t3;
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_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
drop table if exists t1,t2;
--enable_warnings
create table t1 (id int not null, f_id int not null, f int not null,
primary key(f_id, id)) engine=innodb;
create table t2 (id int not null,s_id int not null,s varchar(200),
primary key(id)) engine=innodb;
eval create table t1 (id int not null, f_id int not null, f int not null,
primary key(f_id, id)) engine = $engine_type;
eval create table t2 (id int not null,s_id int not null,s varchar(200),
primary key(id)) engine = $engine_type;
INSERT INTO t1 VALUES (8, 1, 3);
INSERT INTO t1 VALUES (1, 2, 1);
INSERT INTO t2 VALUES (1, 0, '');
......@@ -34,7 +48,7 @@ drop table t1,t2;
connect (a,localhost,root,,);
connect (b,localhost,root,,);
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);
commit;
set autocommit = 0;
......@@ -63,7 +77,7 @@ disconnect b;
connect (a,localhost,root,,);
connect (b,localhost,root,,);
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);
commit;
set autocommit = 0;
......@@ -93,9 +107,9 @@ disconnect b;
connect (a,localhost,root,,);
connect (b,localhost,root,,);
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);
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);
commit;
set autocommit = 0;
......@@ -104,7 +118,7 @@ connection b;
set autocommit = 0;
insert into t1 select * from t2;
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;
commit;
connection a;
......@@ -131,26 +145,29 @@ connect (a,localhost,root,,);
connect (b,localhost,root,,);
connect (c,localhost,root,,);
connect (d,localhost,root,,);
eval SET SESSION STORAGE_ENGINE = $engine_type;
connect (e,localhost,root,,);
connect (f,localhost,root,,);
connect (g,localhost,root,,);
eval SET SESSION STORAGE_ENGINE = $engine_type;
connect (h,localhost,root,,);
connect (i,localhost,root,,);
connect (j,localhost,root,,);
eval SET SESSION STORAGE_ENGINE = $engine_type;
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);
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);
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);
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);
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);
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);
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);
commit;
set autocommit = 0;
......@@ -169,7 +186,7 @@ connection d;
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
--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;
set autocommit = 0;
--send
......@@ -181,7 +198,7 @@ update t6 set e = (select b from t2 where a = d lock in share mode);
connection g;
set autocommit = 0;
--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;
set autocommit = 0;
--send
......@@ -193,7 +210,7 @@ update t9 set e = (select b from t2 where a = d for update);
connection j;
set autocommit = 0;
--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;
--error 1205
......
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1,t2,t3;
flush status;
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);
select * from t1;
a
......@@ -15,7 +16,7 @@ drop table t1;
commit;
set autocommit=1;
begin;
create table t1 (a int not null) engine=innodb;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
select * from t1;
a
......@@ -27,9 +28,9 @@ Variable_name Value
Qcache_queries_in_cache 1
drop table t1;
commit;
create table t1 (a int not null) engine=innodb;
create table t2 (a int not null) engine=innodb;
create table t3 (a int not null) engine=innodb;
create table t1 (a int not null);
create table t2 (a int not null);
create table t3 (a int not null);
insert into t1 values (1),(2);
insert into t2 values (1),(2);
insert into t3 values (1),(2);
......@@ -99,7 +100,7 @@ show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
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;
count(*)
0
......@@ -109,9 +110,9 @@ count(*)
1
drop table t1;
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 t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) 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`)) 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));
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 t2 VALUES (1,'you');
INSERT INTO t3 VALUES (2,1,1,2);
......
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
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
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
SET SESSION STORAGE_ENGINE = InnoDB;
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -106,9 +104,7 @@ eta tipo c
2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1;
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
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -211,7 +207,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
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);
select get_lock("hello2",1000);
get_lock("hello2",1000)
......@@ -239,9 +235,7 @@ a b
1 1
commit;
drop table t1;
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
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -323,9 +317,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1;
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
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -407,9 +399,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1;
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
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -478,9 +468,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1;
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
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......@@ -549,9 +537,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1;
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
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 (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......
# Establish connection con1 (user=root)
# Establish connection con2 (user=root)
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);
set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE;
id x
0 0
# Switch to connection con2
set autocommit=0;
update t1 set x=2 where id = 0;
# Switch to connection con1
update t1 set x=1 where id = 0;
select * from t1;
id x
0 1
commit;
# Switch to connection con2
commit;
# Switch to connection con1
select * from t1;
id x
0 2
commit;
drop table t1;
create table t1 (id integer, x integer) engine=INNODB;
create table t2 (b integer, a integer) engine=INNODB;
# Switch to connection con1
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 t2 values(0, 10), (1, 20), (2, 30);
commit;
......@@ -39,26 +47,31 @@ select * from t1;
id x
0 0
300 300
# Switch to connection con2
set autocommit=0;
update t1 set x=2 where id = 0;
# Switch to connection con1
update t1 set x=1 where id = 0;
select * from t1;
id x
0 1
300 300
commit;
# Switch to connection con2
commit;
# Switch to connection con1
select * from t1;
id x
0 2
300 300
commit;
drop table t1, t2;
create table t1 (id integer, x integer) engine=INNODB;
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 t2 values(0, 0), (1, 20), (2, 30);
commit;
# Switch to connection con1
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
a b
0 0
......@@ -74,6 +87,7 @@ select * from t1;
id x
0 0
300 300
# Switch to connection con2
update t2 set a=2 where b = 0;
select * from t2;
b a
......@@ -81,16 +95,20 @@ b a
1 20
2 30
update t1 set x=2 where id = 0;
# Switch to connection con1
update t1 set x=1 where id = 0;
select * from t1;
id x
0 1
300 300
commit;
# Switch to connection con2
commit;
# Switch to connection con1
select * from t1;
id x
0 2
300 300
commit;
# Switch to connection default + disconnect con1 and con2
drop table t1, t2;
This diff is collapsed.
SET SESSION STORAGE_ENGINE = MyISAM;
drop table if exists t1,t3,t4,t5;
create table t1 (a int, b char(10), key a(a), key b(a,b));
insert into t1 values
......@@ -137,6 +138,29 @@ a b
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
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 = MyISAM;
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2;
drop table t1;
create table t1 (a int);
......@@ -144,7 +168,7 @@ insert into t1 values (17);
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2;
alter table t1 engine=MyISAM;
alter table t1 engine=MEMORY;
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
drop table t1;
......@@ -463,6 +487,15 @@ Table Op Msg_type Msg_text
test.t1 optimize status OK
proceed with the normal connection
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);
insert into t1 values (14397);
flush tables with read lock;
......
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.
drop table if exists t1;
create table t1
(
pk1 int not null,
pk2 int not null,
key1 int not null,
key2 int not null,
pktail1ok int not null,
pktail2ok int not null,
pktail3bad int not null,
pktail4bad int not null,
pktail5bad int not null,
pk2copy int not null,
badkey int not null,
filler1 char (200),
filler2 char (200),
key (key1),
key (key2),
/* keys with tails from CPK members */
key (pktail1ok, pk1),
key (pktail2ok, pk1, pk2),
key (pktail3bad, pk2, pk1),
key (pktail4bad, pk1, pk2copy),
key (pktail5bad, pk1, pk2, pk2copy),
primary key (pk1, pk2)
) engine=innodb;
explain select * from t1 where pk1 = 1 and pk2 < 80 and key1=0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY,key1 PRIMARY 8 NULL 9 Using where
select * from t1 where pk1 = 1 and pk2 < 80 and key1=0;
pk1 pk2 key1 key2 pktail1ok pktail2ok pktail3bad pktail4bad pktail5bad pk2copy badkey filler1 filler2
1 10 0 0 0 0 0 0 0 10 0 filler-data-10 filler2
1 11 0 0 0 0 0 0 0 11 0 filler-data-11 filler2
1 12 0 0 0 0 0 0 0 12 0 filler-data-12 filler2
1 13 0 0 0 0 0 0 0 13 0 filler-data-13 filler2
1 14 0 0 0 0 0 0 0 14 0 filler-data-14 filler2
1 15 0 0 0 0 0 0 0 15 0 filler-data-15 filler2
1 16 0 0 0 0 0 0 0 16 0 filler-data-16 filler2
1 17 0 0 0 0 0 0 0 17 0 filler-data-17 filler2
1 18 0 0 0 0 0 0 0 18 0 filler-data-18 filler2
1 19 0 0 0 0 0 0 0 19 0 filler-data-19 filler2
explain select pk1,pk2 from t1 where key1 = 10 and key2=10 and 2*pk1+1 < 2*96+1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge key1,key2 key1,key2 4,4 NULL 1 Using intersect(key1,key2); Using where; Using index
select pk1,pk2 from t1 where key1 = 10 and key2=10 and 2*pk1+1 < 2*96+1;
pk1 pk2
95 50
95 51
95 52
95 53
95 54
95 55
95 56
95 57
95 58
95 59
explain select * from t1 where badkey=1 and key1=10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref key1 key1 4 const 100 Using where
explain select * from t1 where pk1 < 7500 and key1 = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge PRIMARY,key1 key1,PRIMARY 4,4 NULL ROWS Using intersect(key1,PRIMARY); Using where
explain select * from t1 where pktail1ok=1 and key1=10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge key1,pktail1ok key1,pktail1ok 4,4 NULL 1 Using intersect(key1,pktail1ok); Using where
explain select * from t1 where pktail2ok=1 and key1=10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge key1,pktail2ok key1,pktail2ok 4,4 NULL 1 Using intersect(key1,pktail2ok); Using where
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:
explain select * from t1 where (pktail2ok=1 and pk1< 50000) or key1=10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge PRIMARY,key1,pktail2ok pktail2ok,key1 8,4 NULL 199 Using sort_union(pktail2ok,key1); Using where
explain select * from t1 where pktail3bad=1 and key1=10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref key1,pktail3bad key1 4 const 100 Using where
explain select * from t1 where pktail4bad=1 and key1=10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref key1,pktail4bad key1 4 const 100 Using where
explain select * from t1 where pktail5bad=1 and key1=10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref key1,pktail5bad key1 4 const 100 Using where
explain select pk1,pk2,key1,key2 from t1 where key1 = 10 and key2=10 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge key1,key2 key1,key2 4,4 NULL 1 Using intersect(key1,key2); Using where; Using index
select pk1,pk2,key1,key2 from t1 where key1 = 10 and key2=10 limit 10;
pk1 pk2 key1 key2
95 50 10 10
95 51 10 10
95 52 10 10
95 53 10 10
95 54 10 10
95 55 10 10
95 56 10 10
95 57 10 10
95 58 10 10
95 59 10 10
drop table t1;
create table t1
(
RUNID varchar(22),
SUBMITNR varchar(5),
ORDERNR char(1) ,
PROGRAMM varchar(8),
TESTID varchar(4),
UCCHECK char(1),
ETEXT varchar(80),
ETEXT_TYPE char(1),
INFO char(1),
SEVERITY tinyint(3),
TADIRFLAG char(1),
PRIMARY KEY (RUNID,SUBMITNR,ORDERNR,PROGRAMM,TESTID,UCCHECK),
KEY `TVERM~KEY` (PROGRAMM,TESTID,UCCHECK)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
update t1 set `ETEXT` = '', `ETEXT_TYPE`='', `INFO`='', `SEVERITY`='', `TADIRFLAG`=''
WHERE
`RUNID`= '' AND `SUBMITNR`= '' AND `ORDERNR`='' AND `PROGRAMM`='' AND
`TESTID`='' AND `UCCHECK`='';
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.
......@@ -15,6 +15,7 @@
#events_scheduling : BUG#19170 2006-04-26 andrey Test case of 19170 fails on some platforms. Has to be checked.
im_options : Bug#20294 2006-07-24 stewart Instance manager test im_options fails randomly
#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_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
......
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.
This diff is collapsed.
This diff is collapsed.
......@@ -953,6 +953,7 @@ public:
{
/* TODO: DBUG_ASSERT(inited == NONE); */
}
virtual handler *clone(MEM_ROOT *mem_root);
/* This is called after create to allow us to set up cached variables */
void init()
{
......
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