61 changed files with 907 additions and 635 deletions
-
14CMakeLists.txt
-
6client/mysql.cc
-
1config.h.cmake
-
1configure.cmake
-
2mysql-test/lib/My/Debugger.pm
-
214mysql-test/main/derived_cond_pushdown.result
-
37mysql-test/main/derived_cond_pushdown.test
-
30mysql-test/main/join_cache.result
-
27mysql-test/main/join_cache.test
-
13mysql-test/main/userstat.result
-
19mysql-test/main/userstat.test
-
16mysql-test/main/view.result
-
21mysql-test/main/view.test
-
4mysql-test/suite/galera/include/galera_st_disconnect_slave.inc
-
0mysql-test/suite/galera/include/galera_start_replication.inc
-
0mysql-test/suite/galera/include/galera_stop_replication.inc
-
88mysql-test/suite/galera/r/galera_ctas.result
-
3mysql-test/suite/galera/r/galera_ist_restart_joiner.result
-
80mysql-test/suite/galera/r/galera_log_bin_opt.result
-
39mysql-test/suite/galera/t/galera_ctas.test
-
2mysql-test/suite/galera/t/galera_gcache_recover.cnf
-
4mysql-test/suite/galera/t/galera_ist_restart_joiner.test
-
46mysql-test/suite/galera/t/galera_log_bin.inc
-
47mysql-test/suite/galera/t/galera_log_bin.test
-
1mysql-test/suite/galera/t/galera_log_bin_opt-master.opt
-
15mysql-test/suite/galera/t/galera_log_bin_opt.cnf
-
2mysql-test/suite/galera/t/galera_log_bin_opt.test
-
2mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.test
-
4mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test
-
4mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
-
152mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc
-
17mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result
-
17mysql-test/suite/innodb/r/innodb_simulate_comp_failures_small.result
-
16mysql-test/suite/innodb/r/instant_alter_debug.result
-
3mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt
-
9mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test
-
2mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small-master.opt
-
8mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small.test
-
16mysql-test/suite/innodb/t/instant_alter_debug.test
-
77mysql-test/suite/sys_vars/r/innodb_simulate_comp_failures_basic.result
-
14mysql-test/suite/sys_vars/r/sysvars_innodb.result
-
65mysql-test/suite/sys_vars/t/innodb_simulate_comp_failures_basic.test
-
7plugin/auth_pam/CMakeLists.txt
-
3plugin/userstat/table_stats.cc
-
3scripts/wsrep_sst_common.sh
-
5sql/item.cc
-
61sql/log.cc
-
48sql/opt_split.cc
-
3sql/sql_insert.cc
-
2sql/sql_join_cache.cc
-
17sql/sql_select.cc
-
8sql/sql_test.cc
-
5storage/innobase/btr/btr0pcur.cc
-
26storage/innobase/handler/ha_innodb.cc
-
2storage/innobase/handler/ha_innodb.h
-
3storage/innobase/include/srv0srv.h
-
27storage/innobase/page/page0zip.cc
-
4storage/innobase/row/row0merge.cc
-
116storage/innobase/row/row0upd.cc
-
3storage/innobase/srv/srv0srv.cc
-
61vio/viossl.c
@ -0,0 +1,88 @@ |
|||
connection node_2; |
|||
connection node_1; |
|||
connection node_1; |
|||
create table t1_Aria(a int, count int, b int, key(b)) engine=Aria; |
|||
INSERT INTO t1_Aria values (1,1,1); |
|||
create table t1_MyISAM(a int, count int, b int, key(b)) engine=MyISAM; |
|||
INSERT INTO t1_MyISAM values (1,1,1); |
|||
create table t1_InnoDB(a int, count int, b int, key(b)) engine=InnoDB; |
|||
INSERT INTO t1_InnoDB values (1,1,1); |
|||
SET SESSION default_storage_engine=MyISAM; |
|||
CREATE TABLE t2 AS SELECT * FROM t1_Aria; |
|||
CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; |
|||
CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; |
|||
SHOW CREATE TABLE t2; |
|||
Table Create Table |
|||
t2 CREATE TABLE `t2` ( |
|||
`a` int(11) DEFAULT NULL, |
|||
`count` int(11) DEFAULT NULL, |
|||
`b` int(11) DEFAULT NULL |
|||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|||
SHOW CREATE TABLE t3; |
|||
Table Create Table |
|||
t3 CREATE TABLE `t3` ( |
|||
`a` int(11) DEFAULT NULL, |
|||
`count` int(11) DEFAULT NULL, |
|||
`b` int(11) DEFAULT NULL |
|||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|||
SHOW CREATE TABLE t4; |
|||
Table Create Table |
|||
t4 CREATE TABLE `t4` ( |
|||
`a` int(11) DEFAULT NULL, |
|||
`count` int(11) DEFAULT NULL, |
|||
`b` int(11) DEFAULT NULL |
|||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|||
DROP TABLE t2, t3,t4; |
|||
SET SESSION default_storage_engine=Aria; |
|||
CREATE TABLE t2 AS SELECT * FROM t1_Aria; |
|||
CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; |
|||
CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; |
|||
SHOW CREATE TABLE t2; |
|||
Table Create Table |
|||
t2 CREATE TABLE `t2` ( |
|||
`a` int(11) DEFAULT NULL, |
|||
`count` int(11) DEFAULT NULL, |
|||
`b` int(11) DEFAULT NULL |
|||
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 |
|||
SHOW CREATE TABLE t3; |
|||
Table Create Table |
|||
t3 CREATE TABLE `t3` ( |
|||
`a` int(11) DEFAULT NULL, |
|||
`count` int(11) DEFAULT NULL, |
|||
`b` int(11) DEFAULT NULL |
|||
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 |
|||
SHOW CREATE TABLE t4; |
|||
Table Create Table |
|||
t4 CREATE TABLE `t4` ( |
|||
`a` int(11) DEFAULT NULL, |
|||
`count` int(11) DEFAULT NULL, |
|||
`b` int(11) DEFAULT NULL |
|||
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 |
|||
DROP TABLE t2, t3,t4; |
|||
SET SESSION default_storage_engine=InnoDB; |
|||
CREATE TABLE t2 AS SELECT * FROM t1_Aria; |
|||
CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; |
|||
CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; |
|||
SHOW CREATE TABLE t2; |
|||
Table Create Table |
|||
t2 CREATE TABLE `t2` ( |
|||
`a` int(11) DEFAULT NULL, |
|||
`count` int(11) DEFAULT NULL, |
|||
`b` int(11) DEFAULT NULL |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|||
SHOW CREATE TABLE t3; |
|||
Table Create Table |
|||
t3 CREATE TABLE `t3` ( |
|||
`a` int(11) DEFAULT NULL, |
|||
`count` int(11) DEFAULT NULL, |
|||
`b` int(11) DEFAULT NULL |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|||
SHOW CREATE TABLE t4; |
|||
Table Create Table |
|||
t4 CREATE TABLE `t4` ( |
|||
`a` int(11) DEFAULT NULL, |
|||
`count` int(11) DEFAULT NULL, |
|||
`b` int(11) DEFAULT NULL |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|||
DROP TABLE t2, t3,t4; |
|||
DROP TABLE t1_MyISAM, t1_Aria,t1_InnoDB; |
@ -0,0 +1,80 @@ |
|||
connection node_2; |
|||
connection node_1; |
|||
connection node_1; |
|||
set global wsrep_on=OFF; |
|||
reset master; |
|||
set global wsrep_on=ON; |
|||
connection node_2; |
|||
set global wsrep_on=OFF; |
|||
reset master; |
|||
set global wsrep_on=ON; |
|||
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; |
|||
INSERT INTO t1 VALUES (1); |
|||
CREATE TABLE t2 (id INT) ENGINE=InnoDB; |
|||
INSERT INTO t2 VALUES (1); |
|||
INSERT INTO t2 VALUES (1); |
|||
connection node_2; |
|||
SELECT COUNT(*) = 1 FROM t1; |
|||
COUNT(*) = 1 |
|||
1 |
|||
SELECT COUNT(*) = 2 FROM t2; |
|||
COUNT(*) = 2 |
|||
1 |
|||
connection node_1; |
|||
ALTER TABLE t1 ADD COLUMN f2 INTEGER; |
|||
include/show_binlog_events.inc |
|||
Log_name Pos Event_type Server_id End_log_pos Info |
|||
mysqld-bin.000001 # Gtid # # GTID #-#-# |
|||
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB |
|||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# |
|||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) |
|||
mysqld-bin.000001 # Table_map # # table_id: # (test.t1) |
|||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
|||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ |
|||
mysqld-bin.000001 # Gtid # # GTID #-#-# |
|||
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB |
|||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# |
|||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) |
|||
mysqld-bin.000001 # Table_map # # table_id: # (test.t2) |
|||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
|||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ |
|||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# |
|||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) |
|||
mysqld-bin.000001 # Table_map # # table_id: # (test.t2) |
|||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
|||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ |
|||
mysqld-bin.000001 # Gtid # # GTID #-#-# |
|||
mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER |
|||
connection node_2; |
|||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; |
|||
COUNT(*) = 2 |
|||
1 |
|||
include/show_binlog_events.inc |
|||
Log_name Pos Event_type Server_id End_log_pos Info |
|||
mysqld-bin.000001 # Gtid # # GTID #-#-# |
|||
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB |
|||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# |
|||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) |
|||
mysqld-bin.000001 # Table_map # # table_id: # (test.t1) |
|||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
|||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ |
|||
mysqld-bin.000001 # Gtid # # GTID #-#-# |
|||
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB |
|||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# |
|||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) |
|||
mysqld-bin.000001 # Table_map # # table_id: # (test.t2) |
|||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
|||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ |
|||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# |
|||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) |
|||
mysqld-bin.000001 # Table_map # # table_id: # (test.t2) |
|||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
|||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ |
|||
mysqld-bin.000001 # Gtid # # GTID #-#-# |
|||
mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER |
|||
DROP TABLE t1; |
|||
DROP TABLE t2; |
|||
#cleanup |
|||
connection node_1; |
|||
SET GLOBAL wsrep_on=OFF; |
|||
RESET MASTER; |
@ -0,0 +1,39 @@ |
|||
--source include/galera_cluster.inc |
|||
|
|||
--connection node_1 |
|||
create table t1_Aria(a int, count int, b int, key(b)) engine=Aria; |
|||
INSERT INTO t1_Aria values (1,1,1); |
|||
create table t1_MyISAM(a int, count int, b int, key(b)) engine=MyISAM; |
|||
INSERT INTO t1_MyISAM values (1,1,1); |
|||
create table t1_InnoDB(a int, count int, b int, key(b)) engine=InnoDB; |
|||
INSERT INTO t1_InnoDB values (1,1,1); |
|||
|
|||
SET SESSION default_storage_engine=MyISAM; |
|||
CREATE TABLE t2 AS SELECT * FROM t1_Aria; |
|||
CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; |
|||
CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; |
|||
SHOW CREATE TABLE t2; |
|||
SHOW CREATE TABLE t3; |
|||
SHOW CREATE TABLE t4; |
|||
DROP TABLE t2, t3,t4; |
|||
|
|||
SET SESSION default_storage_engine=Aria; |
|||
CREATE TABLE t2 AS SELECT * FROM t1_Aria; |
|||
CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; |
|||
CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; |
|||
SHOW CREATE TABLE t2; |
|||
SHOW CREATE TABLE t3; |
|||
SHOW CREATE TABLE t4; |
|||
DROP TABLE t2, t3,t4; |
|||
|
|||
SET SESSION default_storage_engine=InnoDB; |
|||
CREATE TABLE t2 AS SELECT * FROM t1_Aria; |
|||
CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; |
|||
CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; |
|||
SHOW CREATE TABLE t2; |
|||
SHOW CREATE TABLE t3; |
|||
SHOW CREATE TABLE t4; |
|||
|
|||
DROP TABLE t2, t3,t4; |
|||
DROP TABLE t1_MyISAM, t1_Aria,t1_InnoDB; |
|||
|
@ -0,0 +1,46 @@ |
|||
--source include/galera_cluster.inc |
|||
--source include/force_restart.inc |
|||
|
|||
--connection node_1 |
|||
set global wsrep_on=OFF; |
|||
reset master; |
|||
set global wsrep_on=ON; |
|||
--connection node_2 |
|||
set global wsrep_on=OFF; |
|||
reset master; |
|||
set global wsrep_on=ON; |
|||
|
|||
# |
|||
# Test Galera with --log-bin --log-slave-updates . |
|||
# This way the actual MySQL binary log is used, |
|||
# rather than Galera's own implementation |
|||
# |
|||
|
|||
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; |
|||
INSERT INTO t1 VALUES (1); |
|||
|
|||
CREATE TABLE t2 (id INT) ENGINE=InnoDB; |
|||
INSERT INTO t2 VALUES (1); |
|||
INSERT INTO t2 VALUES (1); |
|||
|
|||
--connection node_2 |
|||
SELECT COUNT(*) = 1 FROM t1; |
|||
SELECT COUNT(*) = 2 FROM t2; |
|||
|
|||
--connection node_1 |
|||
ALTER TABLE t1 ADD COLUMN f2 INTEGER; |
|||
--let $MASTER_MYPORT=$NODE_MYPORT_1 |
|||
--source include/show_binlog_events.inc |
|||
|
|||
--connection node_2 |
|||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; |
|||
--let $MASTER_MYPORT=$NODE_MYPORT_2 |
|||
--source include/show_binlog_events.inc |
|||
|
|||
DROP TABLE t1; |
|||
DROP TABLE t2; |
|||
|
|||
--echo #cleanup |
|||
--connection node_1 |
|||
SET GLOBAL wsrep_on=OFF; |
|||
RESET MASTER; |
@ -1,46 +1 @@ |
|||
--source include/galera_cluster.inc |
|||
--source include/force_restart.inc |
|||
|
|||
--connection node_1 |
|||
set global wsrep_on=OFF; |
|||
reset master; |
|||
set global wsrep_on=ON; |
|||
--connection node_2 |
|||
set global wsrep_on=OFF; |
|||
reset master; |
|||
set global wsrep_on=ON; |
|||
|
|||
# |
|||
# Test Galera with --log-bin --log-slave-updates . |
|||
# This way the actual MySQL binary log is used, |
|||
# rather than Galera's own implementation |
|||
# |
|||
|
|||
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; |
|||
INSERT INTO t1 VALUES (1); |
|||
|
|||
CREATE TABLE t2 (id INT) ENGINE=InnoDB; |
|||
INSERT INTO t2 VALUES (1); |
|||
INSERT INTO t2 VALUES (1); |
|||
|
|||
--connection node_2 |
|||
SELECT COUNT(*) = 1 FROM t1; |
|||
SELECT COUNT(*) = 2 FROM t2; |
|||
|
|||
--connection node_1 |
|||
ALTER TABLE t1 ADD COLUMN f2 INTEGER; |
|||
--let $MASTER_MYPORT=$NODE_MYPORT_1 |
|||
--source include/show_binlog_events.inc |
|||
|
|||
--connection node_2 |
|||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; |
|||
--let $MASTER_MYPORT=$NODE_MYPORT_2 |
|||
--source include/show_binlog_events.inc |
|||
|
|||
DROP TABLE t1; |
|||
DROP TABLE t2; |
|||
|
|||
--echo #cleanup |
|||
--connection node_1 |
|||
SET GLOBAL wsrep_on=OFF; |
|||
RESET MASTER; |
|||
--source galera_log_bin.inc |
@ -0,0 +1 @@ |
|||
--log-slave-updates --log-bin |
@ -0,0 +1,15 @@ |
|||
!include ../galera_2nodes.cnf |
|||
|
|||
[mysqld] |
|||
wsrep_sst_method=mariabackup |
|||
wsrep_sst_auth="root:" |
|||
|
|||
[mysqld.1] |
|||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' |
|||
|
|||
[mysqld.2] |
|||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' |
|||
|
|||
[sst] |
|||
transferfmt=@ENV.MTR_GALERA_TFMT |
|||
streamfmt=xbstream |
@ -0,0 +1,2 @@ |
|||
--source include/have_mariabackup.inc |
|||
--source galera_log_bin.inc |
@ -1,152 +0,0 @@ |
|||
--echo # |
|||
--echo # Testing robustness against random compression failures |
|||
--echo # |
|||
|
|||
--source include/not_embedded.inc |
|||
--source include/have_innodb.inc |
|||
|
|||
--let $simulate_comp_failures_save = `SELECT @@innodb_simulate_comp_failures` |
|||
|
|||
--disable_query_log |
|||
call mtr.add_suppression("InnoDB: Simulating a compression failure for table `test`\\.`t1`"); |
|||
--enable_query_log |
|||
|
|||
# create the table with compressed pages of size 8K. |
|||
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(msg)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; |
|||
|
|||
SHOW CREATE TABLE t1; |
|||
|
|||
# percentage of compressions that will be forced to fail |
|||
SET GLOBAL innodb_simulate_comp_failures = 25; |
|||
|
|||
--disable_query_log |
|||
--disable_result_log |
|||
|
|||
let $num_inserts_ind = $num_inserts; |
|||
let $commit_iterations=50; |
|||
|
|||
while ($num_inserts_ind) |
|||
{ |
|||
let $repeat = `select floor(rand() * 10)`; |
|||
eval INSERT INTO t1(id, msg) |
|||
VALUES ($num_inserts_ind, REPEAT('abcdefghijklmnopqrstuvwxyz', $repeat)); |
|||
dec $num_inserts_ind; |
|||
} |
|||
|
|||
--enable_query_log |
|||
--enable_result_log |
|||
|
|||
COMMIT; |
|||
SELECT COUNT(id) FROM t1; |
|||
|
|||
--disable_query_log |
|||
--disable_result_log |
|||
|
|||
# do random ops, making sure that some pages will get fragmented and reorganized. |
|||
let $num_ops_ind = $num_ops; |
|||
let $commit_count= $commit_iterations; |
|||
|
|||
BEGIN; |
|||
|
|||
while($num_ops_ind) |
|||
{ |
|||
let $idx = `select floor(rand()*$num_inserts)`; |
|||
let $insert_or_update = `select floor(rand()*3)`; |
|||
|
|||
let $repeat = `select floor(rand() * 9) + 1`; |
|||
|
|||
let $msg = query_get_value(`select repeat('abcdefghijklmnopqrstuvwxyz', $repeat) as x`, x, 1); |
|||
|
|||
let $single_or_multi = `select floor(rand()*10)`; |
|||
|
|||
if ($insert_or_update) |
|||
{ |
|||
let $cnt = query_get_value(SELECT COUNT(*) cnt FROM t1 WHERE id=$idx, cnt, 1); |
|||
|
|||
if ($cnt) |
|||
{ |
|||
let $update = `select floor(rand()*2)`; |
|||
|
|||
if ($update) |
|||
{ |
|||
if ($single_or_multi) |
|||
{ |
|||
eval UPDATE t1 SET msg=\"$msg\" WHERE id=$idx; |
|||
} |
|||
|
|||
if (!$single_or_multi) |
|||
{ |
|||
eval UPDATE t1 SET msg=\"$msg\" WHERE id >= $idx - 100 AND id <= $idx + 100; |
|||
} |
|||
|
|||
} |
|||
|
|||
if (!$update) |
|||
{ |
|||
if ($single_or_multi) |
|||
{ |
|||
eval INSERT INTO t1(msg, id) VALUES (\"$msg\", $idx) ON DUPLICATE KEY UPDATE msg=VALUES(msg), id = VALUES(id); |
|||
} |
|||
|
|||
if (!$single_or_multi) |
|||
{ |
|||
let $diff = 200; |
|||
|
|||
while ($diff) |
|||
{ |
|||
eval INSERT INTO t1(msg, id) VALUES (\"$msg\", $idx + 100 - $diff) ON DUPLICATE KEY UPDATE msg=VALUES(msg), id=VALUES(id); |
|||
|
|||
dec $diff; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (!$cnt) |
|||
{ |
|||
let $null_msg = `select floor(rand()*2)`; |
|||
|
|||
if ($null_msg) |
|||
{ |
|||
eval INSERT INTO t1(id,msg) VALUES ($idx, NULL); |
|||
} |
|||
|
|||
if (!$null_msg) |
|||
{ |
|||
eval INSERT INTO t1(id, msg) VALUES ($idx, \"$msg\"); |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (!$insert_or_update) |
|||
{ |
|||
if ($single_or_multi) |
|||
{ |
|||
eval DELETE from t1 WHERE id=$idx; |
|||
} |
|||
|
|||
if (!$single_or_multi) |
|||
{ |
|||
eval DELETE from t1 WHERE id >= $idx - 100 AND id <= $idx + 100; |
|||
} |
|||
} |
|||
|
|||
dec $commit_count; |
|||
if (!$commit_count) |
|||
{ |
|||
let $commit_count= $commit_iterations; |
|||
COMMIT; |
|||
BEGIN; |
|||
} |
|||
|
|||
dec $num_ops_ind; |
|||
} |
|||
|
|||
COMMIT; |
|||
|
|||
# final cleanup |
|||
DROP TABLE t1; |
|||
|
|||
eval SET GLOBAL innodb_simulate_comp_failures = $simulate_comp_failures_save; |
|||
|
|||
--enable_query_log |
@ -1,17 +0,0 @@ |
|||
# |
|||
# Testing robustness against random compression failures |
|||
# |
|||
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(msg)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; |
|||
SHOW CREATE TABLE t1; |
|||
Table Create Table |
|||
t1 CREATE TABLE `t1` ( |
|||
`id` int(11) NOT NULL AUTO_INCREMENT, |
|||
`msg` varchar(255) DEFAULT NULL, |
|||
PRIMARY KEY (`id`), |
|||
KEY `msg_i` (`msg`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 |
|||
SET GLOBAL innodb_simulate_comp_failures = 25; |
|||
COMMIT; |
|||
SELECT COUNT(id) FROM t1; |
|||
COUNT(id) |
|||
1500 |
@ -1,17 +0,0 @@ |
|||
# |
|||
# Testing robustness against random compression failures |
|||
# |
|||
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(msg)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; |
|||
SHOW CREATE TABLE t1; |
|||
Table Create Table |
|||
t1 CREATE TABLE `t1` ( |
|||
`id` int(11) NOT NULL AUTO_INCREMENT, |
|||
`msg` varchar(255) DEFAULT NULL, |
|||
PRIMARY KEY (`id`), |
|||
KEY `msg_i` (`msg`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 |
|||
SET GLOBAL innodb_simulate_comp_failures = 25; |
|||
COMMIT; |
|||
SELECT COUNT(id) FROM t1; |
|||
COUNT(id) |
|||
1000 |
@ -1,3 +0,0 @@ |
|||
--innodb-file-per-table |
|||
--skip-innodb-doublewrite |
|||
--skip-innodb-read-only-compressed |
@ -1,9 +0,0 @@ |
|||
--source include/big_test.inc |
|||
# test takes too long with valgrind |
|||
--source include/not_valgrind.inc |
|||
--source include/have_debug.inc |
|||
--let $num_inserts = 1500 |
|||
--let $num_ops = 3500 |
|||
--source suite/innodb/include/innodb_simulate_comp_failures.inc |
|||
# clean exit |
|||
--exit |
@ -1,2 +0,0 @@ |
|||
--innodb-file-per-table |
|||
--skip-innodb-read-only-compressed |
@ -1,8 +0,0 @@ |
|||
--source include/have_debug.inc |
|||
--source include/not_valgrind.inc |
|||
|
|||
--let $num_inserts = 1000 |
|||
--let $num_ops = 30 |
|||
--source suite/innodb/include/innodb_simulate_comp_failures.inc |
|||
# clean exit |
|||
--exit |
@ -1,77 +0,0 @@ |
|||
SET @start_global_value = @@global.innodb_simulate_comp_failures; |
|||
SELECT @start_global_value; |
|||
@start_global_value |
|||
0 |
|||
Valid values are between 0 and 99 |
|||
select @@global.innodb_simulate_comp_failures between 0 and 99; |
|||
@@global.innodb_simulate_comp_failures between 0 and 99 |
|||
1 |
|||
select @@global.innodb_simulate_comp_failures; |
|||
@@global.innodb_simulate_comp_failures |
|||
0 |
|||
select @@session.innodb_simulate_comp_failures; |
|||
ERROR HY000: Variable 'innodb_simulate_comp_failures' is a GLOBAL variable |
|||
show global variables like 'innodb_simulate_comp_failures'; |
|||
Variable_name Value |
|||
innodb_simulate_comp_failures 0 |
|||
show session variables like 'innodb_simulate_comp_failures'; |
|||
Variable_name Value |
|||
innodb_simulate_comp_failures 0 |
|||
select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; |
|||
VARIABLE_NAME VARIABLE_VALUE |
|||
INNODB_SIMULATE_COMP_FAILURES 0 |
|||
select * from information_schema.session_variables where variable_name='innodb_simulate_comp_failures'; |
|||
VARIABLE_NAME VARIABLE_VALUE |
|||
INNODB_SIMULATE_COMP_FAILURES 0 |
|||
set global innodb_simulate_comp_failures=10; |
|||
select @@global.innodb_simulate_comp_failures; |
|||
@@global.innodb_simulate_comp_failures |
|||
10 |
|||
select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; |
|||
VARIABLE_NAME VARIABLE_VALUE |
|||
INNODB_SIMULATE_COMP_FAILURES 10 |
|||
select * from information_schema.session_variables where variable_name='innodb_simulate_comp_failures'; |
|||
VARIABLE_NAME VARIABLE_VALUE |
|||
INNODB_SIMULATE_COMP_FAILURES 10 |
|||
set session innodb_simulate_comp_failures=1; |
|||
ERROR HY000: Variable 'innodb_simulate_comp_failures' is a GLOBAL variable and should be set with SET GLOBAL |
|||
set global innodb_simulate_comp_failures=1.1; |
|||
ERROR 42000: Incorrect argument type to variable 'innodb_simulate_comp_failures' |
|||
set global innodb_simulate_comp_failures=1e1; |
|||
ERROR 42000: Incorrect argument type to variable 'innodb_simulate_comp_failures' |
|||
set global innodb_simulate_comp_failures="foo"; |
|||
ERROR 42000: Incorrect argument type to variable 'innodb_simulate_comp_failures' |
|||
set global innodb_simulate_comp_failures=-7; |
|||
Warnings: |
|||
Warning 1292 Truncated incorrect innodb_simulate_comp_failures value: '-7' |
|||
select @@global.innodb_simulate_comp_failures; |
|||
@@global.innodb_simulate_comp_failures |
|||
0 |
|||
select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; |
|||
VARIABLE_NAME VARIABLE_VALUE |
|||
INNODB_SIMULATE_COMP_FAILURES 0 |
|||
set global innodb_simulate_comp_failures=106; |
|||
Warnings: |
|||
Warning 1292 Truncated incorrect innodb_simulate_comp_failures value: '106' |
|||
select @@global.innodb_simulate_comp_failures; |
|||
@@global.innodb_simulate_comp_failures |
|||
99 |
|||
select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; |
|||
VARIABLE_NAME VARIABLE_VALUE |
|||
INNODB_SIMULATE_COMP_FAILURES 99 |
|||
set global innodb_simulate_comp_failures=0; |
|||
select @@global.innodb_simulate_comp_failures; |
|||
@@global.innodb_simulate_comp_failures |
|||
0 |
|||
set global innodb_simulate_comp_failures=99; |
|||
select @@global.innodb_simulate_comp_failures; |
|||
@@global.innodb_simulate_comp_failures |
|||
99 |
|||
set global innodb_simulate_comp_failures=DEFAULT; |
|||
select @@global.innodb_simulate_comp_failures; |
|||
@@global.innodb_simulate_comp_failures |
|||
0 |
|||
SET @@global.innodb_simulate_comp_failures = @start_global_value; |
|||
SELECT @@global.innodb_simulate_comp_failures; |
|||
@@global.innodb_simulate_comp_failures |
|||
0 |
@ -1,65 +0,0 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
|
|||
SET @start_global_value = @@global.innodb_simulate_comp_failures; |
|||
SELECT @start_global_value; |
|||
|
|||
# |
|||
# exists as global only |
|||
# |
|||
|
|||
--echo Valid values are between 0 and 99 |
|||
select @@global.innodb_simulate_comp_failures between 0 and 99; |
|||
select @@global.innodb_simulate_comp_failures; |
|||
|
|||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
|||
select @@session.innodb_simulate_comp_failures; |
|||
|
|||
show global variables like 'innodb_simulate_comp_failures'; |
|||
show session variables like 'innodb_simulate_comp_failures'; |
|||
select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; |
|||
select * from information_schema.session_variables where variable_name='innodb_simulate_comp_failures'; |
|||
|
|||
# |
|||
# show that it's writable |
|||
# |
|||
|
|||
set global innodb_simulate_comp_failures=10; |
|||
select @@global.innodb_simulate_comp_failures; |
|||
select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; |
|||
select * from information_schema.session_variables where variable_name='innodb_simulate_comp_failures'; |
|||
|
|||
--error ER_GLOBAL_VARIABLE |
|||
set session innodb_simulate_comp_failures=1; |
|||
|
|||
# |
|||
# incorrect types |
|||
# |
|||
|
|||
--error ER_WRONG_TYPE_FOR_VAR |
|||
set global innodb_simulate_comp_failures=1.1; |
|||
--error ER_WRONG_TYPE_FOR_VAR |
|||
set global innodb_simulate_comp_failures=1e1; |
|||
--error ER_WRONG_TYPE_FOR_VAR |
|||
set global innodb_simulate_comp_failures="foo"; |
|||
|
|||
set global innodb_simulate_comp_failures=-7; |
|||
select @@global.innodb_simulate_comp_failures; |
|||
select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; |
|||
set global innodb_simulate_comp_failures=106; |
|||
select @@global.innodb_simulate_comp_failures; |
|||
select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; |
|||
|
|||
# |
|||
# min/max/DEFAULT values |
|||
# |
|||
|
|||
set global innodb_simulate_comp_failures=0; |
|||
select @@global.innodb_simulate_comp_failures; |
|||
set global innodb_simulate_comp_failures=99; |
|||
select @@global.innodb_simulate_comp_failures; |
|||
set global innodb_simulate_comp_failures=DEFAULT; |
|||
select @@global.innodb_simulate_comp_failures; |
|||
|
|||
SET @@global.innodb_simulate_comp_failures = @start_global_value; |
|||
SELECT @@global.innodb_simulate_comp_failures; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue