summaryrefslogtreecommitdiff
path: root/storage/innobase/mysql-test
diff options
context:
space:
mode:
authorSatya B <satya.bn@sun.com>2009-10-16 17:28:02 +0530
committerSatya B <satya.bn@sun.com>2009-10-16 17:28:02 +0530
commitd63eb541f51648050467201ee4e148b087174ac6 (patch)
treed800c318519c4be386c9f5b47428b6790b8addb2 /storage/innobase/mysql-test
parent12c7d0cf33b20dfcd548af594542b8a7bda601d2 (diff)
downloadmariadb-git-d63eb541f51648050467201ee4e148b087174ac6.tar.gz
Merging Innodb plugin 1.0.5 revisions from 5.1-main from revisions 3149 to 3163
also merged missing Innodb plugin revisions r5636,r5635 manually
Diffstat (limited to 'storage/innobase/mysql-test')
-rw-r--r--storage/innobase/mysql-test/innodb-analyze.test2
-rw-r--r--storage/innobase/mysql-test/innodb-consistent-master.opt1
-rw-r--r--storage/innobase/mysql-test/innodb-consistent.result35
-rw-r--r--storage/innobase/mysql-test/innodb-consistent.test58
-rw-r--r--storage/innobase/mysql-test/innodb-zip.result2
-rw-r--r--storage/innobase/mysql-test/innodb-zip.test2
-rw-r--r--storage/innobase/mysql-test/innodb_bug34300.test2
-rw-r--r--storage/innobase/mysql-test/innodb_bug36169.test4
-rw-r--r--storage/innobase/mysql-test/innodb_bug36172.test6
-rw-r--r--storage/innobase/mysql-test/innodb_bug44369.result14
-rw-r--r--storage/innobase/mysql-test/innodb_bug44369.test21
-rw-r--r--storage/innobase/mysql-test/innodb_bug44571.result9
-rw-r--r--storage/innobase/mysql-test/innodb_bug44571.test17
-rw-r--r--storage/innobase/mysql-test/innodb_bug46000.result17
-rw-r--r--storage/innobase/mysql-test/innodb_bug46000.test34
-rw-r--r--storage/innobase/mysql-test/innodb_file_format.result1
-rw-r--r--storage/innobase/mysql-test/innodb_file_format.test1
17 files changed, 224 insertions, 2 deletions
diff --git a/storage/innobase/mysql-test/innodb-analyze.test b/storage/innobase/mysql-test/innodb-analyze.test
index d5d6d698170..9bdb9db697c 100644
--- a/storage/innobase/mysql-test/innodb-analyze.test
+++ b/storage/innobase/mysql-test/innodb-analyze.test
@@ -11,6 +11,7 @@
-- disable_result_log
-- enable_warnings
+let $sample_pages=`select @@innodb_stats_sample_pages`;
SET GLOBAL innodb_stats_sample_pages=0;
# check that the value has been adjusted to 1
@@ -61,3 +62,4 @@ SET GLOBAL innodb_stats_sample_pages=16;
ANALYZE TABLE innodb_analyze;
DROP TABLE innodb_analyze;
+EVAL SET GLOBAL innodb_stats_sample_pages=$sample_pages;
diff --git a/storage/innobase/mysql-test/innodb-consistent-master.opt b/storage/innobase/mysql-test/innodb-consistent-master.opt
new file mode 100644
index 00000000000..8cca44767da
--- /dev/null
+++ b/storage/innobase/mysql-test/innodb-consistent-master.opt
@@ -0,0 +1 @@
+--innodb_lock_wait_timeout=2
diff --git a/storage/innobase/mysql-test/innodb-consistent.result b/storage/innobase/mysql-test/innodb-consistent.result
new file mode 100644
index 00000000000..9115791b99c
--- /dev/null
+++ b/storage/innobase/mysql-test/innodb-consistent.result
@@ -0,0 +1,35 @@
+drop table if exists t1;
+set session transaction isolation level read committed;
+create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
+create table t2 like t1;
+insert into t2 values (1),(2),(3),(4),(5),(6),(7);
+set autocommit=0;
+begin;
+replace into t1 select * from t2;
+set session transaction isolation level read committed;
+set autocommit=0;
+delete from t2 where a=5;
+commit;
+delete from t2;
+commit;
+commit;
+begin;
+insert into t1 select * from t2;
+set session transaction isolation level read committed;
+set autocommit=0;
+delete from t2 where a=5;
+commit;
+delete from t2;
+commit;
+commit;
+select * from t1;
+a
+1
+2
+3
+4
+5
+6
+7
+drop table t1;
+drop table t2;
diff --git a/storage/innobase/mysql-test/innodb-consistent.test b/storage/innobase/mysql-test/innodb-consistent.test
new file mode 100644
index 00000000000..791600fc8a7
--- /dev/null
+++ b/storage/innobase/mysql-test/innodb-consistent.test
@@ -0,0 +1,58 @@
+-- source include/not_embedded.inc
+-- source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+# REPLACE INTO ... SELECT and INSERT INTO ... SELECT should do
+# a consistent read of the source table.
+
+connect (a,localhost,root,,);
+connect (b,localhost,root,,);
+connection a;
+set session transaction isolation level read committed;
+create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
+create table t2 like t1;
+insert into t2 values (1),(2),(3),(4),(5),(6),(7);
+set autocommit=0;
+
+# REPLACE INTO ... SELECT case
+begin;
+# this should not result in any locks on t2.
+replace into t1 select * from t2;
+
+connection b;
+set session transaction isolation level read committed;
+set autocommit=0;
+# should not cuase a lock wait.
+delete from t2 where a=5;
+commit;
+delete from t2;
+commit;
+connection a;
+commit;
+
+# INSERT INTO ... SELECT case
+begin;
+# this should not result in any locks on t2.
+insert into t1 select * from t2;
+
+connection b;
+set session transaction isolation level read committed;
+set autocommit=0;
+# should not cuase a lock wait.
+delete from t2 where a=5;
+commit;
+delete from t2;
+commit;
+connection a;
+commit;
+
+select * from t1;
+drop table t1;
+drop table t2;
+
+connection default;
+disconnect a;
+disconnect b;
diff --git a/storage/innobase/mysql-test/innodb-zip.result b/storage/innobase/mysql-test/innodb-zip.result
index c81401743a5..b26c4112826 100644
--- a/storage/innobase/mysql-test/innodb-zip.result
+++ b/storage/innobase/mysql-test/innodb-zip.result
@@ -141,7 +141,7 @@ drop table t1;
CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(439)))
+CREATE TABLE t1(c TEXT, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
diff --git a/storage/innobase/mysql-test/innodb-zip.test b/storage/innobase/mysql-test/innodb-zip.test
index ddc39d44487..5bcd0e3c824 100644
--- a/storage/innobase/mysql-test/innodb-zip.test
+++ b/storage/innobase/mysql-test/innodb-zip.test
@@ -105,7 +105,7 @@ drop table t1;
--error ER_TOO_BIG_ROWSIZE
CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(439)))
+CREATE TABLE t1(c TEXT, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
diff --git a/storage/innobase/mysql-test/innodb_bug34300.test b/storage/innobase/mysql-test/innodb_bug34300.test
index 114bcf98c25..68c385fd72a 100644
--- a/storage/innobase/mysql-test/innodb_bug34300.test
+++ b/storage/innobase/mysql-test/innodb_bug34300.test
@@ -9,6 +9,7 @@
-- disable_result_log
# set packet size and reconnect
+let $max_packet=`select @@global.max_allowed_packet`;
SET @@global.max_allowed_packet=16777216;
--connect (newconn, localhost, root,,)
@@ -30,3 +31,4 @@ ALTER TABLE bug34300 ADD COLUMN (f10 INT);
SELECT f4, f8 FROM bug34300;
DROP TABLE bug34300;
+EVAL SET @@global.max_allowed_packet=$max_packet;
diff --git a/storage/innobase/mysql-test/innodb_bug36169.test b/storage/innobase/mysql-test/innodb_bug36169.test
index d3566d3eb39..5bf55193b5c 100644
--- a/storage/innobase/mysql-test/innodb_bug36169.test
+++ b/storage/innobase/mysql-test/innodb_bug36169.test
@@ -5,6 +5,8 @@
-- source include/have_innodb.inc
+let $file_format=`select @@innodb_file_format`;
+let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=ON;
@@ -1153,3 +1155,5 @@ DROP TABLE IF EXISTS table4;
DROP TABLE IF EXISTS table5;
DROP TABLE IF EXISTS table6;
+EVAL SET GLOBAL innodb_file_format=$file_format;
+EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
diff --git a/storage/innobase/mysql-test/innodb_bug36172.test b/storage/innobase/mysql-test/innodb_bug36172.test
index 666d4a2f4b7..c6c4e6fae47 100644
--- a/storage/innobase/mysql-test/innodb_bug36172.test
+++ b/storage/innobase/mysql-test/innodb_bug36172.test
@@ -14,6 +14,9 @@ SET storage_engine=InnoDB;
-- disable_query_log
-- disable_result_log
+let $file_format=`select @@innodb_file_format`;
+let $file_format_check=`select @@innodb_file_format_check`;
+let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=on;
@@ -24,3 +27,6 @@ CHECK TABLE table0 EXTENDED;
INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.9055146948, `col21` = 4293243420.5621204000, `col22` = '20511211123705', `col23` = 4289899778.6573381000, `col24` = 4293449279.0540481000, `col25` = 'emphysemic', `col26` = 'dentally', `col27` = '2347406', `col28` = 'eruct', `col30` = 1222, `col31` = 4294372994.9941406000, `col32` = 4291385574.1173744000, `col33` = 'borrowing\'s', `col34` = 'septics', `col35` = 'ratter\'s', `col36` = 'Kaye', `col37` = 'Florentia', `col38` = 'allium', `col39` = 'barkeep', `col40` = '19510407003441', `col41` = 4293559200.4215522000, `col42` = 22482, `col43` = 'decussate', `col44` = 'Brom\'s', `col45` = 'violated', `col46` = 4925506.4635456400, `col47` = 930549, `col48` = '51296066', `col49` = 'voluminously', `col50` = '29306676', `col51` = -88, `col52` = -2153690, `col53` = 4290250202.1464887000, `col54` = 'expropriation', `col55` = 'Aberdeen\'s', `col56` = 20343, `col58` = '19640415171532', `col59` = 'extern', `col60` = 'Ubana', `col61` = 4290487961.8539081000, `col62` = '2147', `col63` = -24271, `col64` = '20750801194548', `col65` = 'Cunaxa\'s', `col66` = 'pasticcio', `col67` = 2795817, `col68` = 'Indore\'s', `col70` = 6864127, `col71` = '1817832', `col72` = '20540506114211', `col73` = '20040101012300', `col74` = 'rationalized', `col75` = '45522', `col76` = 'indene', `col77` = -6964559, `col78` = 4247535.5266884370, `col79` = '20720416124357', `col80` = '2143', `col81` = 4292060102.4466386000, `col82` = 'striving', `col83` = 'boneblack\'s', `col84` = 'redolent', `col85` = 6489697.9009369183, `col86` = 4287473465.9731131000, `col87` = 7726015, `col88` = 'perplexed', `col89` = '17153791', `col90` = 5478587.1108127078, `col91` = 4287091404.7004304000, `col92` = 'Boulez\'s', `col93` = '2931278';
CHECK TABLE table0 EXTENDED;
DROP TABLE table0;
+EVAL SET GLOBAL innodb_file_format=$file_format;
+EVAL SET GLOBAL innodb_file_format_check=$file_format_check;
+EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
diff --git a/storage/innobase/mysql-test/innodb_bug44369.result b/storage/innobase/mysql-test/innodb_bug44369.result
new file mode 100644
index 00000000000..e4b84ecac19
--- /dev/null
+++ b/storage/innobase/mysql-test/innodb_bug44369.result
@@ -0,0 +1,14 @@
+create table bug44369 (DB_ROW_ID int) engine=innodb;
+ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
+create table bug44369 (db_row_id int) engine=innodb;
+ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
+show errors;
+Level Code Message
+Error 1005 Error creating table 'test/bug44369' with column name 'db_row_id'. 'db_row_id' is a reserved name. Please try to re-create the table with a different column name.
+Error 1005 Can't create table 'test.bug44369' (errno: -1)
+create table bug44369 (db_TRX_Id int) engine=innodb;
+ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
+show errors;
+Level Code Message
+Error 1005 Error creating table 'test/bug44369' with column name 'db_TRX_Id'. 'db_TRX_Id' is a reserved name. Please try to re-create the table with a different column name.
+Error 1005 Can't create table 'test.bug44369' (errno: -1)
diff --git a/storage/innobase/mysql-test/innodb_bug44369.test b/storage/innobase/mysql-test/innodb_bug44369.test
new file mode 100644
index 00000000000..495059eb5e6
--- /dev/null
+++ b/storage/innobase/mysql-test/innodb_bug44369.test
@@ -0,0 +1,21 @@
+# This is the test for bug 44369. We should
+# block table creation with columns match
+# some innodb internal reserved key words,
+# both case sensitively and insensitely.
+
+--source include/have_innodb.inc
+
+# This create table operation should fail.
+--error ER_CANT_CREATE_TABLE
+create table bug44369 (DB_ROW_ID int) engine=innodb;
+
+# This create should fail as well
+--error ER_CANT_CREATE_TABLE
+create table bug44369 (db_row_id int) engine=innodb;
+
+show errors;
+
+--error ER_CANT_CREATE_TABLE
+create table bug44369 (db_TRX_Id int) engine=innodb;
+
+show errors;
diff --git a/storage/innobase/mysql-test/innodb_bug44571.result b/storage/innobase/mysql-test/innodb_bug44571.result
new file mode 100644
index 00000000000..36374edcb3e
--- /dev/null
+++ b/storage/innobase/mysql-test/innodb_bug44571.result
@@ -0,0 +1,9 @@
+CREATE TABLE bug44571 (foo INT) ENGINE=InnoDB;
+ALTER TABLE bug44571 CHANGE foo bar INT;
+ALTER TABLE bug44571 ADD INDEX bug44571b (foo);
+ERROR 42000: Key column 'foo' doesn't exist in table
+ALTER TABLE bug44571 ADD INDEX bug44571b (bar);
+ERROR HY000: Incorrect key file for table 'bug44571'; try to repair it
+CREATE INDEX bug44571b ON bug44571 (bar);
+ERROR HY000: Incorrect key file for table 'bug44571'; try to repair it
+DROP TABLE bug44571;
diff --git a/storage/innobase/mysql-test/innodb_bug44571.test b/storage/innobase/mysql-test/innodb_bug44571.test
new file mode 100644
index 00000000000..685463ceff9
--- /dev/null
+++ b/storage/innobase/mysql-test/innodb_bug44571.test
@@ -0,0 +1,17 @@
+#
+# Bug#44571 InnoDB Plugin crashes on ADD INDEX
+# http://bugs.mysql.com/44571
+#
+-- source include/have_innodb.inc
+
+CREATE TABLE bug44571 (foo INT) ENGINE=InnoDB;
+ALTER TABLE bug44571 CHANGE foo bar INT;
+-- error ER_KEY_COLUMN_DOES_NOT_EXITS
+ALTER TABLE bug44571 ADD INDEX bug44571b (foo);
+# The following will fail, because the CHANGE foo bar was
+# not communicated to InnoDB.
+--error ER_NOT_KEYFILE
+ALTER TABLE bug44571 ADD INDEX bug44571b (bar);
+--error ER_NOT_KEYFILE
+CREATE INDEX bug44571b ON bug44571 (bar);
+DROP TABLE bug44571;
diff --git a/storage/innobase/mysql-test/innodb_bug46000.result b/storage/innobase/mysql-test/innodb_bug46000.result
new file mode 100644
index 00000000000..ccff888a48d
--- /dev/null
+++ b/storage/innobase/mysql-test/innodb_bug46000.result
@@ -0,0 +1,17 @@
+create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb;
+ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
+create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb;
+ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
+show errors;
+Level Code Message
+Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
+Error 1005 Can't create table 'test.bug46000' (errno: -1)
+create table bug46000(id int) engine=innodb;
+create index GEN_CLUST_INDEX on bug46000(id);
+ERROR HY000: Can't create table '#sql-temporary' (errno: -1)
+show errors;
+Level Code Message
+Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
+Error 1005 Can't create table '#sql-temporary' (errno: -1)
+create index idx on bug46000(id);
+drop table bug46000;
diff --git a/storage/innobase/mysql-test/innodb_bug46000.test b/storage/innobase/mysql-test/innodb_bug46000.test
new file mode 100644
index 00000000000..80c18c58ef0
--- /dev/null
+++ b/storage/innobase/mysql-test/innodb_bug46000.test
@@ -0,0 +1,34 @@
+# This is the test for bug 46000. We shall
+# block any index creation with the name of
+# "GEN_CLUST_INDEX", which is the reserved
+# name for innodb default primary index.
+
+--source include/have_innodb.inc
+
+# This 'create table' operation should fail because of
+# using the reserve name as its index name.
+--error ER_CANT_CREATE_TABLE
+create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb;
+
+# Mixed upper/lower case of the reserved key words
+--error ER_CANT_CREATE_TABLE
+create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb;
+
+show errors;
+
+create table bug46000(id int) engine=innodb;
+
+# This 'create index' operation should fail.
+--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+create index GEN_CLUST_INDEX on bug46000(id);
+
+--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
+show errors;
+
+# This 'create index' operation should succeed, no
+# temp table left from last failed create index
+# operation.
+create index idx on bug46000(id);
+
+drop table bug46000;
diff --git a/storage/innobase/mysql-test/innodb_file_format.result b/storage/innobase/mysql-test/innodb_file_format.result
index 9cfac5f001c..8e9a317308b 100644
--- a/storage/innobase/mysql-test/innodb_file_format.result
+++ b/storage/innobase/mysql-test/innodb_file_format.result
@@ -42,3 +42,4 @@ ERROR HY000: Incorrect arguments to SET
select @@innodb_file_format_check;
@@innodb_file_format_check
Barracuda
+set global innodb_file_format_check=antelope;
diff --git a/storage/innobase/mysql-test/innodb_file_format.test b/storage/innobase/mysql-test/innodb_file_format.test
index 62ce4157183..d63c9b0228f 100644
--- a/storage/innobase/mysql-test/innodb_file_format.test
+++ b/storage/innobase/mysql-test/innodb_file_format.test
@@ -26,3 +26,4 @@ set global innodb_file_format=on;
--error ER_WRONG_ARGUMENTS
set global innodb_file_format=off;
select @@innodb_file_format_check;
+set global innodb_file_format_check=antelope;