summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-11-03 19:17:05 +0100
committerSergei Golubchik <sergii@pisem.net>2011-11-03 19:17:05 +0100
commit0e007344eae972b9be7d88ca43373cb33662ac1c (patch)
tree7b3561cb3ea2ad24d013e847680ec165f406387e /mysql-test/suite
parent3794110f0215f0631107c2694dc0f1675a4bb520 (diff)
parent681476255147dacac7e3674b6cd2ae770fee2208 (diff)
downloadmariadb-git-0e007344eae972b9be7d88ca43373cb33662ac1c.tar.gz
mysql-5.5.18 merge
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_blackhole.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_unsafe.result38
-rw-r--r--mysql-test/suite/binlog/t/binlog_unsafe.test48
-rw-r--r--mysql-test/suite/federated/my.cnf2
-rw-r--r--mysql-test/suite/innodb/r/innodb-index.result133
-rw-r--r--mysql-test/suite/innodb/r/innodb-zip.result114
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug52745.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug53591.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug59733.result18
-rw-r--r--mysql-test/suite/innodb/r/innodb_corrupt_bit.result81
-rw-r--r--mysql-test/suite/innodb/r/innodb_file_format.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_index_large_prefix.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result1
-rw-r--r--mysql-test/suite/innodb/t/disabled.def2
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc-44030.test9
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb-create-options.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-index.test149
-rw-r--r--mysql-test/suite/innodb/t/innodb-zip.test22
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug36172.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug47167-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug52745.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53591.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56680.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug59733.test53
-rw-r--r--mysql-test/suite/innodb/t/innodb_corrupt_bit.test120
-rw-r--r--mysql-test/suite/innodb/t/innodb_file_format-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_file_format.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_index_large_prefix.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test2
-rw-r--r--mysql-test/suite/percona/disabled.def3
-rw-r--r--mysql-test/suite/percona/percona_server_variables_release.test2
-rw-r--r--mysql-test/suite/perfschema/include/cleanup_helper.inc19
-rw-r--r--mysql-test/suite/perfschema/include/privilege.inc4
-rw-r--r--mysql-test/suite/perfschema/include/start_server_common.inc4
-rw-r--r--mysql-test/suite/perfschema/include/upgrade_check.inc6
-rw-r--r--mysql-test/suite/perfschema/r/all_instances.result7
-rw-r--r--mysql-test/suite/perfschema/r/relaylog.result20
-rw-r--r--mysql-test/suite/perfschema/r/selects.result2
-rw-r--r--mysql-test/suite/perfschema/t/all_instances.test4
-rw-r--r--mysql-test/suite/perfschema/t/cnf_option.cnf4
-rw-r--r--mysql-test/suite/perfschema/t/disabled.def4
-rw-r--r--mysql-test/suite/perfschema/t/relaylog.test18
-rw-r--r--mysql-test/suite/perfschema/t/selects.test6
-rw-r--r--mysql-test/suite/perfschema_stress/README4
-rw-r--r--mysql-test/suite/perfschema_stress/include/settings.inc4
-rw-r--r--mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_checksum.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_duplicate.result29
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_ignore.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_select.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_known_bugs_detection.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_manual_change_index_file.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_corruption.result49
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_reset_slave.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_reset_slave.result8
-rw-r--r--mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test64
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_duplicate.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_select.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_known_bugs_detection.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_corruption.test115
-rw-r--r--mysql-test/suite/stress/t/wrapper.test29
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result127
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result66
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_force_load_corrupted_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result93
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result92
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_rollback_segments_basic.result65
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_stats_method_basic.result84
-rw-r--r--mysql-test/suite/sys_vars/r/max_join_size_func.result4
-rw-r--r--mysql-test/suite/sys_vars/r/plugin_dir_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_selects_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/sql_max_join_size_func.result2
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_dbug_fsync_sleep_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/debug_crc_break_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/disabled.def3
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test112
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_format_max_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test61
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test102
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test71
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test24
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test70
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test59
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test73
-rw-r--r--mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/plugin_dir_basic.test16
100 files changed, 2240 insertions, 390 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
index 7e79186e7bc..e76f6b494f9 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
@@ -99,6 +99,8 @@ alter table t1 drop b;
create table t3 like t1;
insert into t1 select * from t3;
replace into t1 select * from t3;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
select * from t1;
a
select * from t2;
diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result
index e8449f0cd11..17ad4c6e5b1 100644
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result
@@ -2352,6 +2352,7 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
UPDATE t1 SET a=1 LIMIT 1;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.
@@ -2368,6 +2369,7 @@ END|
CALL p1();
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
DROP PROCEDURE p1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
@@ -2650,4 +2652,40 @@ a
13:46:40
1970-01-12 13:46:40
DROP TABLE t1;
+CREATE TABLE filler_table (a INT, b INT);
+INSERT INTO filler_table values (1,1),(1,2);
+CREATE TABLE insert_table (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE replace_table (a INT, b INT, PRIMARY KEY(a));
+INSERT INTO replace_table values (1,1),(2,2);
+CREATE TABLE update_table (a INT, b INT, PRIMARY KEY(a));
+INSERT INTO update_table values (1,1),(2,2);
+INSERT IGNORE INTO insert_table SELECT * FROM filler_table;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.
+TRUNCATE TABLE insert_table;
+INSERT INTO insert_table SELECT * FROM filler_table ON DUPLICATE KEY UPDATE a = 1;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.
+TRUNCATE TABLE insert_table;
+REPLACE INTO replace_table SELECT * FROM filler_table;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
+UPDATE IGNORE update_table SET a=2;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.
+CREATE TABLE create_ignore_test (a INT, b INT, PRIMARY KEY(b)) IGNORE SELECT * FROM filler_table;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.
+CREATE TABLE create_replace_test (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
+CREATE TEMPORARY TABLE temp1 (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
+DROP TABLE filler_table;
+DROP TABLE insert_table;
+DROP TABLE update_table;
+DROP TABLE replace_table;
+DROP TABLE create_ignore_test;
+DROP TABLE create_replace_test;
"End of tests"
diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test
index 9fbdc9fc2c8..c64b9197b51 100644
--- a/mysql-test/suite/binlog/t/binlog_unsafe.test
+++ b/mysql-test/suite/binlog/t/binlog_unsafe.test
@@ -12,6 +12,11 @@
# - insert into two autoinc columns;
# - statements using UDF's.
# - statements reading from log tables in the mysql database.
+# - INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
+# - REPLACE ... SELECT
+# - CREATE TABLE [IGNORE/REPLACE] SELECT
+# - INSERT IGNORE...SELECT
+# - UPDATE IGNORE
#
# Note that statements that use stored functions, stored procedures,
# triggers, views, or prepared statements that invoke unsafe
@@ -79,6 +84,7 @@
# BUG#45785: LIMIT in SP does not cause RBL if binlog_format=MIXED
# BUG#47995: Mark user functions as unsafe
# BUG#49222: Mark RAND() unsafe
+# BUG#11758262: MARK INSERT...SEL...ON DUP KEY UPD,REPLACE...SEL,CREATE...[IGN|REPL] SEL
#
# ==== Related test cases ====
#
@@ -700,5 +706,47 @@ INSERT INTO t1 VALUES
SELECT * FROM t1;
DROP TABLE t1;
+#
+#BUG#11758262-50439: MARK INSERT...SEL...ON DUP KEY UPD,REPLACE..
+#The following statement may be unsafe when logged in statement format.
+#INSERT IGNORE...SELECT
+#INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
+#REPLACE ... SELECT
+#UPDATE IGNORE
+#CREATE TABLE... IGNORE SELECT
+#CREATE TABLE... REPLACE SELECT
+
+#setup tables
+CREATE TABLE filler_table (a INT, b INT);
+INSERT INTO filler_table values (1,1),(1,2);
+CREATE TABLE insert_table (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE replace_table (a INT, b INT, PRIMARY KEY(a));
+INSERT INTO replace_table values (1,1),(2,2);
+CREATE TABLE update_table (a INT, b INT, PRIMARY KEY(a));
+INSERT INTO update_table values (1,1),(2,2);
+
+#INSERT IGNORE... SELECT
+INSERT IGNORE INTO insert_table SELECT * FROM filler_table;
+TRUNCATE TABLE insert_table;
+#INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
+INSERT INTO insert_table SELECT * FROM filler_table ON DUPLICATE KEY UPDATE a = 1;
+TRUNCATE TABLE insert_table;
+#REPLACE...SELECT
+REPLACE INTO replace_table SELECT * FROM filler_table;
+#UPDATE IGNORE
+UPDATE IGNORE update_table SET a=2;
+#CREATE TABLE [IGNORE/REPLACE] SELECT
+CREATE TABLE create_ignore_test (a INT, b INT, PRIMARY KEY(b)) IGNORE SELECT * FROM filler_table;
+CREATE TABLE create_replace_test (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
+#temporary tables should not throw the warning.
+CREATE TEMPORARY TABLE temp1 (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
+
+###clean up
+DROP TABLE filler_table;
+DROP TABLE insert_table;
+DROP TABLE update_table;
+DROP TABLE replace_table;
+DROP TABLE create_ignore_test;
+DROP TABLE create_replace_test;
--echo "End of tests"
diff --git a/mysql-test/suite/federated/my.cnf b/mysql-test/suite/federated/my.cnf
index 88344ae59ae..ec27e189179 100644
--- a/mysql-test/suite/federated/my.cnf
+++ b/mysql-test/suite/federated/my.cnf
@@ -3,7 +3,7 @@
!include include/default_client.cnf
[mysqld.1]
-log-bin= master-bin
+#log-bin= master-bin
[mysqld.2]
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result
index 7d7062c9161..a33099661aa 100644
--- a/mysql-test/suite/innodb/r/innodb-index.result
+++ b/mysql-test/suite/innodb/r/innodb-index.result
@@ -1,3 +1,121 @@
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+CREATE TABLE t1_purge (
+A INT,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+CREATE TABLE t2_purge (
+A INT PRIMARY KEY,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB, I BLOB,
+J BLOB, K BLOB, L BLOB,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+CREATE TABLE t3_purge (
+A INT,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+CREATE TABLE t4_purge (
+A INT PRIMARY KEY,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
+J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+SET @r=REPEAT('a',500);
+CREATE TABLE t12637786(a INT,
+v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
+v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
+v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
+v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
+v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
+v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON t12637786(a,v1);
+INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE t12637786 SET a=1000;
+DELETE FROM t12637786;
+create table t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
+i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
+engine=innodb row_format=dynamic;
+SET @r = repeat('a', 767);
+insert into t12963823 values (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
+create index ndx_a on t12963823 (a(500));
+create index ndx_b on t12963823 (b(500));
+create index ndx_c on t12963823 (c(500));
+create index ndx_d on t12963823 (d(500));
+create index ndx_e on t12963823 (e(500));
+create index ndx_f on t12963823 (f(500));
+create index ndx_k on t12963823 (k(500));
+create index ndx_l on t12963823 (l(500));
+SET @r = repeat('b', 500);
+update t12963823 set a=@r,b=@r,c=@r,d=@r;
+update t12963823 set e=@r,f=@r,g=@r,h=@r;
+update t12963823 set i=@r,j=@r,k=@r,l=@r;
+update t12963823 set m=@r,n=@r,o=@r,p=@r;
+alter table t12963823 drop index ndx_a;
+alter table t12963823 drop index ndx_b;
+create index ndx_g on t12963823 (g(500));
+create index ndx_h on t12963823 (h(500));
+create index ndx_i on t12963823 (i(500));
+create index ndx_j on t12963823 (j(500));
+create index ndx_m on t12963823 (m(500));
+create index ndx_n on t12963823 (n(500));
+create index ndx_o on t12963823 (o(500));
+create index ndx_p on t12963823 (p(500));
+show create table t12963823;
+Table Create Table
+t12963823 CREATE TABLE `t12963823` (
+ `a` blob,
+ `b` blob,
+ `c` blob,
+ `d` blob,
+ `e` blob,
+ `f` blob,
+ `g` blob,
+ `h` blob,
+ `i` blob,
+ `j` blob,
+ `k` blob,
+ `l` blob,
+ `m` blob,
+ `n` blob,
+ `o` blob,
+ `p` blob,
+ KEY `ndx_c` (`c`(500)),
+ KEY `ndx_d` (`d`(500)),
+ KEY `ndx_e` (`e`(500)),
+ KEY `ndx_f` (`f`(500)),
+ KEY `ndx_k` (`k`(500)),
+ KEY `ndx_l` (`l`(500)),
+ KEY `ndx_g` (`g`(500)),
+ KEY `ndx_h` (`h`(500)),
+ KEY `ndx_i` (`i`(500)),
+ KEY `ndx_j` (`j`(500)),
+ KEY `ndx_m` (`m`(500)),
+ KEY `ndx_n` (`n`(500)),
+ KEY `ndx_o` (`o`(500)),
+ KEY `ndx_p` (`p`(500))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+set global innodb_file_per_table=0;
+set global innodb_file_format=Antelope;
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
commit;
@@ -918,6 +1036,15 @@ ERROR HY000: Too big row
alter table t1 row_format=compact;
create index t1u on t1 (u(767));
drop table t1;
+CREATE TABLE bug12547647(
+a INT NOT NULL, b BLOB NOT NULL, c TEXT,
+PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7751));
+COMMIT;
+UPDATE bug12547647 SET c = REPEAT('b',16928);
+ERROR HY000: Undo log record is too big.
+DROP TABLE bug12547647;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
set global innodb_file_format_max=Antelope;
@@ -1085,3 +1212,9 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
+SELECT SLEEP(10);
+SLEEP(10)
+0
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
+DROP TABLE t12637786;
+DROP TABLE t12963823;
diff --git a/mysql-test/suite/innodb/r/innodb-zip.result b/mysql-test/suite/innodb/r/innodb-zip.result
index a63ddff15ce..94f3bc71af1 100644
--- a/mysql-test/suite/innodb/r/innodb-zip.result
+++ b/mysql-test/suite/innodb/r/innodb-zip.result
@@ -63,42 +63,42 @@ row_format=compressed;
create table t14(a int primary key) engine=innodb key_block_size=9;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t0 Compact
-test t00 Compact
-test t1 Compact
-test t10 Dynamic
-test t11 Compressed
-test t12 Compressed
-test t13 Compressed
-test t14 Compact
-test t2 Redundant
-test t3 Compact
-test t4 Compact
-test t5 Redundant
-test t6 Redundant
-test t7 Redundant
-test t8 Compact
-test t9 Compact
+table_schema table_name row_format data_length index_length
+test t0 Compact 16384 0
+test t00 Compact 16384 0
+test t1 Compact 16384 0
+test t10 Dynamic 16384 0
+test t11 Compressed 1024 0
+test t12 Compressed 1024 0
+test t13 Compressed 8192 0
+test t14 Compact 16384 0
+test t2 Redundant 16384 0
+test t3 Compact 16384 0
+test t4 Compact 16384 0
+test t5 Redundant 16384 0
+test t6 Redundant 16384 0
+test t7 Redundant 16384 0
+test t8 Compact 16384 0
+test t9 Compact 16384 0
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
alter table t1 key_block_size=0;
alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Dynamic
+table_schema table_name row_format data_length index_length
+test t1 Dynamic 16384 0
alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compact
+table_schema table_name row_format data_length index_length
+test t1 Compact 16384 0
alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Redundant
+table_schema table_name row_format data_length index_length
+test t1 Redundant 16384 0
drop table t1;
create table t1(a int not null, b text, index(b(10))) engine=innodb
key_block_size=1;
@@ -115,11 +115,11 @@ rollback;
select a,left(b,40) from t1 natural join t2;
a left(b,40)
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compressed
-test t2 Compact
+table_schema table_name row_format data_length index_length
+test t1 Compressed 2048 1024
+test t2 Compact 16384 0
drop table t1,t2;
SET SESSION innodb_strict_mode = off;
CREATE TABLE t1(
@@ -207,19 +207,19 @@ create table t8 (id int primary key) engine = innodb row_format = compressed;
create table t9 (id int primary key) engine = innodb row_format = dynamic;
create table t10(id int primary key) engine = innodb row_format = compact;
create table t11(id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compact
-test t10 Compact
-test t11 Redundant
-test t3 Compressed
-test t4 Compressed
-test t5 Compressed
-test t6 Compressed
-test t7 Compressed
-test t8 Compressed
-test t9 Dynamic
+table_schema table_name row_format data_length index_length
+test t1 Compact 16384 0
+test t10 Compact 16384 0
+test t11 Redundant 16384 0
+test t3 Compressed 1024 0
+test t4 Compressed 2048 0
+test t5 Compressed 4096 0
+test t6 Compressed 8192 0
+test t7 Compressed 16384 0
+test t8 Compressed 8192 0
+test t9 Dynamic 16384 0
drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
create table t1 (id int primary key) engine = innodb
key_block_size = 8 row_format = compressed;
@@ -246,11 +246,11 @@ Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compressed
-test t5 Compressed
+table_schema table_name row_format data_length index_length
+test t1 Compressed 8192 0
+test t5 Compressed 8192 0
drop table t1, t5;
create table t1 (id int primary key) engine = innodb
key_block_size = 9 row_format = redundant;
@@ -276,9 +276,9 @@ Level Code Message
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t2' (errno: 1478)
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
+table_schema table_name row_format data_length index_length
set global innodb_file_per_table = off;
create table t1 (id int primary key) engine = innodb key_block_size = 1;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
@@ -324,11 +324,11 @@ Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t8 Compact
-test t9 Redundant
+table_schema table_name row_format data_length index_length
+test t8 Compact 16384 0
+test t9 Redundant 16384 0
drop table t8, t9;
set global innodb_file_per_table = on;
set global innodb_file_format = `0`;
@@ -376,11 +376,11 @@ Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t8 Compact
-test t9 Redundant
+table_schema table_name row_format data_length index_length
+test t8 Compact 16384 0
+test t9 Redundant 16384 0
drop table t8, t9;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
diff --git a/mysql-test/suite/innodb/r/innodb_bug52745.result b/mysql-test/suite/innodb/r/innodb_bug52745.result
index d746fb427b5..74db8b0c20a 100644
--- a/mysql-test/suite/innodb/r/innodb_bug52745.result
+++ b/mysql-test/suite/innodb/r/innodb_bug52745.result
@@ -126,5 +126,4 @@ Warning 1265 Data truncated for column 'col79' at row 1
Warning 1264 Out of range value for column 'col84' at row 1
DROP TABLE bug52745;
SET GLOBAL innodb_file_format=Antelope;
-SET GLOBAL innodb_file_format_max=Antelope;
SET GLOBAL innodb_file_per_table=0;
diff --git a/mysql-test/suite/innodb/r/innodb_bug53591.result b/mysql-test/suite/innodb/r/innodb_bug53591.result
index 9d296ffdb83..cf226464a4b 100644
--- a/mysql-test/suite/innodb/r/innodb_bug53591.result
+++ b/mysql-test/suite/innodb/r/innodb_bug53591.result
@@ -11,5 +11,4 @@ Error 139 Too big row
Error 1118 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
DROP TABLE bug53591;
SET GLOBAL innodb_file_format=Antelope;
-SET GLOBAL innodb_file_format_max=Antelope;
SET GLOBAL innodb_file_per_table=0;
diff --git a/mysql-test/suite/innodb/r/innodb_bug59733.result b/mysql-test/suite/innodb/r/innodb_bug59733.result
new file mode 100644
index 00000000000..c962cdfd677
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug59733.result
@@ -0,0 +1,18 @@
+CREATE TABLE bug59733(a INT AUTO_INCREMENT PRIMARY KEY,b CHAR(1))ENGINE=InnoDB;
+INSERT INTO bug59733 VALUES(0,'x');
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+CREATE INDEX b ON bug59733 (b);
+DELETE FROM bug59733 WHERE (a%100)=0;
+DROP INDEX b ON bug59733;
+CREATE INDEX b ON bug59733 (b);
+DROP TABLE bug59733;
diff --git a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result
new file mode 100644
index 00000000000..c88e1ed2504
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result
@@ -0,0 +1,81 @@
+set names utf8;
+CREATE TABLE corrupt_bit_test_ā(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b CHAR(100),
+c INT,
+z INT,
+INDEX(b))
+ENGINE=InnoDB;
+INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1);
+CREATE UNIQUE INDEX idxā ON corrupt_bit_test_ā(c, b);
+CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b);
+SELECT * FROM corrupt_bit_test_ā;
+a b c z
+1 x 1 1
+select @@unique_checks;
+@@unique_checks
+0
+select @@innodb_change_buffering_debug;
+@@innodb_change_buffering_debug
+1
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_ā;
+select count(*) from corrupt_bit_test_ā;
+count(*)
+1024
+CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
+INSERT INTO corrupt_bit_test_ā VALUES(13000,'x',1,1);
+CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
+check table corrupt_bit_test_ā;
+Table Op Msg_type Msg_text
+test.corrupt_bit_test_ā check Warning InnoDB: The B-tree of index "idxā" is corrupted.
+test.corrupt_bit_test_ā check Warning InnoDB: The B-tree of index "idxē" is corrupted.
+test.corrupt_bit_test_ā check error Corrupt
+select c from corrupt_bit_test_ā;
+ERROR HY000: Incorrect key file for table 'corrupt_bit_test_ā'; try to repair it
+select z from corrupt_bit_test_ā;
+ERROR HY000: Incorrect key file for table 'corrupt_bit_test_ā'; try to repair it
+show warnings;
+Level Code Message
+Warning 179 InnoDB: Index "idxē" for table "test"."corrupt_bit_test_ā" is marked as corrupted
+Error 1034 Incorrect key file for table 'corrupt_bit_test_ā'; try to repair it
+insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
+select * from corrupt_bit_test_ā use index(primary) where a = 10001;
+a b c z
+10001 a 20001 20001
+begin;
+insert into corrupt_bit_test_ā values (10002, "a", 20002, 20002);
+delete from corrupt_bit_test_ā where a = 10001;
+insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
+rollback;
+drop index idxā on corrupt_bit_test_ā;
+check table corrupt_bit_test_ā;
+Table Op Msg_type Msg_text
+test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted
+test.corrupt_bit_test_ā check error Corrupt
+set names utf8;
+select z from corrupt_bit_test_ā;
+ERROR HY000: Incorrect key file for table 'corrupt_bit_test_ā'; try to repair it
+drop index idxē on corrupt_bit_test_ā;
+select z from corrupt_bit_test_ā limit 10;
+z
+20001
+1
+1
+2
+11
+12
+21
+22
+31
+32
+drop table corrupt_bit_test_ā;
+SET GLOBAL innodb_change_buffering_debug = 0;
diff --git a/mysql-test/suite/innodb/r/innodb_file_format.result b/mysql-test/suite/innodb/r/innodb_file_format.result
index 70cfc9e4f47..82b4c6fab60 100644
--- a/mysql-test/suite/innodb/r/innodb_file_format.result
+++ b/mysql-test/suite/innodb/r/innodb_file_format.result
@@ -47,4 +47,3 @@ set global innodb_file_format_max=antelope;
set global innodb_file_format_check=off;
ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
SET GLOBAL innodb_file_format=Antelope;
-SET GLOBAL innodb_file_format_max=Antelope;
diff --git a/mysql-test/suite/innodb/r/innodb_index_large_prefix.result b/mysql-test/suite/innodb/r/innodb_index_large_prefix.result
index b8f8fcfc749..f966574506a 100644
--- a/mysql-test/suite/innodb/r/innodb_index_large_prefix.result
+++ b/mysql-test/suite/innodb/r/innodb_index_large_prefix.result
@@ -181,5 +181,4 @@ create index idx2 on worklog5743(a(767));
drop table worklog5743;
SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_per_table=0;
-SET GLOBAL innodb_file_format_max=Antelope;
SET GLOBAL innodb_large_prefix=0;
diff --git a/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result b/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
index 73d75241a10..3ab3b28d6b5 100644
--- a/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
+++ b/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
@@ -1350,5 +1350,4 @@ Warning 1071 Specified key was too long; max key length is 767 bytes
DROP TABLE worklog5743;
SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_per_table=0;
-SET GLOBAL innodb_file_format_max=Antelope;
SET GLOBAL innodb_large_prefix=0;
diff --git a/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
index 09756954b92..abd4c243912 100644
--- a/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
+++ b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
@@ -87,5 +87,4 @@ col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
DROP TABLE worklog5743;
SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_per_table=0;
-SET GLOBAL innodb_file_format_max=Antelope;
SET GLOBAL innodb_large_prefix=0;
diff --git a/mysql-test/suite/innodb/t/disabled.def b/mysql-test/suite/innodb/t/disabled.def
index 8cae44a3607..2080a009fb6 100644
--- a/mysql-test/suite/innodb/t/disabled.def
+++ b/mysql-test/suite/innodb/t/disabled.def
@@ -10,3 +10,5 @@
#
##############################################################################
+innodb-index : the fix is not in XtraDB yet
+innodb_corrupt_bit : the fix is not in XtraDB yet
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-44030.test b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test
index 6bcc901a878..7c9b7017464 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc-44030.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test
@@ -1,8 +1,6 @@
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
-
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -33,10 +31,3 @@ SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES(null);
SELECT * FROM t1;
DROP TABLE t1;
-
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test
index 4ca761b45ce..87ca1425630 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc.test
@@ -1,8 +1,6 @@
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
-
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -638,9 +636,3 @@ INSERT INTO t1 VALUES (18446744073709551615);
-- source include/restart_mysqld.inc
SHOW CREATE TABLE t1;
DROP TABLE t1;
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
diff --git a/mysql-test/suite/innodb/t/innodb-create-options.test b/mysql-test/suite/innodb/t/innodb-create-options.test
index 367a2f87dec..83155897349 100644
--- a/mysql-test/suite/innodb/t/innodb-create-options.test
+++ b/mysql-test/suite/innodb/t/innodb-create-options.test
@@ -60,7 +60,6 @@ SET storage_engine=InnoDB;
--disable_query_log
# These values can change during the test
LET $innodb_file_format_orig=`select @@innodb_file_format`;
-LET $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
LET $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
LET $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
--enable_query_log
@@ -567,7 +566,6 @@ DROP TABLE IF EXISTS t1;
--disable_query_log
EVAL SET GLOBAL innodb_file_format=$innodb_file_format_orig;
-EVAL SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
EVAL SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
EVAL SET SESSION innodb_strict_mode=$innodb_strict_mode_orig;
--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test
index 86189f1426d..2402c74fe53 100644
--- a/mysql-test/suite/innodb/t/innodb-index.test
+++ b/mysql-test/suite/innodb/t/innodb-index.test
@@ -1,7 +1,126 @@
let $MYSQLD_DATADIR= `select @@datadir`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
+let $per_table=`select @@innodb_file_per_table`;
+let $format=`select @@innodb_file_format`;
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+
+# Bug #12429576 - Test an assertion failure on purge.
+CREATE TABLE t1_purge (
+A INT,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+
+CREATE TABLE t2_purge (
+A INT PRIMARY KEY,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB, I BLOB,
+J BLOB, K BLOB, L BLOB,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+
+CREATE TABLE t3_purge (
+A INT,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+
+CREATE TABLE t4_purge (
+A INT PRIMARY KEY,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
+J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+
+# This would trigger the failure (Bug #12429576)
+# if purge gets a chance to run before DROP TABLE t1_purge, ....
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+# Instead of doing a --sleep 10, wait until the rest of the tests in
+# this file complete before dropping the tables. By then, the purge thread
+# will have delt with the updates above.
+
+# Bug#12637786 - Bad assert by purge thread for records with external data
+# used in secondary indexes.
+SET @r=REPEAT('a',500);
+CREATE TABLE t12637786(a INT,
+ v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
+ v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
+ v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
+ v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
+ v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
+ v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON t12637786(a,v1);
+INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE t12637786 SET a=1000;
+DELETE FROM t12637786;
+# We need to activate the purge thread at this point to make sure it does not
+# assert and is able to clean up the old versions of secondary index entries.
+# But instead of doing a --sleep 10, wait until the rest of the tests in
+# this file complete before dropping the table. By then, the purge thread
+# will have delt with the updates above.
+
+# Bug#12963823 - Test that the purge thread does not crash when
+# the number of indexes has changed since the UNDO record was logged.
+create table t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
+ i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
+ engine=innodb row_format=dynamic;
+SET @r = repeat('a', 767);
+insert into t12963823 values (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
+create index ndx_a on t12963823 (a(500));
+create index ndx_b on t12963823 (b(500));
+create index ndx_c on t12963823 (c(500));
+create index ndx_d on t12963823 (d(500));
+create index ndx_e on t12963823 (e(500));
+create index ndx_f on t12963823 (f(500));
+create index ndx_k on t12963823 (k(500));
+create index ndx_l on t12963823 (l(500));
+
+SET @r = repeat('b', 500);
+update t12963823 set a=@r,b=@r,c=@r,d=@r;
+update t12963823 set e=@r,f=@r,g=@r,h=@r;
+update t12963823 set i=@r,j=@r,k=@r,l=@r;
+update t12963823 set m=@r,n=@r,o=@r,p=@r;
+alter table t12963823 drop index ndx_a;
+alter table t12963823 drop index ndx_b;
+create index ndx_g on t12963823 (g(500));
+create index ndx_h on t12963823 (h(500));
+create index ndx_i on t12963823 (i(500));
+create index ndx_j on t12963823 (j(500));
+create index ndx_m on t12963823 (m(500));
+create index ndx_n on t12963823 (n(500));
+create index ndx_o on t12963823 (o(500));
+create index ndx_p on t12963823 (p(500));
+show create table t12963823;
+# We need to activate the purge thread at this point to see if it crashes
+# but instead of doing a --sleep 10, wait until the rest of the tests in
+# this file complete before dropping the table. By then, the purge thread
+# will have delt with the updates above.
+
+
+eval set global innodb_file_per_table=$per_table;
+eval set global innodb_file_format=$format;
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
@@ -356,8 +475,6 @@ explain select * from t1 where b like 'adfd%';
# end disabled45225_1
drop table t1;
-let $per_table=`select @@innodb_file_per_table`;
-let $format=`select @@innodb_file_format`;
set global innodb_file_per_table=on;
set global innodb_file_format='Barracuda';
# Test creating a table that could lead to undo log overflow.
@@ -400,6 +517,20 @@ alter table t1 row_format=compact;
create index t1u on t1 (u(767));
drop table t1;
+
+# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
+CREATE TABLE bug12547647(
+a INT NOT NULL, b BLOB NOT NULL, c TEXT,
+PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7751));
+COMMIT;
+# The following used to cause infinite undo log allocation.
+--error ER_UNDO_RECORD_TOO_BIG
+UPDATE bug12547647 SET c = REPEAT('b',16928);
+DROP TABLE bug12547647;
+
eval set global innodb_file_per_table=$per_table;
eval set global innodb_file_format=$format;
eval set global innodb_file_format_max=$format;
@@ -543,10 +674,8 @@ DROP TABLE t1;
#
#DROP TABLE t1;
# end disabled45225_2
-
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
+#this delay is needed because 45225_2 is disabled, to allow the purge to run
+SELECT SLEEP(10);
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
+DROP TABLE t12637786;
+DROP TABLE t12963823;
diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb/t/innodb-zip.test
index e28b0862166..6561feffdd4 100644
--- a/mysql-test/suite/innodb/t/innodb-zip.test
+++ b/mysql-test/suite/innodb/t/innodb-zip.test
@@ -1,7 +1,6 @@
let $per_table=`select @@innodb_file_per_table`;
let $format=`select @@innodb_file_format`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
let $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
set session innodb_strict_mode=0;
@@ -38,19 +37,19 @@ create table t13(a int primary key) engine=innodb
row_format=compressed;
create table t14(a int primary key) engine=innodb key_block_size=9;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
alter table t1 key_block_size=0;
alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1;
@@ -83,7 +82,7 @@ connection default;
disconnect a;
disconnect b;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1,t2;
@@ -194,7 +193,7 @@ create table t9 (id int primary key) engine = innodb row_format = dynamic;
create table t10(id int primary key) engine = innodb row_format = compact;
create table t11(id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
@@ -220,7 +219,7 @@ show warnings;
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1, t5;
@@ -240,7 +239,7 @@ create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = dynamic;
show warnings;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
#test valid values with innodb_file_per_table unset
@@ -270,7 +269,7 @@ show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t8, t9;
@@ -302,7 +301,7 @@ show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t8, t9;
@@ -339,5 +338,4 @@ drop table normal_table, zip_table;
-- disable_query_log
eval set global innodb_file_format=$format;
eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format_max=$innodb_file_format_max_orig;
eval set session innodb_strict_mode=$innodb_strict_mode_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_bug36172.test b/mysql-test/suite/innodb/t/innodb_bug36172.test
index 9269d54032d..30be4873df0 100644
--- a/mysql-test/suite/innodb/t/innodb_bug36172.test
+++ b/mysql-test/suite/innodb/t/innodb_bug36172.test
@@ -14,7 +14,6 @@ SET storage_engine=InnoDB;
-- disable_result_log
let $file_format=`select @@innodb_file_format`;
-let $file_format_max=`select @@innodb_file_format_max`;
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=on;
@@ -27,5 +26,4 @@ INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.90
CHECK TABLE table0 EXTENDED;
DROP TABLE table0;
EVAL SET GLOBAL innodb_file_format=$file_format;
-EVAL SET GLOBAL innodb_file_format_max=$file_format_max;
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
diff --git a/mysql-test/suite/innodb/t/innodb_bug47167-master.opt b/mysql-test/suite/innodb/t/innodb_bug47167-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug47167-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/innodb/t/innodb_bug52745.test b/mysql-test/suite/innodb/t/innodb_bug52745.test
index 25adf5c064a..252de1e2794 100644
--- a/mysql-test/suite/innodb/t/innodb_bug52745.test
+++ b/mysql-test/suite/innodb/t/innodb_bug52745.test
@@ -1,6 +1,5 @@
let $file_format=`select @@innodb_file_format`;
-let $file_format_max=`select @@innodb_file_format_max`;
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=on;
@@ -104,5 +103,4 @@ SHOW WARNINGS;
DROP TABLE bug52745;
EVAL SET GLOBAL innodb_file_format=$file_format;
-EVAL SET GLOBAL innodb_file_format_max=$file_format_max;
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
diff --git a/mysql-test/suite/innodb/t/innodb_bug53591.test b/mysql-test/suite/innodb/t/innodb_bug53591.test
index cac39c10d30..3261779a825 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53591.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53591.test
@@ -1,6 +1,5 @@
let $file_format=`select @@innodb_file_format`;
-let $file_format_max=`select @@innodb_file_format_max`;
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
@@ -17,5 +16,4 @@ SHOW WARNINGS;
DROP TABLE bug53591;
EVAL SET GLOBAL innodb_file_format=$file_format;
-EVAL SET GLOBAL innodb_file_format_max=$file_format_max;
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
diff --git a/mysql-test/suite/innodb/t/innodb_bug56680.test b/mysql-test/suite/innodb/t/innodb_bug56680.test
index 19ab5cfff21..1fcf55add60 100644
--- a/mysql-test/suite/innodb/t/innodb_bug56680.test
+++ b/mysql-test/suite/innodb/t/innodb_bug56680.test
@@ -5,7 +5,6 @@
SET @tx_isolation_orig = @@tx_isolation;
SET @innodb_file_per_table_orig = @@innodb_file_per_table;
SET @innodb_file_format_orig = @@innodb_file_format;
-SET @innodb_file_format_max_orig = @@innodb_file_format_max;
# The flag innodb_change_buffering_debug is only available in debug builds.
# It instructs InnoDB to try to evict pages from the buffer pool when
# change buffering is possible, so that the change buffer will be used
@@ -135,6 +134,5 @@ DROP TABLE bug56680;
SET GLOBAL tx_isolation = @tx_isolation_orig;
SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
SET GLOBAL innodb_file_format = @innodb_file_format_orig;
-SET GLOBAL innodb_file_format_max = @innodb_file_format_max_orig;
-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_bug59733.test b/mysql-test/suite/innodb/t/innodb_bug59733.test
new file mode 100644
index 00000000000..0b1bff51932
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug59733.test
@@ -0,0 +1,53 @@
+#
+# Bug #59733 Possible deadlock when buffered changes are to be discarded
+# in buf_page_create
+#
+-- source include/have_innodb.inc
+
+-- disable_query_log
+# The flag innodb_change_buffering_debug is only available in debug builds.
+# It instructs InnoDB to try to evict pages from the buffer pool when
+# change buffering is possible, so that the change buffer will be used
+# whenever possible.
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = 1;
+-- enable_query_log
+
+CREATE TABLE bug59733(a INT AUTO_INCREMENT PRIMARY KEY,b CHAR(1))ENGINE=InnoDB;
+
+# Create enough rows for the table, so that the insert buffer will be
+# used. There must be multiple index pages, because changes to the
+# root page are never buffered.
+
+INSERT INTO bug59733 VALUES(0,'x');
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+
+# Create the secondary index for which changes will be buffered.
+CREATE INDEX b ON bug59733 (b);
+
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+DELETE FROM bug59733 WHERE (a%100)=0;
+
+# Drop the index in order to get free pages with orphaned buffered changes.
+DROP INDEX b ON bug59733;
+
+# Create the index and attempt to reuse pages for which buffered changes exist.
+CREATE INDEX b ON bug59733 (b);
+
+DROP TABLE bug59733;
+
+-- disable_query_log
+-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
new file mode 100644
index 00000000000..34991362f98
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
@@ -0,0 +1,120 @@
+#
+# Test for persistent corrupt bit for corrupted index and table
+#
+-- source include/have_innodb.inc
+
+# This test needs debug server
+--source include/have_debug.inc
+
+-- disable_query_log
+# This test setup is extracted from bug56680.test:
+# The flag innodb_change_buffering_debug is only available in debug builds.
+# It instructs InnoDB to try to evict pages from the buffer pool when
+# change buffering is possible, so that the change buffer will be used
+# whenever possible.
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = 1;
+
+# Turn off Unique Check to create corrupted index with dup key
+SET UNIQUE_CHECKS=0;
+
+-- enable_query_log
+
+set names utf8;
+
+CREATE TABLE corrupt_bit_test_ā(
+ a INT AUTO_INCREMENT PRIMARY KEY,
+ b CHAR(100),
+ c INT,
+ z INT,
+ INDEX(b))
+ENGINE=InnoDB;
+
+INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1);
+
+# This is the first unique index we intend to corrupt
+CREATE UNIQUE INDEX idxā ON corrupt_bit_test_ā(c, b);
+
+# This is the second unique index we intend to corrupt
+CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b);
+
+SELECT * FROM corrupt_bit_test_ā;
+
+select @@unique_checks;
+select @@innodb_change_buffering_debug;
+
+# Create enough rows for the table, so that the insert buffer will be
+# used for modifying the secondary index page. There must be multiple
+# index pages, because changes to the root page are never buffered.
+
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_ā;
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_ā;
+
+select count(*) from corrupt_bit_test_ā;
+
+CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
+
+# Create a dup key error on index "idxē" and "idxā" by inserting a dup value
+INSERT INTO corrupt_bit_test_ā VALUES(13000,'x',1,1);
+
+# creating an index should succeed even if other secondary indexes are corrupted
+CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
+
+# Check table will find the unique indexes corrupted
+# with dup key
+check table corrupt_bit_test_ā;
+
+# This selection intend to use the corrupted index. Expect to fail
+-- error ER_NOT_KEYFILE
+select c from corrupt_bit_test_ā;
+
+-- error ER_NOT_KEYFILE
+select z from corrupt_bit_test_ā;
+
+show warnings;
+
+# Since corrupted index is a secondary index, we only disable such
+# index and allow other DML to proceed
+insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
+
+# This does not use the corrupted index, expect to succeed
+select * from corrupt_bit_test_ā use index(primary) where a = 10001;
+
+# Some more DMLs
+begin;
+insert into corrupt_bit_test_ā values (10002, "a", 20002, 20002);
+delete from corrupt_bit_test_ā where a = 10001;
+insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
+rollback;
+
+# Drop one corrupted index before reboot
+drop index idxā on corrupt_bit_test_ā;
+
+check table corrupt_bit_test_ā;
+
+set names utf8;
+
+-- error ER_NOT_KEYFILE
+select z from corrupt_bit_test_ā;
+
+# Drop the corrupted index
+drop index idxē on corrupt_bit_test_ā;
+
+# Now select back to normal
+select z from corrupt_bit_test_ā limit 10;
+
+# Drop table
+drop table corrupt_bit_test_ā;
+
+-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = 0;
diff --git a/mysql-test/suite/innodb/t/innodb_file_format-master.opt b/mysql-test/suite/innodb/t/innodb_file_format-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_file_format-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/innodb/t/innodb_file_format.test b/mysql-test/suite/innodb/t/innodb_file_format.test
index 5c80ef89ba4..115d8323050 100644
--- a/mysql-test/suite/innodb/t/innodb_file_format.test
+++ b/mysql-test/suite/innodb/t/innodb_file_format.test
@@ -1,7 +1,6 @@
-- source include/not_embedded.inc
let $innodb_file_format_orig=`select @@innodb_file_format`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
select @@innodb_file_format;
select @@innodb_file_format_check;
@@ -38,4 +37,3 @@ set global innodb_file_format_max=antelope;
set global innodb_file_format_check=off;
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_index_large_prefix.test b/mysql-test/suite/innodb/t/innodb_index_large_prefix.test
index b43ff033903..2ae0237488c 100644
--- a/mysql-test/suite/innodb/t/innodb_index_large_prefix.test
+++ b/mysql-test/suite/innodb/t/innodb_index_large_prefix.test
@@ -2,7 +2,6 @@
let $innodb_file_format_orig=`select @@innodb_file_format`;
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
set global innodb_file_format="Barracuda";
@@ -265,5 +264,4 @@ drop table worklog5743;
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test b/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
index 2ec048a0614..c702b59e81f 100644
--- a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
+++ b/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
@@ -17,7 +17,6 @@
# Save innodb variables
let $innodb_file_format_orig=`select @@innodb_file_format`;
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
# Set Innodb file format as feature works for Barracuda file format
@@ -1334,5 +1333,4 @@ DROP TABLE worklog5743;
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
index eb9f3e454a2..1f54a9b253d 100644
--- a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
+++ b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
@@ -17,7 +17,6 @@
# Save innodb variables
let $innodb_file_format_orig=`select @@innodb_file_format`;
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
# Set Innodb file format as feature works for Barracuda file format
@@ -121,6 +120,5 @@ DROP TABLE worklog5743;
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
diff --git a/mysql-test/suite/percona/disabled.def b/mysql-test/suite/percona/disabled.def
index 1dafa2e2daa..b0dc0a2a84d 100644
--- a/mysql-test/suite/percona/disabled.def
+++ b/mysql-test/suite/percona/disabled.def
@@ -15,7 +15,8 @@ percona_sql_no_fcache: Feature not merged into MariaDB
percona_status_wait_query_cache_mutex: Feature not merged into MariaDB
percona_slave_innodb_stats: Feature not merged into MariaDB
percona_query_response_time-replication: Feature not merged into MariaDB
-percona_server_variables: Feature not merged into MariaDB
+percona_server_variables_debug: Feature not merged into MariaDB
+percona_server_variables_release: Feature not merged into MariaDB
percona_slow_query_log-log_slow_verbosity: InnoDB filtering information not fully merged into MariaDB
percona_innodb_buffer_pool_shm: Requires big shmmax not default on many systems
percona_log_warnings_suppress: Feature not merged into MariaDB
diff --git a/mysql-test/suite/percona/percona_server_variables_release.test b/mysql-test/suite/percona/percona_server_variables_release.test
index f61446aeb02..b145843ab22 100644
--- a/mysql-test/suite/percona/percona_server_variables_release.test
+++ b/mysql-test/suite/percona/percona_server_variables_release.test
@@ -1,2 +1,2 @@
--source include/have_nodebug.inc
---source include/percona_server_variables.inc
+--source percona_server_variables.inc
diff --git a/mysql-test/suite/perfschema/include/cleanup_helper.inc b/mysql-test/suite/perfschema/include/cleanup_helper.inc
index b7e37849f78..7ea97ba6e92 100644
--- a/mysql-test/suite/perfschema/include/cleanup_helper.inc
+++ b/mysql-test/suite/perfschema/include/cleanup_helper.inc
@@ -1,25 +1,32 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; version 2 of
+# the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Tests for PERFORMANCE_SCHEMA
update performance_schema.setup_instruments set enabled='YES';
+connection con1;
disconnect con1;
+--source include/wait_until_disconnected.inc
+connection con2;
disconnect con2;
+--source include/wait_until_disconnected.inc
+connection con3;
disconnect con3;
+--source include/wait_until_disconnected.inc
connection default;
diff --git a/mysql-test/suite/perfschema/include/privilege.inc b/mysql-test/suite/perfschema/include/privilege.inc
index f29ef65f519..0de948d369b 100644
--- a/mysql-test/suite/perfschema/include/privilege.inc
+++ b/mysql-test/suite/perfschema/include/privilege.inc
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Tests for PERFORMANCE_SCHEMA
diff --git a/mysql-test/suite/perfschema/include/start_server_common.inc b/mysql-test/suite/perfschema/include/start_server_common.inc
index f6e549ea44e..e48bbba4d40 100644
--- a/mysql-test/suite/perfschema/include/start_server_common.inc
+++ b/mysql-test/suite/perfschema/include/start_server_common.inc
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2009 Sun Microsystems, Inc
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Tests for PERFORMANCE_SCHEMA
diff --git a/mysql-test/suite/perfschema/include/upgrade_check.inc b/mysql-test/suite/perfschema/include/upgrade_check.inc
index 3620e80002f..d8dc750bd39 100644
--- a/mysql-test/suite/perfschema/include/upgrade_check.inc
+++ b/mysql-test/suite/perfschema/include/upgrade_check.inc
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,14 +11,16 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Routine to be called by pfs_upgrade.test
# $out_file and $err_file must be set within pfs_upgrade.test.
#
+--source include/count_sessions.inc
--error 1
--exec $MYSQL_UPGRADE --skip-verbose --force > $out_file 2> $err_file
+--source include/wait_until_count_sessions.inc
# Verify that mysql_upgrade complained about the performance_schema
--cat_file $err_file
diff --git a/mysql-test/suite/perfschema/r/all_instances.result b/mysql-test/suite/perfschema/r/all_instances.result
index 59b7232dc15..356ffda13c1 100644
--- a/mysql-test/suite/perfschema/r/all_instances.result
+++ b/mysql-test/suite/perfschema/r/all_instances.result
@@ -1,5 +1,5 @@
use performance_schema;
-select name from mutex_instances group by name;
+select name from mutex_instances where name not rlike '/(DEBUG_SYNC::mutex|LOCK_des_key_file)$' group by name;
name
wait/synch/mutex/archive/archive_mutex
wait/synch/mutex/aria/LOCK_trn_list
@@ -32,7 +32,6 @@ wait/synch/mutex/mysys/THR_LOCK_open
wait/synch/mutex/mysys/THR_LOCK_threads
wait/synch/mutex/mysys/TMPDIR_mutex
wait/synch/mutex/sql/Cversion_lock
-wait/synch/mutex/sql/DEBUG_SYNC::mutex
wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state
wait/synch/mutex/sql/hash_filo::lock
wait/synch/mutex/sql/LOCK_active_mi
@@ -43,7 +42,6 @@ wait/synch/mutex/sql/LOCK_crypt
wait/synch/mutex/sql/LOCK_delayed_create
wait/synch/mutex/sql/LOCK_delayed_insert
wait/synch/mutex/sql/LOCK_delayed_status
-wait/synch/mutex/sql/LOCK_des_key_file
wait/synch/mutex/sql/LOCK_error_log
wait/synch/mutex/sql/LOCK_error_messages
wait/synch/mutex/sql/LOCK_event_queue
@@ -100,7 +98,7 @@ wait/synch/rwlock/sql/MDL_context::LOCK_waiting_for
wait/synch/rwlock/sql/MDL_lock::rwlock
wait/synch/rwlock/sql/THR_LOCK_servers
wait/synch/rwlock/sql/THR_LOCK_udf
-select name from cond_instances group by name;
+select name from cond_instances where name not rlike '/(DEBUG_SYNC::cond)$' group by name;
name
wait/synch/cond/aria/SERVICE_THREAD_CONTROL::COND_control
wait/synch/cond/aria/TRANSLOG_BUFFER::prev_sent_to_disk_cond
@@ -117,7 +115,6 @@ wait/synch/cond/sql/COND_rpl_status
wait/synch/cond/sql/COND_server_started
wait/synch/cond/sql/COND_thread_cache
wait/synch/cond/sql/COND_thread_count
-wait/synch/cond/sql/DEBUG_SYNC::cond
wait/synch/cond/sql/Event_scheduler::COND_state
wait/synch/cond/sql/Master_info::data_cond
wait/synch/cond/sql/Master_info::start_cond
diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result
index e2f8270b1f0..0a7d0a5b2be 100644
--- a/mysql-test/suite/perfschema/r/relaylog.result
+++ b/mysql-test/suite/perfschema/r/relaylog.result
@@ -52,10 +52,11 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
-where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+where event_name like "%MYSQL_BIN_LOG%"
+ and event_name not like "%MYSQL_BIN_LOG::update_cond"
+ order by event_name;
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
-wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
"Expect no slave relay log"
@@ -68,9 +69,10 @@ EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_W
wait/io/file/sql/relaylog 0 0 0 0
wait/io/file/sql/relaylog_index 0 0 0 0
select * from performance_schema.events_waits_summary_global_by_event_name
-where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+where event_name like "%MYSQL_RELAY_LOG%"
+ and event_name not like "%MYSQL_RELAY_LOG::update_cond"
+ order by event_name;
EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond 0 0 0 0 0
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0
"============ Performance schema on slave ============"
select * from performance_schema.file_summary_by_instance
@@ -123,10 +125,11 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
-where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+where event_name like "%MYSQL_BIN_LOG%"
+ and event_name not like "%MYSQL_BIN_LOG::update_cond"
+ order by event_name;
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
-wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond NONE
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
"Expect a slave relay log"
@@ -162,8 +165,9 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
-where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+where event_name like "%MYSQL_RELAY_LOG%"
+ and event_name not like "%MYSQL_RELAY_LOG::update_cond"
+ order by event_name;
EVENT_NAME COUNT_STAR
-wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond MANY
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY
include/stop_slave.inc
diff --git a/mysql-test/suite/perfschema/r/selects.result b/mysql-test/suite/perfschema/r/selects.result
index a3d0931cf4c..4c59cc3338e 100644
--- a/mysql-test/suite/perfschema/r/selects.result
+++ b/mysql-test/suite/perfschema/r/selects.result
@@ -62,6 +62,7 @@ SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE 1 = 2;
CREATE EVENT t_ps_event
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
+ON COMPLETION PRESERVE
DO INSERT INTO t_event
SELECT DISTINCT EVENT_ID
FROM performance_schema.events_waits_current
@@ -106,5 +107,6 @@ EVENT_ID
[EVENT_ID]
DROP PROCEDURE t_ps_proc;
DROP FUNCTION t_ps_func;
+DROP EVENT t_ps_event;
DROP TABLE t1;
DROP TABLE t_event;
diff --git a/mysql-test/suite/perfschema/t/all_instances.test b/mysql-test/suite/perfschema/t/all_instances.test
index eb011b2d5c7..5fe1a347a2d 100644
--- a/mysql-test/suite/perfschema/t/all_instances.test
+++ b/mysql-test/suite/perfschema/t/all_instances.test
@@ -15,8 +15,8 @@ use performance_schema;
# "where" filters out instances that can be conditionally compiled out
#
-select name from mutex_instances group by name;
+select name from mutex_instances where name not rlike '/(DEBUG_SYNC::mutex|LOCK_des_key_file)$' group by name;
select name from rwlock_instances group by name;
-select name from cond_instances group by name;
+select name from cond_instances where name not rlike '/(DEBUG_SYNC::cond)$' group by name;
select event_name from file_instances group by event_name;
select name from threads group by name;
diff --git a/mysql-test/suite/perfschema/t/cnf_option.cnf b/mysql-test/suite/perfschema/t/cnf_option.cnf
index 2892908fbb6..2be42791fb6 100644
--- a/mysql-test/suite/perfschema/t/cnf_option.cnf
+++ b/mysql-test/suite/perfschema/t/cnf_option.cnf
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Tests for PERFORMANCE_SCHEMA
# Check server start options, read from a .cnf file
diff --git a/mysql-test/suite/perfschema/t/disabled.def b/mysql-test/suite/perfschema/t/disabled.def
index 56bcf811ff6..c9f3b9a97e0 100644
--- a/mysql-test/suite/perfschema/t/disabled.def
+++ b/mysql-test/suite/perfschema/t/disabled.def
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##############################################################################
#
diff --git a/mysql-test/suite/perfschema/t/relaylog.test b/mysql-test/suite/perfschema/t/relaylog.test
index 68ba57dd502..e2798e9b707 100644
--- a/mysql-test/suite/perfschema/t/relaylog.test
+++ b/mysql-test/suite/perfschema/t/relaylog.test
@@ -41,6 +41,8 @@ drop table test.t1;
# To ensure robustness:
# - log file rotation is limited to file .000001 and .000002
# - statistics are normalized to "NONE" or "MANY"
+# - statistics on ::update_cond conditions are not collected,
+# since this is too much dependent on execution.
#
connection master;
@@ -84,7 +86,9 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
- where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+ where event_name like "%MYSQL_BIN_LOG%"
+ and event_name not like "%MYSQL_BIN_LOG::update_cond"
+ order by event_name;
-- echo "Expect no slave relay log"
@@ -95,7 +99,9 @@ select * from performance_schema.file_summary_by_event_name
where event_name like "%relaylog%" order by event_name;
select * from performance_schema.events_waits_summary_global_by_event_name
- where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+ where event_name like "%MYSQL_RELAY_LOG%"
+ and event_name not like "%MYSQL_RELAY_LOG::update_cond"
+ order by event_name;
sync_slave_with_master;
-- echo "============ Performance schema on slave ============"
@@ -142,7 +148,9 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
- where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+ where event_name like "%MYSQL_BIN_LOG%"
+ and event_name not like "%MYSQL_BIN_LOG::update_cond"
+ order by event_name;
-- echo "Expect a slave relay log"
@@ -173,7 +181,9 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
- where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+ where event_name like "%MYSQL_RELAY_LOG%"
+ and event_name not like "%MYSQL_RELAY_LOG::update_cond"
+ order by event_name;
--source include/stop_slave.inc
diff --git a/mysql-test/suite/perfschema/t/selects.test b/mysql-test/suite/perfschema/t/selects.test
index e8fd0827c53..e4541d6c6fc 100644
--- a/mysql-test/suite/perfschema/t/selects.test
+++ b/mysql-test/suite/perfschema/t/selects.test
@@ -1,4 +1,4 @@
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -97,6 +97,7 @@ SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE 1 = 2;
CREATE EVENT t_ps_event
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
+ON COMPLETION PRESERVE
DO INSERT INTO t_event
SELECT DISTINCT EVENT_ID
FROM performance_schema.events_waits_current
@@ -168,7 +169,7 @@ delimiter ;|
SELECT t_ps_func(connection_id()) = @p_id;
# We might reach this point too early which means the event scheduler has not
-# execute our "t_ps_event". Therefore we poll till the record was inserted
+# executed our "t_ps_event". Therefore we poll till the record was inserted
# and run our test statement afterwards.
let $wait_timeout= 20;
let $wait_condition= SELECT COUNT(*) = 1 FROM t_event;
@@ -179,5 +180,6 @@ SELECT * FROM t_event;
# Clean up
DROP PROCEDURE t_ps_proc;
DROP FUNCTION t_ps_func;
+DROP EVENT t_ps_event;
DROP TABLE t1;
DROP TABLE t_event;
diff --git a/mysql-test/suite/perfschema_stress/README b/mysql-test/suite/perfschema_stress/README
index 53f6f1daf35..d28287f9735 100644
--- a/mysql-test/suite/perfschema_stress/README
+++ b/mysql-test/suite/perfschema_stress/README
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
WL#4818 - Stress testing of PERFORMANCE_SCHEMA
diff --git a/mysql-test/suite/perfschema_stress/include/settings.inc b/mysql-test/suite/perfschema_stress/include/settings.inc
index fb886a86df2..224cb54a8aa 100644
--- a/mysql-test/suite/perfschema_stress/include/settings.inc
+++ b/mysql-test/suite/perfschema_stress/include/settings.inc
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
let $num_stress_rows= 5000;
let $default_engine_type= myisam;
diff --git a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result
new file mode 100644
index 00000000000..1bee6f2ec1a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result
@@ -0,0 +1,19 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Error in Log_event::read_log_event()");
+include/rpl_stop_server.inc [server_number=1]
+include/rpl_start_server.inc [server_number=1]
+show binlog events;
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
+call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
+stop slave;
+reset slave;
+start slave;
+include/wait_for_slave_param.inc [Last_IO_Errno]
+Last_IO_Errno = '1236'
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the last event was read from 'master-bin.000001' at 316, the last byte read was read from 'master-bin.000001' at 335.''
+reset master;
+stop slave;
+reset slave;
+drop table t;
+End of the tests
diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result
index 7b483c7a9e9..b6b1210f05f 100644
--- a/mysql-test/suite/rpl/r/rpl_checksum.result
+++ b/mysql-test/suite/rpl/r/rpl_checksum.result
@@ -71,7 +71,7 @@ insert into t1 values (1) /* will not be applied on slave due to simulation */;
set @@global.debug='d,simulate_slave_unaware_checksum';
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the last event was read from 'master-bin.000010' at 245, the last byte read was read from 'master-bin.000010' at 245.''
select count(*) as zero from t1;
zero
0
diff --git a/mysql-test/suite/rpl/r/rpl_insert_duplicate.result b/mysql-test/suite/rpl/r/rpl_insert_duplicate.result
deleted file mode 100644
index 61ebbaaa5a9..00000000000
--- a/mysql-test/suite/rpl/r/rpl_insert_duplicate.result
+++ /dev/null
@@ -1,29 +0,0 @@
-include/master-slave.inc
-[connection master]
-CREATE TABLE t1 (
-a INT UNSIGNED NOT NULL PRIMARY KEY
-) ENGINE=innodb;
-CREATE TABLE t2 (
-a INT UNSIGNED
-) ENGINE=innodb;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
-INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
-include/assert.inc [Sum of elements in t1 should be 1.]
-include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
-include/diff_tables.inc [master:test.t1 , slave:test.t1]
-drop table t1, t2;
-CREATE TABLE t1 (
-a INT UNSIGNED NOT NULL PRIMARY KEY
-) ENGINE=myisam;
-CREATE TABLE t2 (
-a INT UNSIGNED
-) ENGINE=myisam;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
-INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
-include/assert.inc [Sum of elements in t1 should be 1.]
-include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
-include/diff_tables.inc [master:test.t1 , slave:test.t1]
-drop table t1, t2;
-include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_ignore.result b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
index 04b64359126..1598b3c059f 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_ignore.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
@@ -26,6 +26,19 @@ include/diff_tables.inc [master:test.t1 , slave:test.t1]
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
include/assert.inc [Count of elements in t1 should be 6.]
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+DROP TABLE t1;
+DROP TABLE t2;
+CREATE TABLE t1 (
+a INT UNSIGNED NOT NULL PRIMARY KEY
+) ENGINE=innodb;
+CREATE TABLE t2 (
+a INT UNSIGNED
+) ENGINE=innodb;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
+include/assert.inc [Sum of elements in t1 should be 1.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
drop table t1, t2;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
@@ -52,5 +65,18 @@ include/diff_tables.inc [master:test.t1 , slave:test.t1]
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
include/assert.inc [Count of elements in t1 should be 6.]
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+DROP TABLE t1;
+DROP TABLE t2;
+CREATE TABLE t1 (
+a INT UNSIGNED NOT NULL PRIMARY KEY
+) ENGINE=myisam;
+CREATE TABLE t2 (
+a INT UNSIGNED
+) ENGINE=myisam;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
+include/assert.inc [Sum of elements in t1 should be 1.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
drop table t1, t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_select.result b/mysql-test/suite/rpl/r/rpl_insert_select.result
deleted file mode 100644
index d98ae2538fa..00000000000
--- a/mysql-test/suite/rpl/r/rpl_insert_select.result
+++ /dev/null
@@ -1,14 +0,0 @@
-include/master-slave.inc
-[connection master]
-create table t1 (n int not null primary key);
-insert into t1 values (1);
-create table t2 (n int);
-insert into t2 values (1);
-insert ignore into t1 select * from t2;
-insert into t1 values (2);
-select * from t1;
-n
-1
-2
-drop table t1,t2;
-include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
index 43f5c082dea..7857ba95209 100644
--- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
include/master-slave.inc
[connection master]
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
@@ -42,12 +43,16 @@ SELECT t2.field_a, t2.field_b, t2.field_c
FROM t2
ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.
INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f');
INSERT INTO t1 (field_1, field_2, field_3)
SELECT t2.field_a, t2.field_b, t2.field_c
FROM t2
ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.
SELECT * FROM t1;
id field_1 field_2 field_3
1 1 a 1a
diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
index 58d0e202110..29b11f4b950 100644
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
@@ -11,7 +11,7 @@ include/stop_slave.inc
change master to master_log_pos=MASTER_LOG_POS;
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the last event was read from 'master-bin.000001' at 247, the last byte read was read from 'master-bin.000001' at 266.''
include/stop_slave_sql.inc
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
index 23238d9c97b..a1874ed1595 100644
--- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
+++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
@@ -5,7 +5,7 @@ CREATE TABLE t1(c1 INT);
FLUSH LOGS;
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log');
include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the last event was read from 'master-bin.000002' at 375, the last byte read was read from 'master-bin.000002' at 375.''
CREATE TABLE t2(c1 INT);
FLUSH LOGS;
CREATE TABLE t3(c1 INT);
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index 6190f458367..be2f551f9c2 100644
--- a/mysql-test/suite/rpl/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -37,7 +37,7 @@ DROP TABLE t1;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the last event was read from 'master-bin.000001' at 601, the last byte read was read from 'master-bin.000001' at 620.''
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
diff --git a/mysql-test/suite/rpl/r/rpl_row_corruption.result b/mysql-test/suite/rpl/r/rpl_row_corruption.result
new file mode 100644
index 00000000000..7fd47a20f03
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_corruption.result
@@ -0,0 +1,49 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1_11753004 (c1 INT);
+CREATE TABLE t2_11753004 (c1 INT);
+INSERT INTO t1_11753004 VALUES (1);
+INSERT INTO t2_11753004 VALUES (2);
+call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
+include/stop_slave.inc
+SET @save_debug= @@global.debug;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+UPDATE t1_11753004, t2_11753004 SET t1_11753004.c1=3, t2_11753004.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004.c1=2;
+include/wait_for_slave_sql_error.inc [errno=1593 ]
+include/stop_slave.inc
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+include/rpl_reset.inc
+DROP TABLE t1_11753004, t2_11753004;
+include/stop_slave.inc
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+include/rpl_reset.inc
+CREATE TABLE t1_11753004 (c1 INT);
+CREATE TABLE t2_11753004_ign (c1 INT);
+INSERT INTO t1_11753004 VALUES (1);
+INSERT INTO t2_11753004_ign VALUES (2);
+UPDATE t1_11753004, t2_11753004_ign SET t1_11753004.c1=3, t2_11753004_ign.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004_ign.c1=2;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+BINLOG '
+SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
+'/*!*/;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+BINLOG '
+SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
+SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
+SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
+'/*!*/;
+ERROR HY000: Fatal error: Found table map event mapping table id 0 which was already mapped but with different settings.
+DROP TABLE t1,t2;
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+DROP TABLE t1_11753004;
+DROP TABLE t2_11753004_ign;
+SET GLOBAL debug= @save_debug;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
index 7dc94bab481..41fe0b1a9f3 100644
--- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
@@ -41,4 +41,12 @@ include/stop_slave_sql.inc
reset slave;
include/check_slave_no_error.inc
change master to master_user='root';
+reset slave;
+include/start_slave.inc
+include/stop_slave.inc
+reset slave all;
+start slave;
+ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
+CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
+include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
index aa8bc63a432..b1473c937a1 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
@@ -41,4 +41,12 @@ include/stop_slave_sql.inc
reset slave;
include/check_slave_no_error.inc
change master to master_user='root';
+reset slave;
+include/start_slave.inc
+include/stop_slave.inc
+reset slave all;
+start slave;
+ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
+CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
+include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
new file mode 100644
index 00000000000..71445be55e6
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
@@ -0,0 +1,64 @@
+#
+# Bug#11747416 : 32228 A disk full makes binary log corrupt.
+#
+#
+# The test demonstrates reading from binlog error propagation to slave
+# and reporting there.
+# Conditions for the bug include a crash at time of the last event to
+# the binlog was written partly. With the fixes the event is not sent out
+# any longer, but rather the dump thread sends out a sound error message.
+#
+# Crash is not simulated. A binlog with partly written event in its end is installed
+# and replication is started from it.
+#
+
+--source include/master-slave.inc
+--source include/have_binlog_format_mixed.inc
+
+call mtr.add_suppression("Error in Log_event::read_log_event()");
+
+--connection master
+--let $datadir= `SELECT @@datadir`
+
+--let $rpl_server_number= 1
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master-bin.000001
+--copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001
+
+--let $rpl_server_number= 1
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+
+# evidence of the partial binlog
+--error ER_ERROR_WHEN_EXECUTING_COMMAND
+show binlog events;
+
+--connection slave
+call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
+stop slave;
+reset slave;
+start slave;
+
+# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
+--let $slave_param=Last_IO_Errno
+--let $slave_param_value=1236
+--source include/wait_for_slave_param.inc
+
+--let $status_items= Last_IO_Errno, Last_IO_Error
+--source include/show_slave_status.inc
+
+#
+# Cleanup
+#
+
+--connection master
+reset master;
+
+--connection slave
+stop slave;
+reset slave;
+drop table t; # table was created from binlog. it does not exist on master.
+
+--echo End of the tests
diff --git a/mysql-test/suite/rpl/t/rpl_insert_duplicate.test b/mysql-test/suite/rpl/t/rpl_insert_duplicate.test
deleted file mode 100644
index 7dd38a696ae..00000000000
--- a/mysql-test/suite/rpl/t/rpl_insert_duplicate.test
+++ /dev/null
@@ -1,14 +0,0 @@
-#########################################
-# Wrapper for rpl_insert_duplicate.test #
-#########################################
--- source include/master-slave.inc
--- source include/have_innodb.inc
-#-- source include/have_binlog_format_mixed_or_statement.inc
-
-let $engine_type=innodb;
--- source extra/rpl_tests/rpl_insert_duplicate.test
-
-let $engine_type=myisam;
--- source extra/rpl_tests/rpl_insert_duplicate.test
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_insert_select.test b/mysql-test/suite/rpl/t/rpl_insert_select.test
deleted file mode 100644
index 23bc7ecd167..00000000000
--- a/mysql-test/suite/rpl/t/rpl_insert_select.test
+++ /dev/null
@@ -1,20 +0,0 @@
-# Testcase for BUG#10456 - INSERT INTO ... SELECT violating a primary key
-# breaks replication
-
--- source include/master-slave.inc
-connection master;
-
-create table t1 (n int not null primary key);
-insert into t1 values (1);
-create table t2 (n int);
-insert into t2 values (1);
-insert ignore into t1 select * from t2;
-insert into t1 values (2);
-sync_slave_with_master;
-connection slave;
-select * from t1;
-
-connection master;
-drop table t1,t2;
-sync_slave_with_master;
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
index db182d477a1..87c492e7f22 100644
--- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
@@ -3,14 +3,15 @@
# (assuming the bug is fixed in the slave, slave cannot of course
# imitate the bug, so it has to stop).
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
+
source include/have_debug.inc;
# because of pretend_version_50034_in_binlog the test can't run with checksum
source include/have_binlog_checksum_off.inc;
source include/master-slave.inc;
# Currently only statement-based-specific bugs are here
--- source include/have_binlog_format_mixed_or_statement.inc
-
+-- source include/have_binlog_format_statement.inc
#
# This is to test that slave properly detects if
diff --git a/mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt b/mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt
new file mode 100644
index 00000000000..da199510eb3
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt
@@ -0,0 +1 @@
+--replicate-ignore-table=test.t2_11753004_ign
diff --git a/mysql-test/suite/rpl/t/rpl_row_corruption.test b/mysql-test/suite/rpl/t/rpl_row_corruption.test
new file mode 100644
index 00000000000..a7650c615a3
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_corruption.test
@@ -0,0 +1,115 @@
+#
+--source include/master-slave.inc
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+
+# BUG#11753004: 44360: REPLICATION FAILED
+
+## assert that we get an error when checking the
+## identifiers at the slave (instead of a crash or
+## different table being updated)
+
+--let $t1= t1_11753004
+--let $t2= t2_11753004
+--let $t2_ign= t2_11753004_ign
+
+## test #1: assert that we get an error raised when multiple
+## tables in the same RBR statement are mapped with the
+## same identifier
+
+--eval CREATE TABLE $t1 (c1 INT)
+--eval CREATE TABLE $t2 (c1 INT)
+--eval INSERT INTO $t1 VALUES (1)
+--eval INSERT INTO $t2 VALUES (2)
+
+--sync_slave_with_master
+call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
+
+# stop the slave and inject corruption
+--source include/stop_slave.inc
+SET @save_debug= @@global.debug;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--connection master
+# both tables get mapped to 0 (in a way, simulating scenario
+# originated by BUG#56226)
+--eval UPDATE $t1, $t2 SET $t1.c1=3, $t2.c1=4 WHERE $t1.c1=1 OR $t2.c1=2
+--connection slave
+
+# wait for error 1593 (ER_SLAVE_FATAL_ERROR)
+--let $slave_sql_errno=1593
+--source include/wait_for_slave_sql_error.inc
+--source include/stop_slave.inc
+
+# clean up
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--connection master
+--source include/rpl_reset.inc
+--eval DROP TABLE $t1, $t2
+--sync_slave_with_master
+
+## test #2: assert that ignored tables that may have been mapped
+## with the same identifier are skipped, thus no error
+## is raised.
+
+--connection slave
+--source include/stop_slave.inc
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--source include/rpl_reset.inc
+--connection master
+--eval CREATE TABLE $t1 (c1 INT)
+--eval CREATE TABLE $t2_ign (c1 INT)
+--eval INSERT INTO $t1 VALUES (1)
+--eval INSERT INTO $t2_ign VALUES (2)
+--eval UPDATE $t1, $t2_ign SET $t1.c1=3, $t2_ign.c1=4 WHERE $t1.c1=1 OR $t2_ign.c1=2
+
+# must not raise error as second table is filtered
+--sync_slave_with_master
+
+
+## test #3: check that BINLOG statements will also raise an
+## error if containing table map events mapping different
+## tables to same table identifier.
+
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+# FD event
+BINLOG '
+SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
+'/*!*/;
+
+#110708 12:21:44 server id 1 end_log_pos 774 Table_map: `test`.`t1` mapped to number 66
+# at 774
+#110708 12:21:44 server id 1 end_log_pos 815 Table_map: `test`.`t2` mapped to number 67
+# at 815
+#110708 12:21:44 server id 1 end_log_pos 855 Update_rows: table id 66
+# at 855
+#110708 12:21:44 server id 1 end_log_pos 895 Update_rows: table id 67 flags: STMT_END_F
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--error ER_SLAVE_FATAL_ERROR
+BINLOG '
+SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
+SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
+SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
+'/*!*/;
+
+
+# clean up
+DROP TABLE t1,t2;
+--connection slave
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+--connection master
+--eval DROP TABLE $t1
+--eval DROP TABLE $t2_ign
+--sync_slave_with_master
+SET GLOBAL debug= @save_debug;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/stress/t/wrapper.test b/mysql-test/suite/stress/t/wrapper.test
new file mode 100644
index 00000000000..4d2dd808a4c
--- /dev/null
+++ b/mysql-test/suite/stress/t/wrapper.test
@@ -0,0 +1,29 @@
+#
+# This is a wrapper "pseudo" test for mtr --stress execution.
+# It should not be run directly (will be skipped)
+# Do not create a result file!
+#
+
+if (!$MST_OPTIONS) {
+ skip Only to be run with mtr --stress;
+}
+
+# echo Running MST with options $MST_OPTIONS;
+
+perl;
+ my ($mtest)= split " ", $ENV{MYSQL_TEST};
+ open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mtest.inc") or die;
+ print FILE "let \$MYSQLTEST_BIN= $mtest;\n";
+ close FILE;
+EOF
+
+--source $MYSQL_TMP_DIR/mtest.inc
+--remove_file $MYSQL_TMP_DIR/mtest.inc
+
+exec perl mysql-stress-test.pl --mysqltest=$MYSQLTEST_BIN
+ --server-port=$MASTER_MYPORT --server-socket=$MASTER_MYSOCK
+ --server-user=root --cleanup
+ --server-logs-dir=$MYSQLTEST_VARDIR/log
+ --stress-basedir=$MYSQLTEST_VARDIR
+ $MST_OPTIONS
+;
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result
index c59e1b802f4..9167585f1d6 100644
--- a/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result
@@ -1,59 +1,80 @@
-SET @start_global_value = @@global.innodb_file_format_max;
+SET @start_global_value = @@global.innodb_file_format_check;
SELECT @start_global_value;
@start_global_value
-Antelope
-Valid values are 'Antelope' and 'Barracuda'
-select @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
-@@global.innodb_file_format_max in ('Antelope', 'Barracuda')
-1
-select @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Antelope
-select @@session.innodb_file_format_max;
-ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable
-show global variables like 'innodb_file_format_max';
+1
+Valid values are 'ON' and 'OFF'
+SELECT @@global.innodb_file_format_check in (0, 1);
+@@global.innodb_file_format_check in (0, 1)
+1
+SELECT @@global.innodb_file_format_check;
+@@global.innodb_file_format_check
+1
+SELECT @@session.innodb_file_format_check;
+ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_file_format_check';
Variable_name Value
-innodb_file_format_max Antelope
-show session variables like 'innodb_file_format_max';
+innodb_file_format_check ON
+SHOW session variables LIKE 'innodb_file_format_check';
Variable_name Value
-innodb_file_format_max Antelope
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Antelope
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Antelope
-set global innodb_file_format_max='Antelope';
-select @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Antelope
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Antelope
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Antelope
-set @@global.innodb_file_format_max='Barracuda';
-select @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Barracuda
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
+innodb_file_format_check ON
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_check';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Barracuda
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
+INNODB_FILE_FORMAT_CHECK ON
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_check';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Barracuda
-set session innodb_file_format_max='Salmon';
-ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL
-set @@session.innodb_file_format_max='Salmon';
-ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL
-set global innodb_file_format_max=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max'
-set global innodb_file_format_max=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max'
-set global innodb_file_format_max='Salmon';
-ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'Salmon'
-SET @@global.innodb_file_format_max = @start_global_value;
-SELECT @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Antelope
+INNODB_FILE_FORMAT_CHECK ON
+SET @@global.innodb_file_format_check='Off';
+ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
+Expected error 'Read only variable'
+SET @@global.innodb_file_format_check=1;
+ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
+Expected error 'Read only variable'
+SET @@global.innodb_file_format_check=0;
+ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
+Expected error 'Read only variable'
+SET @@global.innodb_file_format_check='On';
+ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
+Expected error 'Read only variable'
+SET session innodb_large_prefix='OFF';
+ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.innodb_stats_on_metadata='ON';
+ERROR HY000: Variable 'innodb_stats_on_metadata' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT IF(@@GLOBAL.innodb_file_format_check, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_file_format_check';
+IF(@@GLOBAL.innodb_file_format_check, "ON", "OFF") = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_file_format_check);
+COUNT(@@GLOBAL.innodb_file_format_check)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_file_format_check';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+SELECT @@innodb_file_format_check = @@GLOBAL.innodb_file_format_check;
+@@innodb_file_format_check = @@GLOBAL.innodb_file_format_check
+1
+1 Expected
+SELECT COUNT(@@innodb_file_format_check);
+COUNT(@@innodb_file_format_check)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_file_format_check);
+ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_file_format_check);
+ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_file_format_check);
+COUNT(@@GLOBAL.innodb_file_format_check)
+1
+1 Expected
+SELECT innodb_file_format_check = @@SESSION.innodb_file_format_check;
+ERROR 42S22: Unknown column 'innodb_file_format_check' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result
index d9d067c2cf9..32b2262c091 100644
--- a/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result
@@ -1 +1,65 @@
-XtraDB extension
+SET @start_global_value = @@global.innodb_file_format_max;
+SELECT @start_global_value;
+@start_global_value
+Antelope
+Valid values are 'Antelope' and 'Barracuda'
+SELECT @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
+@@global.innodb_file_format_max in ('Antelope', 'Barracuda')
+1
+SELECT @@global.innodb_file_format_max;
+@@global.innodb_file_format_max
+Antelope
+SELECT @@session.innodb_file_format_max;
+ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_file_format_max';
+Variable_name Value
+innodb_file_format_max Antelope
+SHOW session variables LIKE 'innodb_file_format_max';
+Variable_name Value
+innodb_file_format_max Antelope
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Antelope
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Antelope
+SET global innodb_file_format_max='Antelope';
+SELECT @@global.innodb_file_format_max;
+@@global.innodb_file_format_max
+Antelope
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Antelope
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Antelope
+SET @@global.innodb_file_format_max='Barracuda';
+SELECT @@global.innodb_file_format_max;
+@@global.innodb_file_format_max
+Barracuda
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Barracuda
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Barracuda
+SET session innodb_file_format_max='Salmon';
+ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.innodb_file_format_max='Salmon';
+ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_file_format_max=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max'
+SET global innodb_file_format_max=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max'
+SET global innodb_file_format_max='Salmon';
+ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'Salmon'
+SET @@global.innodb_file_format_max = @start_global_value;
+SELECT @@global.innodb_file_format_max;
+@@global.innodb_file_format_max
+Antelope
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
index 163eb31f686..ecf11351cd9 100644
--- a/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
@@ -1,13 +1,29 @@
+SET @start_global_value = @@global.innodb_file_per_table;
+SELECT @start_global_value;
+@start_global_value
+0
'#---------------------BS_STVARS_028_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_file_per_table);
COUNT(@@GLOBAL.innodb_file_per_table)
1
1 Expected
'#---------------------BS_STVARS_028_02----------------------#'
-SELECT COUNT(@@GLOBAL.innodb_file_per_table);
-COUNT(@@GLOBAL.innodb_file_per_table)
+SET @@global.innodb_file_per_table = 0;
+SELECT @@global.innodb_file_per_table;
+@@global.innodb_file_per_table
+0
+SET @@global.innodb_file_per_table ='On' ;
+SELECT @@global.innodb_file_per_table;
+@@global.innodb_file_per_table
+1
+SET @@global.innodb_file_per_table ='Off' ;
+SELECT @@global.innodb_file_per_table;
+@@global.innodb_file_per_table
+0
+SET @@global.innodb_file_per_table = 1;
+SELECT @@global.innodb_file_per_table;
+@@global.innodb_file_per_table
1
-1 Expected
'#---------------------BS_STVARS_028_03----------------------#'
SELECT IF(@@GLOBAL.innodb_file_per_table,'ON','OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -47,4 +63,7 @@ COUNT(@@GLOBAL.innodb_file_per_table)
1 Expected
SELECT innodb_file_per_table = @@SESSION.innodb_file_per_table;
ERROR 42S22: Unknown column 'innodb_file_per_table' in 'field list'
-Expected error 'Readonly variable'
+SET @@global.innodb_file_per_table = @start_global_value;
+SELECT @@global.innodb_file_per_table;
+@@global.innodb_file_per_table
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_force_load_corrupted_basic.result b/mysql-test/suite/sys_vars/r/innodb_force_load_corrupted_basic.result
new file mode 100644
index 00000000000..bc9b7019eb8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_force_load_corrupted_basic.result
@@ -0,0 +1,53 @@
+'#---------------------BS_STVARS_031_01----------------------#'
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+COUNT(@@GLOBAL.innodb_force_load_corrupted)
+1
+1 Expected
+'#---------------------BS_STVARS_031_02----------------------#'
+SET @@GLOBAL.innodb_force_load_corrupted=1;
+ERROR HY000: Variable 'innodb_force_load_corrupted' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+COUNT(@@GLOBAL.innodb_force_load_corrupted)
+1
+1 Expected
+'#---------------------BS_STVARS_031_03----------------------#'
+SELECT IF(@@GLOBAL.innodb_force_load_corrupted, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_load_corrupted';
+IF(@@GLOBAL.innodb_force_load_corrupted, "ON", "OFF") = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+COUNT(@@GLOBAL.innodb_force_load_corrupted)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_load_corrupted';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_031_04----------------------#'
+SELECT @@innodb_force_load_corrupted = @@GLOBAL.innodb_force_load_corrupted;
+@@innodb_force_load_corrupted = @@GLOBAL.innodb_force_load_corrupted
+1
+1 Expected
+'#---------------------BS_STVARS_031_05----------------------#'
+SELECT COUNT(@@innodb_force_load_corrupted);
+COUNT(@@innodb_force_load_corrupted)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_force_load_corrupted);
+ERROR HY000: Variable 'innodb_force_load_corrupted' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_force_load_corrupted);
+ERROR HY000: Variable 'innodb_force_load_corrupted' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+COUNT(@@GLOBAL.innodb_force_load_corrupted)
+1
+1 Expected
+SELECT innodb_force_load_corrupted = @@SESSION.innodb_force_load_corrupted;
+ERROR 42S22: Unknown column 'innodb_force_load_corrupted' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result b/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
index d9d067c2cf9..adb56b347cd 100644
--- a/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
@@ -1 +1,92 @@
-XtraDB extension
+SET @start_global_value = @@global.innodb_large_prefix;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_large_prefix in (0, 1);
+@@global.innodb_large_prefix in (0, 1)
+1
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0
+select @@session.innodb_large_prefix;
+ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable
+show global variables like 'innodb_large_prefix';
+Variable_name Value
+innodb_large_prefix OFF
+show session variables like 'innodb_large_prefix';
+Variable_name Value
+innodb_large_prefix OFF
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+set global innodb_large_prefix='OFF';
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+set @@global.innodb_large_prefix=1;
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+1
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+set global innodb_large_prefix=0;
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+set @@global.innodb_large_prefix='ON';
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+1
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+set session innodb_large_prefix='OFF';
+ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_large_prefix='ON';
+ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_large_prefix=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix'
+set global innodb_large_prefix=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix'
+set global innodb_large_prefix=2;
+ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of '2'
+NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
+set global innodb_large_prefix=-3;
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+1
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+set global innodb_large_prefix='AUTO';
+ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of 'AUTO'
+SET @@global.innodb_large_prefix = @start_global_value;
+SELECT @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result b/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
index 89960e5860f..1dcc2d554ce 100644
--- a/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
@@ -1,13 +1,21 @@
+SET @start_global_value=@@global.innodb_lock_wait_timeout;
+SELECT @start_global_value;
+@start_global_value
+50
'#---------------------BS_STVARS_032_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
COUNT(@@GLOBAL.innodb_lock_wait_timeout)
1
1 Expected
'#---------------------BS_STVARS_032_02----------------------#'
-SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
-COUNT(@@GLOBAL.innodb_lock_wait_timeout)
-1
-1 Expected
+SET global innodb_lock_wait_timeout=60;
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+60
+SET session innodb_lock_wait_timeout=60;
+SELECT @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+60
'#---------------------BS_STVARS_032_03----------------------#'
SELECT @@GLOBAL.innodb_lock_wait_timeout = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -47,4 +55,7 @@ COUNT(@@GLOBAL.innodb_lock_wait_timeout)
1 Expected
SELECT innodb_lock_wait_timeout = @@SESSION.innodb_lock_wait_timeout;
ERROR 42S22: Unknown column 'innodb_lock_wait_timeout' in 'field list'
-Expected error 'Readonly variable'
+SET @@global.innodb_lock_wait_timeout = @start_global_value;
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+50
diff --git a/mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result b/mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result
new file mode 100644
index 00000000000..d627aa92ba7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result
@@ -0,0 +1,92 @@
+SET @start_global_value = @@global.innodb_random_read_ahead;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_random_read_ahead in (0, 1);
+@@global.innodb_random_read_ahead in (0, 1)
+1
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+0
+select @@session.innodb_random_read_ahead;
+ERROR HY000: Variable 'innodb_random_read_ahead' is a GLOBAL variable
+show global variables like 'innodb_random_read_ahead';
+Variable_name Value
+innodb_random_read_ahead OFF
+show session variables like 'innodb_random_read_ahead';
+Variable_name Value
+innodb_random_read_ahead OFF
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+set global innodb_random_read_ahead='ON';
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+1
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+set @@global.innodb_random_read_ahead=0;
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+0
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+set global innodb_random_read_ahead=1;
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+1
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+set @@global.innodb_random_read_ahead='OFF';
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+0
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+set session innodb_random_read_ahead='OFF';
+ERROR HY000: Variable 'innodb_random_read_ahead' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_random_read_ahead='ON';
+ERROR HY000: Variable 'innodb_random_read_ahead' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_random_read_ahead=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_random_read_ahead'
+set global innodb_random_read_ahead=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_random_read_ahead'
+set global innodb_random_read_ahead=2;
+ERROR 42000: Variable 'innodb_random_read_ahead' can't be set to the value of '2'
+NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
+set global innodb_random_read_ahead=-3;
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+1
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+set global innodb_random_read_ahead='AUTO';
+ERROR 42000: Variable 'innodb_random_read_ahead' can't be set to the value of 'AUTO'
+SET @@global.innodb_random_read_ahead = @start_global_value;
+SELECT @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_rollback_segments_basic.result b/mysql-test/suite/sys_vars/r/innodb_rollback_segments_basic.result
index d9d067c2cf9..a8d392eee38 100644
--- a/mysql-test/suite/sys_vars/r/innodb_rollback_segments_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_rollback_segments_basic.result
@@ -1 +1,64 @@
-XtraDB extension
+SET @start_global_value = @@global.innodb_rollback_segments;
+SELECT @start_global_value;
+@start_global_value
+128
+Valid values are zero or above
+SELECT @@global.innodb_rollback_segments >=0;
+@@global.innodb_rollback_segments >=0
+1
+SELECT @@global.innodb_rollback_segments <=128;
+@@global.innodb_rollback_segments <=128
+1
+SELECT @@global.innodb_rollback_segments;
+@@global.innodb_rollback_segments
+128
+SELECT @@session.innodb_rollback_segments;
+ERROR HY000: Variable 'innodb_rollback_segments' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_rollback_segments';
+Variable_name Value
+innodb_rollback_segments 128
+SHOW session variables LIKE 'innodb_rollback_segments';
+Variable_name Value
+innodb_rollback_segments 128
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ROLLBACK_SEGMENTS 128
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_rollback_segments';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ROLLBACK_SEGMENTS 128
+SET global innodb_rollback_segments=100;
+SELECT @@global.innodb_rollback_segments;
+@@global.innodb_rollback_segments
+100
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ROLLBACK_SEGMENTS 100
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_rollback_segments';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ROLLBACK_SEGMENTS 100
+SET session innodb_rollback_segments=1;
+ERROR HY000: Variable 'innodb_rollback_segments' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_rollback_segments=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_rollback_segments'
+SET global innodb_rollback_segments=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_rollback_segments'
+SET global innodb_rollback_segments="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_rollback_segments'
+SET global innodb_rollback_segments=-7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_rollback_segments value: '-7'
+SELECT @@global.innodb_rollback_segments;
+@@global.innodb_rollback_segments
+1
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ROLLBACK_SEGMENTS 1
+SET @@global.innodb_rollback_segments = @start_global_value;
+SELECT @@global.innodb_rollback_segments;
+@@global.innodb_rollback_segments
+128
diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_method_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_method_basic.result
index d9d067c2cf9..6599ca9edb6 100644
--- a/mysql-test/suite/sys_vars/r/innodb_stats_method_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_stats_method_basic.result
@@ -1 +1,83 @@
-XtraDB extension
+SET @start_global_value = @@global.innodb_stats_method;
+SELECT @start_global_value;
+@start_global_value
+nulls_equal
+Valid values are 'nulls_equal', 'nulls_unequal', 'nulls_ignored'
+SELECT @@global.innodb_stats_method in ('nulls_equal', 'nulls_unequal',
+'nulls_ignored');
+@@global.innodb_stats_method in ('nulls_equal', 'nulls_unequal',
+'nulls_ignored')
+1
+SELECT @@global.innodb_stats_method;
+@@global.innodb_stats_method
+nulls_equal
+SELECT @@session.innodb_stats_method;
+ERROR HY000: Variable 'innodb_stats_method' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_stats_method';
+Variable_name Value
+innodb_stats_method nulls_equal
+SHOW session variables LIKE 'innodb_stats_method';
+Variable_name Value
+innodb_stats_method nulls_equal
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_equal
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_equal
+SET global innodb_stats_method='nulls_equal';
+SELECT @@global.innodb_stats_method;
+@@global.innodb_stats_method
+nulls_equal
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_equal
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_equal
+SET @@global.innodb_stats_method='nulls_unequal';
+SELECT @@global.innodb_stats_method;
+@@global.innodb_stats_method
+nulls_unequal
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_unequal
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_unequal
+SET global innodb_stats_method=2;
+SELECT @@global.innodb_stats_method;
+@@global.innodb_stats_method
+nulls_ignored
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_ignored
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_ignored
+SET session innodb_stats_method='nulls_equal';
+ERROR HY000: Variable 'innodb_stats_method' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.innodb_stats_method='nulls_ignored';
+ERROR HY000: Variable 'innodb_stats_method' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_stats_method=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_method'
+SET global innodb_stats_method=4;
+ERROR 42000: Variable 'innodb_stats_method' can't be set to the value of '4'
+SET global innodb_stats_method=-2;
+ERROR 42000: Variable 'innodb_stats_method' can't be set to the value of '-2'
+SET global innodb_stats_method=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_method'
+SET global innodb_stats_method='some';
+ERROR 42000: Variable 'innodb_stats_method' can't be set to the value of 'some'
+SET @@global.innodb_stats_method = @start_global_value;
+SELECT @@global.innodb_stats_method;
+@@global.innodb_stats_method
+nulls_equal
diff --git a/mysql-test/suite/sys_vars/r/max_join_size_func.result b/mysql-test/suite/sys_vars/r/max_join_size_func.result
index bf535579433..0bf4f507b0c 100644
--- a/mysql-test/suite/sys_vars/r/max_join_size_func.result
+++ b/mysql-test/suite/sys_vars/r/max_join_size_func.result
@@ -41,7 +41,7 @@ id name id name
SET @@session.max_join_size=8;
## Since total joins are more than max_join_size value so error will occur ##
SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
'#--------------------FN_DYNVARS_079_03-------------------------#'
## Setting global value of variable ##
SET @@global.max_join_size=8;
@@ -52,7 +52,7 @@ SELECT @@global.max_join_size;
8
## Since total joins are more than max_join_size value so error will occur ##
SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
## Dropping both the tables ##
Drop table t1, t2;
## Restoring values ##
diff --git a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result
index c18f4cd2a1d..a5f36de73fa 100644
--- a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result
+++ b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result
@@ -1,20 +1,20 @@
select @@global.plugin_dir;
@@global.plugin_dir
-MYSQL_LIBDIR/plugins
+MYSQL_TMP_DIR
select @@session.plugin_dir;
ERROR HY000: Variable 'plugin_dir' is a GLOBAL variable
show global variables like 'plugin_dir';
Variable_name Value
-plugin_dir MYSQL_LIBDIR/plugins
+plugin_dir MYSQL_TMP_DIR
show session variables like 'plugin_dir';
Variable_name Value
-plugin_dir MYSQL_LIBDIR/plugins
+plugin_dir MYSQL_TMP_DIR
select * from information_schema.global_variables where variable_name='plugin_dir';
VARIABLE_NAME VARIABLE_VALUE
-PLUGIN_DIR MYSQL_LIBDIR/plugins
+PLUGIN_DIR MYSQL_TMP_DIR
select * from information_schema.session_variables where variable_name='plugin_dir';
VARIABLE_NAME VARIABLE_VALUE
-PLUGIN_DIR MYSQL_LIBDIR/plugins
+PLUGIN_DIR MYSQL_TMP_DIR
set global plugin_dir=1;
ERROR HY000: Variable 'plugin_dir' is a read only variable
set session plugin_dir=1;
diff --git a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
index 72631dbb1d5..ceac0ce539d 100644
--- a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
@@ -21,7 +21,7 @@ INSERT INTO t2 VALUES('aa4','bb');
'#--------------------FN_DYNVARS_154_01-------------------------#'
Expected error "Too big select"
SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
Expected error The SELECT would examine more than MAX_JOIN_SIZE rows.
'#--------------------FN_DYNVARS_154_02-------------------------#'
SET SESSION SQL_BIG_SELECTS = 1;
diff --git a/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result b/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
index 0dc85925c6b..377c2c9c4ca 100644
--- a/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
@@ -19,7 +19,7 @@ SET SESSION sql_max_join_size=9;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead
SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
Expected error The SELECT would examine more than MAX_JOIN_SIZE rows.
'#--------------------FN_DYNVARS_161_02-------------------------#'
SET SESSION SQL_BIG_SELECTS = 1;
diff --git a/mysql-test/suite/sys_vars/t/binlog_dbug_fsync_sleep_basic.test b/mysql-test/suite/sys_vars/t/binlog_dbug_fsync_sleep_basic.test
index f4e1161aa07..8e9f4651929 100644
--- a/mysql-test/suite/sys_vars/t/binlog_dbug_fsync_sleep_basic.test
+++ b/mysql-test/suite/sys_vars/t/binlog_dbug_fsync_sleep_basic.test
@@ -1,3 +1,5 @@
+--source include/have_debug.inc
+
# ulong global
SET @start_global_value = @@global.binlog_dbug_fsync_sleep;
diff --git a/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test b/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test
index f7d17a8e5ad..6e37a47c5b8 100644
--- a/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test
+++ b/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test
@@ -1,3 +1,4 @@
+--source include/have_debug.inc
# ulong global
SET @start_global_value = @@global.debug_crc_break;
diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def
index 888298bbb09..133754ed6ce 100644
--- a/mysql-test/suite/sys_vars/t/disabled.def
+++ b/mysql-test/suite/sys_vars/t/disabled.def
@@ -9,3 +9,6 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
+
+innodb_force_load_corrupted_basic : not in XtraDB (yet?)
+innodb_random_read_ahead_basic : not in XtraDB (yet?)
diff --git a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test
index 5b6fa943bbe..e07234a9152 100644
--- a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test
@@ -1,8 +1,7 @@
################# mysql-test\t\innodb_autoinc_lock_mode_basic.test ############
# #
# Variable Name: innodb_autoinc_lock_mode #
-# Scope: GLOBAL #
-# Access Type: Dynamic #
+# Access Type: Static #
# Data Type: Numeric #
# Default Value: 1 #
# Range: 0,1,2 #
diff --git a/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test b/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
index 636309a3088..e1b62046313 100644
--- a/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
@@ -3,9 +3,9 @@
# Variable Name: innodb_fast_shutdown #
# Scope: GLOBAL #
# Access Type: Dynamic #
-# Data Type: boolean #
+# Data Type: numeric #
# Default Value: 1 #
-# Valid Values: 0,1 #
+# Valid Values: 0,1,2 #
# #
# #
# Creation Date: 2008-02-20 #
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test
index cbf25af2442..f9f61b9380c 100644
--- a/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test
@@ -1,55 +1,95 @@
-
-
-# 2010-01-25 - Added
#
+# 2011-08-02 - Added
+#
+
--source include/not_embedded.inc
--source include/have_innodb.inc
-SET @start_global_value = @@global.innodb_file_format_max;
+SET @start_global_value = @@global.innodb_file_format_check;
SELECT @start_global_value;
#
# exists as global only
#
---echo Valid values are 'Antelope' and 'Barracuda'
-select @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
-select @@global.innodb_file_format_max;
+--echo Valid values are 'ON' and 'OFF'
+SELECT @@global.innodb_file_format_check in (0, 1);
+SELECT @@global.innodb_file_format_check;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_file_format_check;
+SHOW global variables LIKE 'innodb_file_format_check';
+SHOW session variables LIKE 'innodb_file_format_check';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_check';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_check';
+
+#
+# show that it's read only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.innodb_file_format_check='Off';
+--echo Expected error 'Read only variable'
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.innodb_file_format_check=1;
+--echo Expected error 'Read only variable'
+
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.innodb_file_format_max;
-show global variables like 'innodb_file_format_max';
-show session variables like 'innodb_file_format_max';
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
-
-#
-# show that it's writable
-#
-set global innodb_file_format_max='Antelope';
-select @@global.innodb_file_format_max;
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
-set @@global.innodb_file_format_max='Barracuda';
-select @@global.innodb_file_format_max;
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
+SET @@global.innodb_file_format_check=0;
+--echo Expected error 'Read only variable'
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.innodb_file_format_check='On';
+--echo Expected error 'Read only variable'
+
--error ER_GLOBAL_VARIABLE
-set session innodb_file_format_max='Salmon';
+SET session innodb_large_prefix='OFF';
--error ER_GLOBAL_VARIABLE
-set @@session.innodb_file_format_max='Salmon';
+SET @@session.innodb_stats_on_metadata='ON';
#
-# incorrect types
+# Check if the value in GLOBAL Table matches value in variable
#
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_file_format_max=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_file_format_max=1e1;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format_max='Salmon';
+
+SELECT IF(@@GLOBAL.innodb_file_format_check, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_file_format_check';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_file_format_check);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_file_format_check';
+--echo 1 Expected
#
-# Cleanup
+# Check if accessing variable with and without GLOBAL point to same variable
#
+SELECT @@innodb_file_format_check = @@GLOBAL.innodb_file_format_check;
+--echo 1 Expected
+
+#
+# Check if innodb_doublewrite can be accessed with and without @@ sign
+#
+
+SELECT COUNT(@@innodb_file_format_check);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_file_format_check);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_file_format_check);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_file_format_check);
+--echo 1 Expected
-SET @@global.innodb_file_format_max = @start_global_value;
-SELECT @@global.innodb_file_format_max;
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_file_format_check = @@SESSION.innodb_file_format_check;
+--echo Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic-master.opt b/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test
index 00aa476e8d2..c2cb4cb47bb 100644
--- a/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test
@@ -1 +1,60 @@
---echo XtraDB extension
+#
+# 2011-08-02 - Added
+#
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_file_format_max;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'Antelope' and 'Barracuda'
+SELECT @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
+SELECT @@global.innodb_file_format_max;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_file_format_max;
+SHOW global variables LIKE 'innodb_file_format_max';
+SHOW session variables LIKE 'innodb_file_format_max';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+
+#
+# show that it's writable
+#
+SET global innodb_file_format_max='Antelope';
+SELECT @@global.innodb_file_format_max;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+SET @@global.innodb_file_format_max='Barracuda';
+SELECT @@global.innodb_file_format_max;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+--error ER_GLOBAL_VARIABLE
+SET session innodb_file_format_max='Salmon';
+--error ER_GLOBAL_VARIABLE
+SET @@session.innodb_file_format_max='Salmon';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_file_format_max=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_file_format_max=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET global innodb_file_format_max='Salmon';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_file_format_max = @start_global_value;
+SELECT @@global.innodb_file_format_max;
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
index 76a50df8879..1478d6df2e9 100644
--- a/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
@@ -4,7 +4,7 @@
# #
# Variable Name: innodb_file_per_table #
# Scope: Global #
-# Access Type: Static #
+# Access Type: Dynamic #
# Data Type: boolean #
# #
# #
@@ -24,6 +24,10 @@
--source include/have_innodb.inc
+SET @start_global_value = @@global.innodb_file_per_table;
+SELECT @start_global_value;
+
+
--echo '#---------------------BS_STVARS_028_01----------------------#'
####################################################################
# Displaying default value #
@@ -37,11 +41,17 @@ SELECT COUNT(@@GLOBAL.innodb_file_per_table);
# Check if Value can set #
####################################################################
-SELECT COUNT(@@GLOBAL.innodb_file_per_table);
---echo 1 Expected
+SET @@global.innodb_file_per_table = 0;
+SELECT @@global.innodb_file_per_table;
+SET @@global.innodb_file_per_table ='On' ;
+SELECT @@global.innodb_file_per_table;
+SET @@global.innodb_file_per_table ='Off' ;
+SELECT @@global.innodb_file_per_table;
+SET @@global.innodb_file_per_table = 1;
+SELECT @@global.innodb_file_per_table;
--echo '#---------------------BS_STVARS_028_03----------------------#'
#################################################################
@@ -93,6 +103,10 @@ SELECT COUNT(@@GLOBAL.innodb_file_per_table);
--Error ER_BAD_FIELD_ERROR
SELECT innodb_file_per_table = @@SESSION.innodb_file_per_table;
---echo Expected error 'Readonly variable'
+#
+# Cleanup
+#
+SET @@global.innodb_file_per_table = @start_global_value;
+SELECT @@global.innodb_file_per_table;
diff --git a/mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test b/mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test
new file mode 100644
index 00000000000..1726b320f47
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test
@@ -0,0 +1,102 @@
+
+
+################## mysql-test\t\innodb_force_load_corrupted_basic.test #####
+# #
+# Variable Name: innodb_force_load_corrupted #
+# Scope: Global #
+# Access Type: Static #
+# Data Type: boolean #
+# #
+# #
+# Creation Date: 2008-02-07 #
+# Author : Sharique Abdullah #
+# #
+# #
+# Description:Test Cases of Dynamic System Variable innodb_force_load_corrupted#
+# that checks the behavior of this variable in the following ways #
+# * Value Check #
+# * Scope Check #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
+# server-system-variables.html #
+# #
+###############################################################################
+
+--source include/have_innodb.inc
+
+--echo '#---------------------BS_STVARS_031_01----------------------#'
+####################################################################
+# Displaying default value #
+####################################################################
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+--echo 1 Expected
+
+
+--echo '#---------------------BS_STVARS_031_02----------------------#'
+####################################################################
+# Check if Value can set #
+####################################################################
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_force_load_corrupted=1;
+--echo Expected error 'Read only variable'
+
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+--echo 1 Expected
+
+
+
+
+--echo '#---------------------BS_STVARS_031_03----------------------#'
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#################################################################
+
+SELECT IF(@@GLOBAL.innodb_force_load_corrupted, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_load_corrupted';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_load_corrupted';
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_031_04----------------------#'
+################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+################################################################################
+SELECT @@innodb_force_load_corrupted = @@GLOBAL.innodb_force_load_corrupted;
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_031_05----------------------#'
+################################################################################
+# Check if innodb_force_load_corrupted can be accessed with and without @@ sign #
+################################################################################
+
+SELECT COUNT(@@innodb_force_load_corrupted);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_force_load_corrupted);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_force_load_corrupted);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_force_load_corrupted = @@SESSION.innodb_force_load_corrupted;
+--echo Expected error 'Readonly variable'
+
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test b/mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test
index 3f00b50cf08..0ced5800d4b 100644
--- a/mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test
@@ -54,5 +54,9 @@ select * from information_schema.global_variables where variable_name='innodb_io
set global innodb_io_capacity=100;
select @@global.innodb_io_capacity;
+#
+# cleanup
+#
+
SET @@global.innodb_io_capacity = @start_global_value;
SELECT @@global.innodb_io_capacity;
diff --git a/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test b/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
index 00aa476e8d2..582e9ffbee8 100644
--- a/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
@@ -1 +1,70 @@
---echo XtraDB extension
+
+
+# 2010-01-25 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_large_prefix;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_large_prefix in (0, 1);
+select @@global.innodb_large_prefix;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_large_prefix;
+show global variables like 'innodb_large_prefix';
+show session variables like 'innodb_large_prefix';
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+
+#
+# show that it's writable
+#
+set global innodb_large_prefix='OFF';
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+set @@global.innodb_large_prefix=1;
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+set global innodb_large_prefix=0;
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+set @@global.innodb_large_prefix='ON';
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--error ER_GLOBAL_VARIABLE
+set session innodb_large_prefix='OFF';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_large_prefix='ON';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_large_prefix=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_large_prefix=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_large_prefix=2;
+--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
+set global innodb_large_prefix=-3;
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_large_prefix='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_large_prefix = @start_global_value;
+SELECT @@global.innodb_large_prefix;
diff --git a/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test b/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test
index 8cfd23fd6e7..f80b8e48736 100644
--- a/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test
@@ -3,13 +3,13 @@
################## mysql-test\t\innodb_lock_wait_timeout_basic.test ###########
# #
# Variable Name: innodb_lock_wait_timeout #
-# Scope: Global #
-# Access Type: Static #
+# Scope: Global , Session #
+# Access Type: Dynamic #
# Data Type: numeric #
# #
# #
# Creation Date: 2008-02-07 #
-# Author : Sharique Abdullah #
+# Author : Sharique Abdullah #
# #
# #
# Description:Test Cases of Dynamic System Variable innodb_lock_wait_timeout #
@@ -24,6 +24,9 @@
--source include/have_innodb.inc
+SET @start_global_value=@@global.innodb_lock_wait_timeout;
+SELECT @start_global_value;
+
--echo '#---------------------BS_STVARS_032_01----------------------#'
####################################################################
# Displaying default value #
@@ -37,11 +40,10 @@ SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
# Check if Value can set #
####################################################################
-SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
---echo 1 Expected
-
-
-
+SET global innodb_lock_wait_timeout=60;
+SELECT @@global.innodb_lock_wait_timeout;
+SET session innodb_lock_wait_timeout=60;
+SELECT @@session.innodb_lock_wait_timeout;
--echo '#---------------------BS_STVARS_032_03----------------------#'
#################################################################
@@ -89,6 +91,10 @@ SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
--Error ER_BAD_FIELD_ERROR
SELECT innodb_lock_wait_timeout = @@SESSION.innodb_lock_wait_timeout;
---echo Expected error 'Readonly variable'
+#
+# Cleanup
+#
+SET @@global.innodb_lock_wait_timeout = @start_global_value;
+SELECT @@global.innodb_lock_wait_timeout;
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test
index 38c3acd92a2..7e70ed11351 100644
--- a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test
@@ -4,8 +4,8 @@
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Numeric #
-# Default Value: 90 #
-# Range: 0-1000 #
+# Default Value: 75 #
+# Range: 0-99 #
# #
# #
# Creation Date: 2008-02-07 #
diff --git a/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test b/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test
new file mode 100644
index 00000000000..f78223bad02
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test
@@ -0,0 +1,70 @@
+
+
+# 2010-01-25 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_random_read_ahead;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_random_read_ahead in (0, 1);
+select @@global.innodb_random_read_ahead;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_random_read_ahead;
+show global variables like 'innodb_random_read_ahead';
+show session variables like 'innodb_random_read_ahead';
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+
+#
+# show that it's writable
+#
+set global innodb_random_read_ahead='ON';
+select @@global.innodb_random_read_ahead;
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+set @@global.innodb_random_read_ahead=0;
+select @@global.innodb_random_read_ahead;
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+set global innodb_random_read_ahead=1;
+select @@global.innodb_random_read_ahead;
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+set @@global.innodb_random_read_ahead='OFF';
+select @@global.innodb_random_read_ahead;
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+--error ER_GLOBAL_VARIABLE
+set session innodb_random_read_ahead='OFF';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_random_read_ahead='ON';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_random_read_ahead=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_random_read_ahead=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_random_read_ahead=2;
+--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
+set global innodb_random_read_ahead=-3;
+select @@global.innodb_random_read_ahead;
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_random_read_ahead='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_random_read_ahead = @start_global_value;
+SELECT @@global.innodb_random_read_ahead;
diff --git a/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test b/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test
index 00aa476e8d2..9f0b70a528f 100644
--- a/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test
@@ -1 +1,58 @@
---echo XtraDB extension
+#
+# 2011-08-01 Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_rollback_segments;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are zero or above
+SELECT @@global.innodb_rollback_segments >=0;
+SELECT @@global.innodb_rollback_segments <=128;
+SELECT @@global.innodb_rollback_segments;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_rollback_segments;
+SHOW global variables LIKE 'innodb_rollback_segments';
+SHOW session variables LIKE 'innodb_rollback_segments';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_rollback_segments';
+
+#
+# show that it's writable
+#
+SET global innodb_rollback_segments=100;
+SELECT @@global.innodb_rollback_segments;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_rollback_segments';
+--error ER_GLOBAL_VARIABLE
+SET session innodb_rollback_segments=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_rollback_segments=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_rollback_segments=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_rollback_segments="foo";
+SET global innodb_rollback_segments=-7;
+SELECT @@global.innodb_rollback_segments;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+
+#
+# cleanup
+#
+
+SET @@global.innodb_rollback_segments = @start_global_value;
+SELECT @@global.innodb_rollback_segments;
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test
index 00aa476e8d2..f01574c3683 100644
--- a/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test
@@ -1 +1,72 @@
---echo XtraDB extension
+#
+# 2011-08-05 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_stats_method;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'nulls_equal', 'nulls_unequal', 'nulls_ignored'
+SELECT @@global.innodb_stats_method in ('nulls_equal', 'nulls_unequal',
+'nulls_ignored');
+SELECT @@global.innodb_stats_method;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_stats_method;
+SHOW global variables LIKE 'innodb_stats_method';
+SHOW session variables LIKE 'innodb_stats_method';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+
+#
+# show that it's writable
+#
+SET global innodb_stats_method='nulls_equal';
+SELECT @@global.innodb_stats_method;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+SET @@global.innodb_stats_method='nulls_unequal';
+SELECT @@global.innodb_stats_method;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+SET global innodb_stats_method=2;
+SELECT @@global.innodb_stats_method;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+
+--error ER_GLOBAL_VARIABLE
+SET session innodb_stats_method='nulls_equal';
+--error ER_GLOBAL_VARIABLE
+SET @@session.innodb_stats_method='nulls_ignored';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_method=1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET global innodb_stats_method=4;
+--error ER_WRONG_VALUE_FOR_VAR
+SET global innodb_stats_method=-2;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_method=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET global innodb_stats_method='some';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_stats_method = @start_global_value;
+SELECT @@global.innodb_stats_method;
diff --git a/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test b/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
index 03b7743a7aa..98f5af90cac 100644
--- a/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
+++ b/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
@@ -1,3 +1,4 @@
+--source include/have_debug.inc
# bool readonly
#
diff --git a/mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt b/mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt
new file mode 100644
index 00000000000..69a9f0def2a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt
@@ -0,0 +1 @@
+--plugin-dir=$MYSQL_TMP_DIR
diff --git a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test
index 8bb231c2c5e..59889f7ecb2 100644
--- a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test
+++ b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test
@@ -3,22 +3,20 @@
#
#
-# on windows it's <basedir>/lib/plugin
-# on unix it's <basedir>/lib/mysql/plugin
-# unless mtr sets it to $MYSQL_TEST_DIR/var/plugins
+# Don't rely on being able to guess the correct default.
+# -master.opt file for this test sets plugin_dir to a known directory
#
-let plugindir=$MYSQLTEST_VARDIR;
---replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ /
select @@global.plugin_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.plugin_dir;
---replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ /
show global variables like 'plugin_dir';
---replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ /
show session variables like 'plugin_dir';
---replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ /
select * from information_schema.global_variables where variable_name='plugin_dir';
---replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ /
select * from information_schema.session_variables where variable_name='plugin_dir';
#