Browse Source
MDEV-13564 Mariabackup does not work with TRUNCATE
MDEV-13564 Mariabackup does not work with TRUNCATE
Implement undo tablespace truncation via normal redo logging. Implement TRUNCATE TABLE as a combination of RENAME to #sql-ib name, CREATE, and DROP. Note: Orphan #sql-ib*.ibd may be left behind if MariaDB Server 10.2 is killed before the DROP operation is committed. If MariaDB Server 10.2 is killed during TRUNCATE, it is also possible that the old table was renamed to #sql-ib*.ibd but the data dictionary will refer to the table using the original name. In MariaDB Server 10.3, RENAME inside InnoDB is transactional, and #sql-* tables will be dropped on startup. So, this new TRUNCATE will be fully crash-safe in 10.3. ha_mroonga::wrapper_truncate(): Pass table options to the underlying storage engine, now that ha_innobase::truncate() will need them. rpl_slave_state::truncate_state_table(): Before truncating mysql.gtid_slave_pos, evict any cached table handles from the table definition cache, so that there will be no stale references to the old table after truncating. == TRUNCATE TABLE == WL#6501 in MySQL 5.7 introduced separate log files for implementing atomic and crash-safe TRUNCATE TABLE, instead of using the InnoDB undo and redo log. Some convoluted logic was added to the InnoDB crash recovery, and some extra synchronization (including a redo log checkpoint) was introduced to make this work. This synchronization has caused performance problems and race conditions, and the extra log files cannot be copied or applied by external backup programs. In order to support crash-upgrade from MariaDB 10.2, we will keep the logic for parsing and applying the extra log files, but we will no longer generate those files in TRUNCATE TABLE. A prerequisite for crash-safe TRUNCATE is a crash-safe RENAME TABLE (with full redo and undo logging and proper rollback). This will be implemented in MDEV-14717. ha_innobase::truncate(): Invoke RENAME, create(), delete_table(). Because RENAME cannot be fully rolled back before MariaDB 10.3 due to missing undo logging, add some explicit rename-back in case the operation fails. ha_innobase::delete(): Introduce a variant that takes sqlcom as a parameter. In TRUNCATE TABLE, we do not want to touch any FOREIGN KEY constraints. ha_innobase::create(): Add the parameters file_per_table, trx. In TRUNCATE, the new table must be created in the same transaction that renames the old table. create_table_info_t::create_table_info_t(): Add the parameters file_per_table, trx. row_drop_table_for_mysql(): Replace a bool parameter with sqlcom. row_drop_table_after_create_fail(): New function, wrapping row_drop_table_for_mysql(). dict_truncate_index_tree_in_mem(), fil_truncate_tablespace(), fil_prepare_for_truncate(), fil_reinit_space_header_for_table(), row_truncate_table_for_mysql(), TruncateLogger, row_truncate_prepare(), row_truncate_rollback(), row_truncate_complete(), row_truncate_fts(), row_truncate_update_system_tables(), row_truncate_foreign_key_checks(), row_truncate_sanity_checks(): Remove. row_upd_check_references_constraints(): Remove a check for TRUNCATE, now that the table is no longer truncated in place. The new test innodb.truncate_foreign uses DEBUG_SYNC to cover some race-condition like scenarios. The test innodb-innodb.truncate does not use any synchronization. We add a redo log subformat to indicate backup-friendly format. MariaDB 10.4 will remove support for the old TRUNCATE logging, so crash-upgrade from old 10.2 or 10.3 to 10.4 will involve limitations. == Undo tablespace truncation == MySQL 5.7 implements undo tablespace truncation. It is only possible when innodb_undo_tablespaces is set to at least 2. The logging is implemented similar to the WL#6501 TRUNCATE, that is, using separate log files and a redo log checkpoint. We can simply implement undo tablespace truncation within a single mini-transaction that reinitializes the undo log tablespace file. Unfortunately, due to the redo log format of some operations, currently, the total redo log written by undo tablespace truncation will be more than the combined size of the truncated undo tablespace. It should be acceptable to have a little more than 1 megabyte of log in a single mini-transaction. This will be fixed in MDEV-17138 in MariaDB Server 10.4. recv_sys_t: Add truncated_undo_spaces[] to remember for which undo tablespaces a MLOG_FILE_CREATE2 record was seen. namespace undo: Remove some unnecessary declarations. fil_space_t::is_being_truncated: Document that this flag now only applies to undo tablespaces. Remove some references. fil_space_t::is_stopping(): Do not refer to is_being_truncated. This check is for tablespaces of tables. Potentially used tablespaces are never truncated any more. buf_dblwr_process(): Suppress the out-of-bounds warning for undo tablespaces. fil_truncate_log(): Write a MLOG_FILE_CREATE2 with a nonzero page number (new size of the tablespace in pages) to inform crash recovery that the undo tablespace size has been reduced. fil_op_write_log(): Relax assertions, so that MLOG_FILE_CREATE2 can be written for undo tablespaces (without .ibd file suffix) for a nonzero page number. os_file_truncate(): Add the parameter allow_shrink=false so that undo tablespaces can actually be shrunk using this function. fil_name_parse(): For undo tablespace truncation, buffer MLOG_FILE_CREATE2 in truncated_undo_spaces[]. recv_read_in_area(): Avoid reading pages for which no redo log records remain buffered, after recv_addr_trim() removed them. trx_rseg_header_create(): Add a FIXME comment that we could write much less redo log. trx_undo_truncate_tablespace(): Reinitialize the undo tablespace in a single mini-transaction, which will be flushed to the redo log before the file size is trimmed. recv_addr_trim(): Discard any redo logs for pages that were logged after the new end of a file, before the truncation LSN. If the rec_list becomes empty, reduce n_addrs. After removing any affected records, actually truncate the file. recv_apply_hashed_log_recs(): Invoke recv_addr_trim() right before applying any log records. The undo tablespace files must be open at this point. buf_flush_or_remove_pages(), buf_flush_dirty_pages(), buf_LRU_flush_or_remove_pages(): Add a parameter for specifying the number of the first page to flush or remove (default 0). trx_purge_initiate_truncate(): Remove the log checkpoints, the extra logging, and some unnecessary crash points. Merge the code from trx_undo_truncate_tablespace(). First, flush all to-be-discarded pages (beyond the new end of the file), then trim the space->size to make the page allocation deterministic. At the only remaining crash injection point, flush the redo log, so that the recovery can be tested.pull/871/head
83 changed files with 906 additions and 6946 deletions
-
1extra/mariabackup/xtrabackup.cc
-
6mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
-
6mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
-
416mysql-test/suite/innodb/include/innodb_wl6501_crash.inc
-
98mysql-test/suite/innodb/include/innodb_wl6501_crash_temp.inc
-
8mysql-test/suite/innodb/r/truncate.result
-
88mysql-test/suite/innodb/r/truncate_debug.result
-
58mysql-test/suite/innodb/r/truncate_foreign.result
-
114mysql-test/suite/innodb/r/truncate_inject.result
-
17mysql-test/suite/innodb/r/truncate_missing.result
-
29mysql-test/suite/innodb/r/truncate_purge_debug.result
-
12mysql-test/suite/innodb/r/truncate_restart.result
-
17mysql-test/suite/innodb/t/truncate.test
-
127mysql-test/suite/innodb/t/truncate_debug.test
-
68mysql-test/suite/innodb/t/truncate_foreign.test
-
97mysql-test/suite/innodb/t/truncate_inject.test
-
22mysql-test/suite/innodb/t/truncate_missing.test
-
3mysql-test/suite/innodb/t/truncate_purge_debug.opt
-
49mysql-test/suite/innodb/t/truncate_purge_debug.test
-
16mysql-test/suite/innodb/t/truncate_restart.test
-
31mysql-test/suite/innodb_fts/r/truncate.result
-
1mysql-test/suite/innodb_fts/t/truncate.opt
-
50mysql-test/suite/innodb_fts/t/truncate.test
-
8mysql-test/suite/innodb_undo/include/truncate_recover.inc
-
1mysql-test/suite/innodb_undo/r/truncate.result
-
1mysql-test/suite/innodb_undo/r/truncate_multi_client.result
-
16mysql-test/suite/innodb_undo/r/truncate_recover.result
-
1mysql-test/suite/innodb_undo/t/truncate.test
-
1mysql-test/suite/innodb_undo/t/truncate_multi_client.test
-
38mysql-test/suite/innodb_undo/t/truncate_recover.test
-
112mysql-test/suite/innodb_zip/include/innodb_wl6501_scale.inc
-
24mysql-test/suite/innodb_zip/r/restart.result
-
1202mysql-test/suite/innodb_zip/r/wl6501_1.result
-
462mysql-test/suite/innodb_zip/r/wl6501_crash_3.result
-
519mysql-test/suite/innodb_zip/r/wl6501_crash_4.result
-
462mysql-test/suite/innodb_zip/r/wl6501_crash_5.result
-
345mysql-test/suite/innodb_zip/r/wl6501_scale_1.result
-
451mysql-test/suite/innodb_zip/t/wl6501_1.test
-
25mysql-test/suite/innodb_zip/t/wl6501_crash_3.test
-
27mysql-test/suite/innodb_zip/t/wl6501_crash_4.test
-
25mysql-test/suite/innodb_zip/t/wl6501_crash_5.test
-
37mysql-test/suite/innodb_zip/t/wl6501_scale_1.test
-
1mysql-test/suite/mariabackup/truncate_during_backup.test
-
2sql/rpl_gtid.cc
-
3storage/innobase/buf/buf0dblwr.cc
-
26storage/innobase/buf/buf0lru.cc
-
26storage/innobase/buf/buf0rea.cc
-
99storage/innobase/dict/dict0crea.cc
-
6storage/innobase/fil/fil0crypt.cc
-
185storage/innobase/fil/fil0fil.cc
-
1storage/innobase/fsp/fsp0fsp.cc
-
14storage/innobase/fts/fts0fts.cc
-
242storage/innobase/handler/ha_innodb.cc
-
19storage/innobase/handler/ha_innodb.h
-
3storage/innobase/handler/handler0alter.cc
-
2storage/innobase/ibuf/ibuf0ibuf.cc
-
6storage/innobase/include/buf0lru.h
-
8storage/innobase/include/dict0crea.h
-
52storage/innobase/include/fil0fil.h
-
4storage/innobase/include/lock0lock.h
-
8storage/innobase/include/log0log.h
-
9storage/innobase/include/log0recv.h
-
7storage/innobase/include/os0file.h
-
46storage/innobase/include/row0mysql.h
-
11storage/innobase/include/row0trunc.h
-
38storage/innobase/include/trx0purge.h
-
14storage/innobase/include/trx0undo.h
-
9storage/innobase/lock/lock0lock.cc
-
1storage/innobase/log/log0log.cc
-
99storage/innobase/log/log0recv.cc
-
22storage/innobase/os/os0file.cc
-
3storage/innobase/row/row0ins.cc
-
2storage/innobase/row/row0merge.cc
-
139storage/innobase/row/row0mysql.cc
-
1270storage/innobase/row/row0trunc.cc
-
4storage/innobase/row/row0uins.cc
-
4storage/innobase/row/row0umod.cc
-
28storage/innobase/row/row0upd.cc
-
3storage/innobase/srv/srv0start.cc
-
229storage/innobase/trx/trx0purge.cc
-
6storage/innobase/trx/trx0rseg.cc
-
99storage/innobase/trx/trx0undo.cc
-
11storage/mroonga/ha_mroonga.cpp
@ -1,416 +0,0 @@ |
|||
# |
|||
# WL#6501: make truncate table atomic |
|||
# |
|||
|
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
--source include/big_test.inc |
|||
|
|||
# Valgrind would complain about memory leaks when we crash on purpose. |
|||
--source include/not_valgrind.inc |
|||
# Embedded server does not support crashing |
|||
--source include/not_embedded.inc |
|||
# Avoid CrashReporter popup on Mac |
|||
--source include/not_crashrep.inc |
|||
|
|||
# suppress expected warnings. |
|||
call mtr.add_suppression("The file '.*' already exists though the corresponding table did not exist in the InnoDB data dictionary"); |
|||
call mtr.add_suppression("Cannot create file '.*'"); |
|||
call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'"); |
|||
|
|||
################################################################################ |
|||
# |
|||
# Will test following scenarios: |
|||
# 1. Hit crash point while writing redo log. |
|||
# 2. Hit crash point on completion of redo log write. |
|||
# 3. Hit crash point while dropping indexes. |
|||
# 4. Hit crash point on completing drop of all indexes before creation of index |
|||
# is commenced. |
|||
# 5. Hit crash point while creating indexes. |
|||
# 6. Hit crash point after data is updated to system-table and in-memory dict. |
|||
# 7. Hit crash point before/after log checkpoint is done. |
|||
# |
|||
################################################################################ |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# create test-bed |
|||
# |
|||
let $per_table = `select @@innodb_file_per_table`; |
|||
|
|||
eval set global innodb_file_per_table = on; |
|||
let $WL6501_TMP_DIR = `select @@tmpdir`; |
|||
let $WL6501_DATA_DIR = `select @@datadir`; |
|||
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/my_restart.err; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# 1. Hit crash point while writing redo log. |
|||
# |
|||
--echo "1. Hit crash point while writing redo log." |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine=innodb row_format=$wl6501_row_fmt |
|||
key_block_size=$wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_while_writing_redo_log"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
select * from t; |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# 2. Hit crash point on completion of redo log write. |
|||
# |
|||
--echo "2. Hit crash point on completion of redo log write." |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_after_redo_log_write_complete"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
select * from t; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# 3. Hit crash point while dropping indexes. |
|||
# |
|||
--echo "3. Hit crash point while dropping indexes." |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_clust_index"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
select * from t; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
# |
|||
# |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_uniq_index"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
# |
|||
check table t; |
|||
select * from t; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
# |
|||
# |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), index ck(c)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_sec_index"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
select * from t; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# 4. Hit crash point on completing drop of all indexes before creation of index |
|||
# is commenced. |
|||
# |
|||
--echo "4. Hit crash point on completing drop of all indexes before creation" |
|||
--echo " of index is commenced." |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
select * from t; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# 5. Hit crash point while creating indexes. |
|||
# |
|||
--echo "5. Hit crash point while creating indexes." |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_clust_index"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
select * from t; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
# |
|||
# |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_uniq_index"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
select * from t; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
# |
|||
# |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), index ck(c)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_sec_index"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
select * from t; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# 6. Hit crash point after data is updated to system-table and in-memory dict. |
|||
# |
|||
--echo "6. Hit crash point after data is updated to system-table and" |
|||
--echo " in-memory dict." |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
select * from t; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# 7. Hit crash point before/after log checkpoint is done. |
|||
# |
|||
--echo "7. Hit crash point before/after log checkpoint is done." |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_before_log_removal"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
select * from t; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
# |
|||
# |
|||
use test; |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
SET innodb_strict_mode=OFF; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_after_truncate_done"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
select * from t; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
select * from t where f < 2.5; |
|||
drop table t; |
|||
|
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# remove test-bed |
|||
# |
|||
eval set global innodb_file_per_table = $per_table; |
@ -1,98 +0,0 @@ |
|||
# |
|||
# WL#6501: make truncate table atomic |
|||
# |
|||
|
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
--source include/big_test.inc |
|||
|
|||
# Valgrind would complain about memory leaks when we crash on purpose. |
|||
--source include/not_valgrind.inc |
|||
# Embedded server does not support crashing |
|||
--source include/not_embedded.inc |
|||
# Avoid CrashReporter popup on Mac |
|||
--source include/not_crashrep.inc |
|||
|
|||
# suppress expected warnings |
|||
call mtr.add_suppression("does not exist in the InnoDB internal"); |
|||
|
|||
################################################################################ |
|||
# |
|||
# Will test following scenarios: |
|||
# 1. Hit crash point on completing drop of all indexes before creation of index |
|||
# is commenced. |
|||
# 2. Hit crash point after data is updated to system-table and in-memory dict. |
|||
# |
|||
################################################################################ |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# create test-bed |
|||
# |
|||
let $per_table = `select @@innodb_file_per_table`; |
|||
|
|||
eval set global innodb_file_per_table = on; |
|||
let $WL6501_TMP_DIR = `select @@tmpdir`; |
|||
let $WL6501_DATA_DIR = `select @@datadir`; |
|||
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/my_restart.err; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# 1. Hit crash point on completing drop of all indexes before creation of index |
|||
# is commenced. |
|||
# |
|||
--echo "1. Hit crash point on completing drop of all indexes before creation" |
|||
--echo " of index is commenced." |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
set innodb_strict_mode=off; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# 2. Hit crash point after data is updated to system-table and in-memory dict. |
|||
# |
|||
--echo "2. Hit crash point after data is updated to system-table and" |
|||
--echo " in-memory dict." |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
set innodb_strict_mode=off; |
|||
--disable_warnings |
|||
eval create $wl6501_temp table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = $wl6501_row_fmt |
|||
key_block_size = $wl6501_kbs; |
|||
--enable_warnings |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
check table t; |
|||
# |
|||
set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info"; |
|||
--source include/expect_crash.inc |
|||
--error 2013 |
|||
truncate table t; |
|||
# |
|||
--source include/start_mysqld.inc |
|||
check table t; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# remove test-bed |
|||
# |
|||
eval set global innodb_file_per_table = $per_table; |
@ -0,0 +1,8 @@ |
|||
CREATE TABLE t (a SERIAL) ENGINE=InnoDB; |
|||
connect dml,localhost,root; |
|||
select * from t; |
|||
a |
|||
connection default; |
|||
TRUNCATE TABLE t; |
|||
disconnect dml; |
|||
DROP TABLE t; |
@ -1,88 +0,0 @@ |
|||
# |
|||
# Bug #23070734 CONCURRENT TRUNCATE TABLES CAUSE STALLS |
|||
# |
|||
SET @ahi= @@global.innodb_adaptive_hash_index; |
|||
SET GLOBAL innodb_adaptive_hash_index=OFF; |
|||
SET GLOBAL innodb_adaptive_hash_index=ON; |
|||
Test_1 :- Check if DDL operations are possible on |
|||
table being truncated. Also check if |
|||
DDL operations on other tables succeed. |
|||
create table t1 (f1 int,f2 int,key(f2),f3 int) engine=innodb; |
|||
create index idx1 on t1(f3); |
|||
create table t2 (f1 int,f2 int,key(f2),f3 int) engine=innodb; |
|||
create table t3 (f1 int,f2 int,key(f2)) engine=innodb; |
|||
insert into t1 values (10,20,30),(30,40,50),(50,60,70); |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t2 values (10,20,30),(30,40,50),(50,60,70); |
|||
insert into t2 select * from t2; |
|||
insert into t2 select * from t2; |
|||
insert into t2 select * from t2; |
|||
insert into t3 values (10,20),(30,40),(50,50); |
|||
insert into t3 select * from t3; |
|||
insert into t3 select * from t3; |
|||
SET session lock_wait_timeout = 1; |
|||
connect con1,localhost,root,,; |
|||
SET DEBUG_SYNC= 'buffer_pool_scan SIGNAL started WAIT_FOR finish_scan'; |
|||
truncate table t1; |
|||
connection default; |
|||
SET DEBUG_SYNC= 'now WAIT_FOR started'; |
|||
Check Analyze table. Gives lock time out error. |
|||
analyze table t1; |
|||
Table Op Msg_type Msg_text |
|||
test.t1 analyze Error Lock wait timeout exceeded; try restarting transaction |
|||
test.t1 analyze status Operation failed |
|||
Check if we can turn off auto recalculation. |
|||
alter table t1 STATS_AUTO_RECALC=0; |
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
|||
Check if we can turn off persistent stats on the table |
|||
alter table t1 STATS_PERSISTENT=0; |
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
|||
Check if DML is possible on table being truncated |
|||
insert into t1 values (10,89,99); |
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
|||
Check if DDL is possible on table being truncated |
|||
alter table t1 add column f4 int; |
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
|||
check if table can be created with the same name |
|||
create table t1 (bd int) engine=innodb; |
|||
Got one of the listed errors |
|||
check if index can be created on table being truncated |
|||
create index idx1 on t1(f1); |
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
|||
Check if DROP of table is possible during truncate |
|||
drop table t1; |
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
|||
Check if select is possible during truncate |
|||
select * from t1; |
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
|||
select * from t2 where t2.f1=t1.f1; |
|||
ERROR 42S22: Unknown column 't1.f1' in 'where clause' |
|||
Check concurrent truncate operation on table; |
|||
truncate table t1; |
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
|||
Check concurrent selects and inserts on the other table |
|||
insert into t3 values (10,20),(30,40),(50,50); |
|||
select * from t3 where f1=40; |
|||
f1 f2 |
|||
Concurrent truncate on other tables |
|||
truncate table t2; |
|||
Concurrent alters on the other tables |
|||
alter table t2 add column f4 int; |
|||
check if index can be created on the other table |
|||
create index idx1 on t2(f3); |
|||
Check if we can turn off persistent stats off entire instance |
|||
SET GLOBAL innodb_stats_persistent=off; |
|||
connect con2,localhost,root,,; |
|||
set global innodb_adaptive_hash_index=off; |
|||
connection default; |
|||
SET DEBUG_SYNC= 'now SIGNAL finish_scan'; |
|||
connection con1; |
|||
disconnect con1; |
|||
connection con2; |
|||
disconnect con2; |
|||
connection default; |
|||
SET DEBUG_SYNC= 'RESET'; |
|||
SET GLOBAL innodb_adaptive_hash_index=@ahi; |
|||
drop table t1,t2,t3; |
@ -0,0 +1,58 @@ |
|||
CREATE TABLE parent (a INT PRIMARY KEY) ENGINE=InnoDB; |
|||
INSERT INTO parent SET a=1; |
|||
CREATE TABLE child (a INT PRIMARY KEY, FOREIGN KEY (a) REFERENCES parent(a) |
|||
ON UPDATE CASCADE) |
|||
ENGINE=InnoDB; |
|||
INSERT INTO child SET a=1; |
|||
TRUNCATE TABLE parent; |
|||
ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`parent` (`a`)) |
|||
TRUNCATE TABLE child; |
|||
INSERT INTO child SET a=1; |
|||
UPDATE parent SET a=2; |
|||
SELECT * FROM child; |
|||
a |
|||
2 |
|||
connect dml,localhost,root; |
|||
SET DEBUG_SYNC='foreign_constraint_update_cascade SIGNAL fk WAIT_FOR go'; |
|||
UPDATE parent SET a=3; |
|||
connection default; |
|||
SET DEBUG_SYNC='now WAIT_FOR fk'; |
|||
SET lock_wait_timeout=1; |
|||
TRUNCATE TABLE child; |
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
|||
SET DEBUG_SYNC='now SIGNAL go'; |
|||
connection dml; |
|||
SELECT * FROM child; |
|||
a |
|||
3 |
|||
SET DEBUG_SYNC='foreign_constraint_check_for_update SIGNAL fk WAIT_FOR go'; |
|||
DELETE FROM parent; |
|||
connection default; |
|||
SET DEBUG_SYNC='now WAIT_FOR fk'; |
|||
TRUNCATE TABLE child; |
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
|||
SET DEBUG_SYNC='now SIGNAL go'; |
|||
connection dml; |
|||
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`a`) REFERENCES `parent` (`a`) ON UPDATE CASCADE) |
|||
SELECT * FROM child; |
|||
a |
|||
3 |
|||
INSERT INTO parent SET a=5; |
|||
SET DEBUG_SYNC='foreign_constraint_check_for_ins SIGNAL fk WAIT_FOR go'; |
|||
INSERT INTO child SET a=5; |
|||
connection default; |
|||
SET DEBUG_SYNC='now WAIT_FOR fk'; |
|||
SET foreign_key_checks=0; |
|||
TRUNCATE TABLE parent; |
|||
SET DEBUG_SYNC='now SIGNAL go'; |
|||
connection dml; |
|||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`a`) REFERENCES `parent` (`a`) ON UPDATE CASCADE) |
|||
SELECT * FROM parent; |
|||
a |
|||
SELECT * FROM child; |
|||
a |
|||
3 |
|||
disconnect dml; |
|||
connection default; |
|||
SET DEBUG_SYNC = RESET; |
|||
DROP TABLE child, parent; |
@ -1,114 +0,0 @@ |
|||
SET @save_dbug = @@SESSION.debug_dbug; |
|||
call mtr.add_suppression("InnoDB: Flagged corruption of .* in table `test`\\.`t` in TRUNCATE TABLE"); |
|||
# 1. Error in assigning undo logs for truncate action |
|||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) |
|||
ENGINE = InnoDB; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
SET debug_dbug = '+d,ib_err_trunc_assigning_undo_log'; |
|||
truncate table t; |
|||
ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB |
|||
SET debug_dbug = @save_dbug; |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
# 2. Error while preparing for truncate |
|||
SET debug_dbug = '+d,ib_err_trunc_preparing_for_truncate'; |
|||
truncate table t; |
|||
ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB |
|||
SET debug_dbug = @save_dbug; |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
# 3. Error while dropping/creating indexes |
|||
SET debug_dbug = '+d,ib_err_trunc_drop_index'; |
|||
truncate table t; |
|||
ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB |
|||
SET debug_dbug = @save_dbug; |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check Warning InnoDB: Index PRIMARY is marked as corrupted |
|||
test.t check error Corrupt |
|||
select * from t; |
|||
Got one of the listed errors |
|||
drop table t; |
|||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) |
|||
ENGINE = InnoDB; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
SET debug_dbug = '+d,ib_err_trunc_create_index'; |
|||
truncate table t; |
|||
ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB |
|||
SET debug_dbug = @save_dbug; |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check Warning InnoDB: Index PRIMARY is marked as corrupted |
|||
test.t check error Corrupt |
|||
select * from t; |
|||
Got one of the listed errors |
|||
drop table t; |
|||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) |
|||
ENGINE = InnoDB; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; |
|||
truncate table t; |
|||
SET debug_dbug = @save_dbug; |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
drop table t; |
|||
# 4. Error while completing truncate of table involving FTS |
|||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), |
|||
FULLTEXT INDEX(c)) ENGINE = InnoDB; |
|||
insert into t values (1, 1.1, 'mysql is now oracle company'), |
|||
(2, 2.2, 'innodb is part of mysql'), |
|||
(3, 3.3, 'innodb is default storage engine of mysql'); |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; |
|||
truncate table t; |
|||
SET debug_dbug = @save_dbug; |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
drop table t; |
|||
# 5. Error while updating sys-tables |
|||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), |
|||
FULLTEXT INDEX(c)) ENGINE = InnoDB; |
|||
insert into t values (1, 1.1, 'mysql is now oracle company'), |
|||
(2, 2.2, 'innodb is part of mysql'), |
|||
(3, 3.3, 'innodb is default storage engine of mysql'); |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; |
|||
truncate table t; |
|||
SET debug_dbug = @save_dbug; |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t order by i; |
|||
i f c |
|||
drop table t; |
@ -0,0 +1,17 @@ |
|||
call mtr.add_suppression("InnoDB: Operating system error number "); |
|||
call mtr.add_suppression("InnoDB: (The error means|If you are|Cannot open datafile) "); |
|||
call mtr.add_suppression("InnoDB: Ignoring tablespace for `test`\.`t`"); |
|||
call mtr.add_suppression("InnoDB: Table test/t .* does not exist"); |
|||
CREATE TABLE t (a SERIAL) ENGINE=InnoDB; |
|||
INSERT INTO t() VALUES(); |
|||
SHOW CREATE TABLE t; |
|||
Table Create Table |
|||
t CREATE TABLE `t` ( |
|||
`a` bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
|||
UNIQUE KEY `a` (`a`) |
|||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |
|||
SELECT * FROM t; |
|||
ERROR 42S02: Table 'test.t' doesn't exist in engine |
|||
TRUNCATE TABLE t; |
|||
ERROR 42S02: Table 'test.t' doesn't exist in engine |
|||
DROP TABLE t; |
@ -1,29 +0,0 @@ |
|||
# |
|||
# Bug #23070734 CONCURRENT TRUNCATE TABLES CAUSE STALLS |
|||
# |
|||
create table t1 (f1 int ,f2 int,key(f2)) engine=innodb; |
|||
begin; |
|||
insert into t1 values (10,45),(20,78),(30,88),(40,23),(50,78),(60,11),(70,56),(80,90); |
|||
delete from t1; |
|||
connect con2,localhost,root,,; |
|||
START TRANSACTION WITH CONSISTENT SNAPSHOT; |
|||
connection default; |
|||
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency; |
|||
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; |
|||
commit; |
|||
connect con1,localhost,root,,; |
|||
SET DEBUG_SYNC= 'buffer_pool_scan SIGNAL started WAIT_FOR finish_scan'; |
|||
truncate table t1; |
|||
connection con2; |
|||
SET DEBUG_SYNC= 'now WAIT_FOR started'; |
|||
COMMIT; |
|||
disconnect con2; |
|||
connection default; |
|||
InnoDB 0 transactions not purged |
|||
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; |
|||
SET DEBUG_SYNC = 'now SIGNAL finish_scan'; |
|||
connection con1; |
|||
disconnect con1; |
|||
connection default; |
|||
SET DEBUG_SYNC = 'RESET'; |
|||
drop table t1; |
@ -1,12 +0,0 @@ |
|||
SET GLOBAL innodb_stats_persistent= ON; |
|||
CREATE TABLE t1 (t TEXT) ENGINE=InnoDB STATS_PERSISTENT=1; |
|||
connect con1,localhost,root,,test; |
|||
SET DEBUG_SYNC='ib_trunc_table_trunc_completing SIGNAL committed WAIT_FOR ever'; |
|||
TRUNCATE TABLE t1; |
|||
connection default; |
|||
SET DEBUG_SYNC='now WAIT_FOR committed'; |
|||
disconnect con1; |
|||
SELECT COUNT(*) FROM t1; |
|||
COUNT(*) |
|||
0 |
|||
DROP TABLE t1; |
@ -0,0 +1,17 @@ |
|||
--source include/have_innodb.inc |
|||
|
|||
CREATE TABLE t (a SERIAL) ENGINE=InnoDB; |
|||
|
|||
connect (dml,localhost,root); |
|||
# At the end of this statement, close_thread_tables() |
|||
# should add the open table handle to the table definition cache (tdc). |
|||
select * from t; |
|||
|
|||
connection default; |
|||
# This should purge the handle from the tdc; |
|||
# otherwise ha_innobase::truncate() would hang, |
|||
# waiting for the reference count to drop to 0. |
|||
TRUNCATE TABLE t; |
|||
disconnect dml; |
|||
|
|||
DROP TABLE t; |
@ -1,127 +0,0 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
--source include/have_debug_sync.inc |
|||
|
|||
--source include/count_sessions.inc |
|||
|
|||
--echo # |
|||
--echo # Bug #23070734 CONCURRENT TRUNCATE TABLES CAUSE STALLS |
|||
--echo # |
|||
|
|||
SET @ahi= @@global.innodb_adaptive_hash_index; |
|||
# Ensure that there is no adaptive hash index on any system tables, |
|||
# or any other tables than the ones that we are creating below. |
|||
SET GLOBAL innodb_adaptive_hash_index=OFF; |
|||
SET GLOBAL innodb_adaptive_hash_index=ON; |
|||
|
|||
--echo Test_1 :- Check if DDL operations are possible on |
|||
--echo table being truncated. Also check if |
|||
--echo DDL operations on other tables succeed. |
|||
|
|||
create table t1 (f1 int,f2 int,key(f2),f3 int) engine=innodb; |
|||
create index idx1 on t1(f3); |
|||
create table t2 (f1 int,f2 int,key(f2),f3 int) engine=innodb; |
|||
create table t3 (f1 int,f2 int,key(f2)) engine=innodb; |
|||
|
|||
insert into t1 values (10,20,30),(30,40,50),(50,60,70); |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t2 values (10,20,30),(30,40,50),(50,60,70); |
|||
|
|||
insert into t2 select * from t2; |
|||
insert into t2 select * from t2; |
|||
insert into t2 select * from t2; |
|||
|
|||
insert into t3 values (10,20),(30,40),(50,50); |
|||
insert into t3 select * from t3; |
|||
insert into t3 select * from t3; |
|||
|
|||
SET session lock_wait_timeout = 1; |
|||
|
|||
connect (con1,localhost,root,,); |
|||
SET DEBUG_SYNC= 'buffer_pool_scan SIGNAL started WAIT_FOR finish_scan'; |
|||
send truncate table t1; |
|||
|
|||
connection default; |
|||
SET DEBUG_SYNC= 'now WAIT_FOR started'; |
|||
|
|||
--echo Check Analyze table. Gives lock time out error. |
|||
analyze table t1; |
|||
|
|||
--echo Check if we can turn off auto recalculation. |
|||
--error ER_LOCK_WAIT_TIMEOUT |
|||
alter table t1 STATS_AUTO_RECALC=0; |
|||
|
|||
--echo Check if we can turn off persistent stats on the table |
|||
--error ER_LOCK_WAIT_TIMEOUT |
|||
alter table t1 STATS_PERSISTENT=0; |
|||
|
|||
--echo Check if DML is possible on table being truncated |
|||
--error ER_LOCK_WAIT_TIMEOUT |
|||
insert into t1 values (10,89,99); |
|||
|
|||
--echo Check if DDL is possible on table being truncated |
|||
--error ER_LOCK_WAIT_TIMEOUT |
|||
alter table t1 add column f4 int; |
|||
|
|||
--echo check if table can be created with the same name |
|||
--error ER_TABLE_EXISTS_ERROR,ER_LOCK_WAIT_TIMEOUT |
|||
create table t1 (bd int) engine=innodb; |
|||
|
|||
--echo check if index can be created on table being truncated |
|||
--error ER_LOCK_WAIT_TIMEOUT |
|||
create index idx1 on t1(f1); |
|||
|
|||
--echo Check if DROP of table is possible during truncate |
|||
--error ER_LOCK_WAIT_TIMEOUT |
|||
drop table t1; |
|||
|
|||
--echo Check if select is possible during truncate |
|||
--error ER_LOCK_WAIT_TIMEOUT |
|||
select * from t1; |
|||
|
|||
--error ER_BAD_FIELD_ERROR |
|||
select * from t2 where t2.f1=t1.f1; |
|||
|
|||
--echo Check concurrent truncate operation on table; |
|||
--error ER_LOCK_WAIT_TIMEOUT |
|||
truncate table t1; |
|||
|
|||
--echo Check concurrent selects and inserts on the other table |
|||
insert into t3 values (10,20),(30,40),(50,50); |
|||
select * from t3 where f1=40; |
|||
|
|||
--echo Concurrent truncate on other tables |
|||
truncate table t2; |
|||
|
|||
--echo Concurrent alters on the other tables |
|||
alter table t2 add column f4 int; |
|||
|
|||
--echo check if index can be created on the other table |
|||
create index idx1 on t2(f3); |
|||
|
|||
--echo Check if we can turn off persistent stats off entire instance |
|||
SET GLOBAL innodb_stats_persistent=off; |
|||
|
|||
connect (con2,localhost,root,,); |
|||
send set global innodb_adaptive_hash_index=off; |
|||
|
|||
connection default; |
|||
SET DEBUG_SYNC= 'now SIGNAL finish_scan'; |
|||
|
|||
connection con1; |
|||
reap; |
|||
disconnect con1; |
|||
|
|||
connection con2; |
|||
reap; |
|||
disconnect con2; |
|||
|
|||
connection default; |
|||
SET DEBUG_SYNC= 'RESET'; |
|||
|
|||
SET GLOBAL innodb_adaptive_hash_index=@ahi; |
|||
|
|||
drop table t1,t2,t3; |
|||
--source include/wait_until_count_sessions.inc |
@ -0,0 +1,68 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
--source include/have_debug_sync.inc |
|||
|
|||
CREATE TABLE parent (a INT PRIMARY KEY) ENGINE=InnoDB; |
|||
INSERT INTO parent SET a=1; |
|||
|
|||
CREATE TABLE child (a INT PRIMARY KEY, FOREIGN KEY (a) REFERENCES parent(a) |
|||
ON UPDATE CASCADE) |
|||
ENGINE=InnoDB; |
|||
INSERT INTO child SET a=1; |
|||
|
|||
--error ER_TRUNCATE_ILLEGAL_FK |
|||
TRUNCATE TABLE parent; |
|||
TRUNCATE TABLE child; |
|||
|
|||
INSERT INTO child SET a=1; |
|||
UPDATE parent SET a=2; |
|||
SELECT * FROM child; |
|||
|
|||
connect (dml,localhost,root); |
|||
SET DEBUG_SYNC='foreign_constraint_update_cascade SIGNAL fk WAIT_FOR go'; |
|||
send UPDATE parent SET a=3; |
|||
|
|||
connection default; |
|||
SET DEBUG_SYNC='now WAIT_FOR fk'; |
|||
SET lock_wait_timeout=1; |
|||
--error ER_LOCK_WAIT_TIMEOUT |
|||
TRUNCATE TABLE child; |
|||
SET DEBUG_SYNC='now SIGNAL go'; |
|||
|
|||
connection dml; |
|||
reap; |
|||
SELECT * FROM child; |
|||
SET DEBUG_SYNC='foreign_constraint_check_for_update SIGNAL fk WAIT_FOR go'; |
|||
send DELETE FROM parent; |
|||
|
|||
connection default; |
|||
SET DEBUG_SYNC='now WAIT_FOR fk'; |
|||
--error ER_LOCK_WAIT_TIMEOUT |
|||
TRUNCATE TABLE child; |
|||
SET DEBUG_SYNC='now SIGNAL go'; |
|||
|
|||
connection dml; |
|||
--error ER_ROW_IS_REFERENCED_2 |
|||
reap; |
|||
SELECT * FROM child; |
|||
INSERT INTO parent SET a=5; |
|||
SET DEBUG_SYNC='foreign_constraint_check_for_ins SIGNAL fk WAIT_FOR go'; |
|||
send INSERT INTO child SET a=5; |
|||
|
|||
connection default; |
|||
SET DEBUG_SYNC='now WAIT_FOR fk'; |
|||
SET foreign_key_checks=0; |
|||
TRUNCATE TABLE parent; |
|||
SET DEBUG_SYNC='now SIGNAL go'; |
|||
|
|||
connection dml; |
|||
--error ER_NO_REFERENCED_ROW_2 |
|||
reap; |
|||
SELECT * FROM parent; |
|||
SELECT * FROM child; |
|||
disconnect dml; |
|||
|
|||
connection default; |
|||
SET DEBUG_SYNC = RESET; |
|||
|
|||
DROP TABLE child, parent; |
@ -1,97 +0,0 @@ |
|||
# This test is based on innodb_zip.wl6501_error_1 in MySQL 5.7. |
|||
|
|||
--source include/have_innodb.inc |
|||
--source include/innodb_row_format.inc |
|||
--source include/have_debug.inc |
|||
|
|||
SET @save_dbug = @@SESSION.debug_dbug; |
|||
|
|||
call mtr.add_suppression("InnoDB: Flagged corruption of .* in table `test`\\.`t` in TRUNCATE TABLE"); |
|||
|
|||
--echo # 1. Error in assigning undo logs for truncate action |
|||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) |
|||
ENGINE = InnoDB; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
check table t; |
|||
# |
|||
SET debug_dbug = '+d,ib_err_trunc_assigning_undo_log'; |
|||
--error ER_GET_ERRNO |
|||
truncate table t; |
|||
SET debug_dbug = @save_dbug; |
|||
check table t; |
|||
select * from t; |
|||
|
|||
--echo # 2. Error while preparing for truncate |
|||
SET debug_dbug = '+d,ib_err_trunc_preparing_for_truncate'; |
|||
--error ER_GET_ERRNO |
|||
truncate table t; |
|||
SET debug_dbug = @save_dbug; |
|||
check table t; |
|||
select * from t; |
|||
|
|||
--echo # 3. Error while dropping/creating indexes |
|||
SET debug_dbug = '+d,ib_err_trunc_drop_index'; |
|||
--error ER_GET_ERRNO |
|||
truncate table t; |
|||
SET debug_dbug = @save_dbug; |
|||
check table t; |
|||
--error ER_TABLE_CORRUPT,ER_GET_ERRNO |
|||
select * from t; |
|||
drop table t; |
|||
|
|||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) |
|||
ENGINE = InnoDB; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
check table t; |
|||
|
|||
SET debug_dbug = '+d,ib_err_trunc_create_index'; |
|||
--error ER_GET_ERRNO |
|||
truncate table t; |
|||
SET debug_dbug = @save_dbug; |
|||
check table t; |
|||
--error ER_TABLE_CORRUPT,ER_GET_ERRNO |
|||
select * from t; |
|||
drop table t; |
|||
|
|||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) |
|||
ENGINE = InnoDB; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
check table t; |
|||
|
|||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; |
|||
truncate table t; |
|||
SET debug_dbug = @save_dbug; |
|||
|
|||
check table t; |
|||
select * from t; |
|||
drop table t; |
|||
|
|||
--echo # 4. Error while completing truncate of table involving FTS |
|||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), |
|||
FULLTEXT INDEX(c)) ENGINE = InnoDB; |
|||
insert into t values (1, 1.1, 'mysql is now oracle company'), |
|||
(2, 2.2, 'innodb is part of mysql'), |
|||
(3, 3.3, 'innodb is default storage engine of mysql'); |
|||
check table t; |
|||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; |
|||
truncate table t; |
|||
SET debug_dbug = @save_dbug; |
|||
|
|||
check table t; |
|||
select * from t; |
|||
drop table t; |
|||
|
|||
--echo # 5. Error while updating sys-tables |
|||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), |
|||
FULLTEXT INDEX(c)) ENGINE = InnoDB; |
|||
insert into t values (1, 1.1, 'mysql is now oracle company'), |
|||
(2, 2.2, 'innodb is part of mysql'), |
|||
(3, 3.3, 'innodb is default storage engine of mysql'); |
|||
check table t; |
|||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; |
|||
truncate table t; |
|||
SET debug_dbug = @save_dbug; |
|||
|
|||
check table t; |
|||
select * from t order by i; |
|||
drop table t; |
@ -0,0 +1,22 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/not_embedded.inc |
|||
|
|||
call mtr.add_suppression("InnoDB: Operating system error number "); |
|||
call mtr.add_suppression("InnoDB: (The error means|If you are|Cannot open datafile) "); |
|||
call mtr.add_suppression("InnoDB: Ignoring tablespace for `test`\.`t`"); |
|||
call mtr.add_suppression("InnoDB: Table test/t .* does not exist"); |
|||
|
|||
CREATE TABLE t (a SERIAL) ENGINE=InnoDB; |
|||
INSERT INTO t() VALUES(); |
|||
SHOW CREATE TABLE t; |
|||
let $datadir=`select @@datadir`; |
|||
|
|||
--source include/shutdown_mysqld.inc |
|||
--remove_file $datadir/test/t.ibd |
|||
--source include/start_mysqld.inc |
|||
|
|||
--error ER_NO_SUCH_TABLE_IN_ENGINE |
|||
SELECT * FROM t; |
|||
--error ER_NO_SUCH_TABLE_IN_ENGINE |
|||
TRUNCATE TABLE t; |
|||
DROP TABLE t; |
@ -1,3 +0,0 @@ |
|||
--innodb-purge-threads=1 |
|||
--innodb-purge-batch-size=1 |
|||
--innodb-stats-persistent=OFF |
@ -1,49 +0,0 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
--source include/have_debug_sync.inc |
|||
--source include/count_sessions.inc |
|||
|
|||
--echo # |
|||
--echo # Bug #23070734 CONCURRENT TRUNCATE TABLES CAUSE STALLS |
|||
--echo # |
|||
|
|||
create table t1 (f1 int ,f2 int,key(f2)) engine=innodb; |
|||
begin; |
|||
insert into t1 values (10,45),(20,78),(30,88),(40,23),(50,78),(60,11),(70,56),(80,90); |
|||
delete from t1; |
|||
|
|||
connect (con2,localhost,root,,); |
|||
# Stop the purge thread |
|||
START TRANSACTION WITH CONSISTENT SNAPSHOT; |
|||
|
|||
connection default; |
|||
# Ensure that the history list length will actually be decremented by purge. |
|||
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency; |
|||
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; |
|||
commit; |
|||
|
|||
connect (con1,localhost,root,,); |
|||
SET DEBUG_SYNC= 'buffer_pool_scan SIGNAL started WAIT_FOR finish_scan'; |
|||
send truncate table t1; |
|||
|
|||
connection con2; |
|||
SET DEBUG_SYNC= 'now WAIT_FOR started'; |
|||
# Allow purge to proceed, by discarding our read view. |
|||
COMMIT; |
|||
disconnect con2; |
|||
|
|||
connection default; |
|||
--source include/wait_all_purged.inc |
|||
|
|||
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; |
|||
|
|||
SET DEBUG_SYNC = 'now SIGNAL finish_scan'; |
|||
|
|||
connection con1; |
|||
reap; |
|||
disconnect con1; |
|||
|
|||
connection default; |
|||
SET DEBUG_SYNC = 'RESET'; |
|||
drop table t1; |
|||
--source include/wait_until_count_sessions.inc |
@ -1,16 +0,0 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
--source include/have_debug_sync.inc |
|||
|
|||
SET GLOBAL innodb_stats_persistent= ON; |
|||
CREATE TABLE t1 (t TEXT) ENGINE=InnoDB STATS_PERSISTENT=1; |
|||
--connect (con1,localhost,root,,test) |
|||
SET DEBUG_SYNC='ib_trunc_table_trunc_completing SIGNAL committed WAIT_FOR ever'; |
|||
--send |
|||
TRUNCATE TABLE t1; |
|||
--connection default |
|||
SET DEBUG_SYNC='now WAIT_FOR committed'; |
|||
--source include/restart_mysqld.inc |
|||
--disconnect con1 |
|||
SELECT COUNT(*) FROM t1; |
|||
DROP TABLE t1; |
@ -1,31 +0,0 @@ |
|||
# |
|||
# Bug#25053705 - INVALID I/O ON TABLE AFTER TRUNCATE |
|||
# |
|||
CREATE TABLE t1 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b), |
|||
FULLTEXT fts2(c)); |
|||
TRUNCATE TABLE t1; |
|||
INSERT INTO t1 (a,d,b,c) VALUES ( |
|||
'79795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'), |
|||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc |
|||
cuullucocraloracurooulrooauuar','1')); |
|||
CREATE TABLE t2 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b)); |
|||
INSERT INTO t2 VALUES (1, 1, repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'), |
|||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorccuullucocraloracurooulrooauuar','1')); |
|||
create procedure insert_t2(IN total int) |
|||
begin |
|||
declare i int default 1; |
|||
while (i <= total) DO |
|||
insert into t2 select * from t2; |
|||
set i = i + 1; |
|||
end while; |
|||
end| |
|||
CALL insert_t2(15); |
|||
SET @save_dbug = @@SESSION.DEBUG_DBUG; |
|||
SET DEBUG_DBUG = '+d,innodb_invalid_read_after_truncate'; |
|||
INSERT INTO t1 (a,d,b,c) VALUES ( |
|||
'7795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'), |
|||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc |
|||
cuullucocraloracurooulrooauuar','1')); |
|||
SET DEBUG_DBUG = @save_dbug; |
|||
DROP PROCEDURE insert_t2; |
|||
DROP TABLE t1,t2; |
@ -1 +0,0 @@ |
|||
--innodb-random-read-ahead=1 |
@ -1,50 +0,0 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
|
|||
--echo # |
|||
--echo # Bug#25053705 - INVALID I/O ON TABLE AFTER TRUNCATE |
|||
--echo # |
|||
|
|||
CREATE TABLE t1 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b), |
|||
FULLTEXT fts2(c)); |
|||
|
|||
TRUNCATE TABLE t1; |
|||
|
|||
INSERT INTO t1 (a,d,b,c) VALUES ( |
|||
'79795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'), |
|||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc |
|||
cuullucocraloracurooulrooauuar','1')); |
|||
|
|||
# The following CREATE TABLE and INSERTs are used to remove the pages related to table t1 |
|||
# from the buffer pool. |
|||
CREATE TABLE t2 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b)); |
|||
|
|||
INSERT INTO t2 VALUES (1, 1, repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'), |
|||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorccuullucocraloracurooulrooauuar','1')); |
|||
|
|||
delimiter |; |
|||
create procedure insert_t2(IN total int) |
|||
begin |
|||
declare i int default 1; |
|||
while (i <= total) DO |
|||
insert into t2 select * from t2; |
|||
set i = i + 1; |
|||
end while; |
|||
end| |
|||
delimiter ;| |
|||
|
|||
CALL insert_t2(15); |
|||
|
|||
SET @save_dbug = @@SESSION.DEBUG_DBUG; |
|||
SET DEBUG_DBUG = '+d,innodb_invalid_read_after_truncate'; |
|||
|
|||
INSERT INTO t1 (a,d,b,c) VALUES ( |
|||
'7795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'), |
|||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc |
|||
cuullucocraloracurooulrooauuar','1')); |
|||
|
|||
SET DEBUG_DBUG = @save_dbug; |
|||
|
|||
DROP PROCEDURE insert_t2; |
|||
|
|||
DROP TABLE t1,t2; |
@ -1,8 +0,0 @@ |
|||
begin; |
|||
update t1 set c = 'MariaDB'; |
|||
update t1 set c = 'InnoDB'; |
|||
eval set global debug_dbug = '+d,$SEARCH_PATTERN'; |
|||
commit; |
|||
--source include/shutdown_mysqld.inc |
|||
--source include/search_pattern_in_file.inc |
|||
--source include/start_mysqld.inc |
@ -1,15 +1,15 @@ |
|||
SET GLOBAL innodb_undo_logs = 4; |
|||
SET GLOBAL innodb_undo_log_truncate = 1; |
|||
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; |
|||
create table t1(keyc int primary key, c char(100)) engine = innodb; |
|||
begin; |
|||
commit; |
|||
begin; |
|||
update t1 set c = 'MariaDB'; |
|||
update t1 set c = 'InnoDB'; |
|||
set global debug_dbug = '+d,ib_undo_trunc_before_truncate'; |
|||
set global debug_dbug = '+d,ib_undo_trunc'; |
|||
commit; |
|||
FOUND 1 /ib_undo_trunc_before_truncate/ in mysqld.1.err |
|||
begin; |
|||
update t1 set c = 'MariaDB'; |
|||
update t1 set c = 'InnoDB'; |
|||
set global debug_dbug = '+d,ib_undo_trunc_before_ddl_log_end'; |
|||
commit; |
|||
FOUND 1 /ib_undo_trunc_before_ddl_log_end/ in mysqld.1.err |
|||
call mtr.add_suppression("InnoDB: The transaction log size is too large"); |
|||
SET GLOBAL innodb_fast_shutdown=0; |
|||
FOUND 1 /ib_undo_trunc/ in mysqld.1.err |
|||
drop table t1; |
@ -1,112 +0,0 @@ |
|||
# |
|||
# load tables with some significant amount of data and then truncate it. |
|||
# |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# create test-bed |
|||
# |
|||
let $per_table = `select @@innodb_file_per_table`; |
|||
let $format = `select @@innodb_file_format`; |
|||
|
|||
let $WL6501_TMP_DIR = `select @@tmpdir`; |
|||
let $WL6501_DATA_DIR = `select @@datadir`; |
|||
set innodb_strict_mode=OFF; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# create procedure to load data |
|||
# |
|||
delimiter |; |
|||
create procedure populate() |
|||
begin |
|||
declare i int default 1; |
|||
while (i <= 5000) do |
|||
insert into t1 values (i, 'a', 'b'); |
|||
insert into t2 values (i, 'a', 'b'); |
|||
insert into t3 values (i, 'a', 'b'); |
|||
set i = i + 1; |
|||
end while; |
|||
end| |
|||
create procedure populate_small() |
|||
begin |
|||
declare i int default 10001; |
|||
while (i <= 12000) do |
|||
insert into t1 values (i, 'c', 'd'); |
|||
insert into t2 values (i, 'a', 'b'); |
|||
insert into t3 values (i, 'a', 'b'); |
|||
set i = i + 1; |
|||
end while; |
|||
end| |
|||
delimiter ;| |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# create and load the tables. |
|||
# |
|||
eval set global innodb_file_per_table = $wl6501_file_per_table; |
|||
--replace_regex /[0-9]+/NUMBER/ |
|||
eval create table t1 |
|||
(i int, c1 char(100), c2 char(100), |
|||
index c1_idx(c1)) |
|||
engine=innodb row_format=$wl6501_row_fmt |
|||
key_block_size=$wl6501_kbs; |
|||
eval create table t2 |
|||
(i int, c1 char(100), c2 char(100), |
|||
index c1_idx(c1)) |
|||
engine=innodb row_format=$wl6501_row_fmt |
|||
key_block_size=$wl6501_kbs; |
|||
eval create temporary table t3 |
|||
(i int, c1 char(100), c2 char(100), |
|||
index c1_idx(c1)) |
|||
engine=innodb row_format=$wl6501_row_fmt |
|||
key_block_size=$wl6501_kbs; |
|||
# |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
begin; |
|||
call populate(); |
|||
commit; |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
# |
|||
truncate table t1; |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
# |
|||
call populate_small(); |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
# |
|||
truncate table t2; |
|||
truncate table t3; |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
# |
|||
call populate_small(); |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
# |
|||
drop table t1; |
|||
drop table t2; |
|||
drop table t3; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# drop the procedure |
|||
# |
|||
drop procedure populate; |
|||
drop procedure populate_small; |
|||
|
|||
#----------------------------------------------------------------------------- |
|||
# |
|||
# remove test-bed |
|||
# |
|||
eval set global innodb_file_format = $format; |
|||
eval set global innodb_file_per_table = $per_table; |
1202
mysql-test/suite/innodb_zip/r/wl6501_1.result
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,462 +0,0 @@ |
|||
call mtr.add_suppression("The file '.*' already exists though the corresponding table did not exist in the InnoDB data dictionary"); |
|||
call mtr.add_suppression("Cannot create file '.*'"); |
|||
call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'"); |
|||
set global innodb_file_per_table = on; |
|||
"1. Hit crash point while writing redo log." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine=innodb row_format=compressed |
|||
key_block_size=16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_while_writing_redo_log"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"2. Hit crash point on completion of redo log write." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_after_redo_log_write_complete"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"3. Hit crash point while dropping indexes." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_clust_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_uniq_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_sec_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"4. Hit crash point on completing drop of all indexes before creation" |
|||
" of index is commenced." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"5. Hit crash point while creating indexes." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_clust_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_uniq_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_sec_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"6. Hit crash point after data is updated to system-table and" |
|||
" in-memory dict." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"7. Hit crash point before/after log checkpoint is done." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_before_log_removal"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 16; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_after_truncate_done"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
set global innodb_file_per_table = 1; |
@ -1,519 +0,0 @@ |
|||
call mtr.add_suppression("The file '.*' already exists though the corresponding table did not exist in the InnoDB data dictionary"); |
|||
call mtr.add_suppression("Cannot create file '.*'"); |
|||
call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'"); |
|||
set global innodb_file_per_table = on; |
|||
"1. Hit crash point while writing redo log." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine=innodb row_format=compressed |
|||
key_block_size=4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_while_writing_redo_log"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"2. Hit crash point on completion of redo log write." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_after_redo_log_write_complete"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"3. Hit crash point while dropping indexes." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_clust_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_uniq_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_sec_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"4. Hit crash point on completing drop of all indexes before creation" |
|||
" of index is commenced." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"5. Hit crash point while creating indexes." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_clust_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_uniq_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_sec_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"6. Hit crash point after data is updated to system-table and" |
|||
" in-memory dict." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"7. Hit crash point before/after log checkpoint is done." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_before_log_removal"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_after_truncate_done"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
set global innodb_file_per_table = 1; |
|||
call mtr.add_suppression("does not exist in the InnoDB internal"); |
|||
set global innodb_file_per_table = on; |
|||
"1. Hit crash point on completing drop of all indexes before creation" |
|||
" of index is commenced." |
|||
set global innodb_file_per_table = 1; |
|||
set innodb_strict_mode=off; |
|||
create temporary table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check Error Table 'test.t' doesn't exist |
|||
test.t check status Operation failed |
|||
"2. Hit crash point after data is updated to system-table and" |
|||
" in-memory dict." |
|||
set global innodb_file_per_table = 1; |
|||
set innodb_strict_mode=off; |
|||
create temporary table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 4; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check Error Table 'test.t' doesn't exist |
|||
test.t check status Operation failed |
|||
set global innodb_file_per_table = 1; |
@ -1,462 +0,0 @@ |
|||
call mtr.add_suppression("The file '.*' already exists though the corresponding table did not exist in the InnoDB data dictionary"); |
|||
call mtr.add_suppression("Cannot create file '.*'"); |
|||
call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'"); |
|||
set global innodb_file_per_table = on; |
|||
"1. Hit crash point while writing redo log." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine=innodb row_format=compressed |
|||
key_block_size=8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_while_writing_redo_log"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"2. Hit crash point on completion of redo log write." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_after_redo_log_write_complete"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"3. Hit crash point while dropping indexes." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_clust_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_uniq_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_drop_of_sec_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"4. Hit crash point on completing drop of all indexes before creation" |
|||
" of index is commenced." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"5. Hit crash point while creating indexes." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_clust_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_uniq_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_create_of_sec_index"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"6. Hit crash point after data is updated to system-table and" |
|||
" in-memory dict." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
"7. Hit crash point before/after log checkpoint is done." |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_before_log_removal"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
use test; |
|||
set global innodb_file_per_table = 1; |
|||
SET innodb_strict_mode=OFF; |
|||
create table t ( |
|||
i int, f float, c char, |
|||
primary key pk(i), unique findex(f), index ck(c)) |
|||
engine = innodb row_format = compressed |
|||
key_block_size = 8; |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
set session debug = "+d,ib_trunc_crash_after_truncate_done"; |
|||
Warnings: |
|||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead |
|||
truncate table t; |
|||
ERROR HY000: Lost connection to MySQL server during query |
|||
check table t; |
|||
Table Op Msg_type Msg_text |
|||
test.t check status OK |
|||
select * from t; |
|||
i f c |
|||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); |
|||
select * from t; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
3 3.3 c |
|||
select * from t where f < 2.5; |
|||
i f c |
|||
1 1.1 a |
|||
2 2.2 b |
|||
drop table t; |
|||
set global innodb_file_per_table = 1; |
@ -1,345 +0,0 @@ |
|||
set innodb_strict_mode=OFF; |
|||
create procedure populate() |
|||
begin |
|||
declare i int default 1; |
|||
while (i <= 5000) do |
|||
insert into t1 values (i, 'a', 'b'); |
|||
insert into t2 values (i, 'a', 'b'); |
|||
insert into t3 values (i, 'a', 'b'); |
|||
set i = i + 1; |
|||
end while; |
|||
end| |
|||
create procedure populate_small() |
|||
begin |
|||
declare i int default 10001; |
|||
while (i <= 12000) do |
|||
insert into t1 values (i, 'c', 'd'); |
|||
insert into t2 values (i, 'a', 'b'); |
|||
insert into t3 values (i, 'a', 'b'); |
|||
set i = i + 1; |
|||
end while; |
|||
end| |
|||
set global innodb_file_per_table = 1; |
|||
create table tNUMBER |
|||
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER), |
|||
index cNUMBER_idx(cNUMBER)) |
|||
engine=innodb row_format=compact |
|||
key_block_size=NUMBER; |
|||
Warnings: |
|||
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER unless ROW_FORMAT=COMPRESSED. |
|||
create table t2 |
|||
(i int, c1 char(100), c2 char(100), |
|||
index c1_idx(c1)) |
|||
engine=innodb row_format=compact |
|||
key_block_size=16; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED. |
|||
create temporary table t3 |
|||
(i int, c1 char(100), c2 char(100), |
|||
index c1_idx(c1)) |
|||
engine=innodb row_format=compact |
|||
key_block_size=16; |
|||
Warnings: |
|||
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE. |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16. |
|||
select count(*) from t1; |
|||
count(*) |
|||
0 |
|||
select count(*) from t2; |
|||
count(*) |
|||
0 |
|||
select count(*) from t3; |
|||
count(*) |
|||
0 |
|||
begin; |
|||
call populate(); |
|||
commit; |
|||
select count(*) from t1; |
|||
count(*) |
|||
5000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
5000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
5000 |
|||
truncate table t1; |
|||
select count(*) from t1; |
|||
count(*) |
|||
0 |
|||
select count(*) from t2; |
|||
count(*) |
|||
5000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
5000 |
|||
call populate_small(); |
|||
select count(*) from t1; |
|||
count(*) |
|||
2000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
7000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
7000 |
|||
truncate table t2; |
|||
truncate table t3; |
|||
select count(*) from t1; |
|||
count(*) |
|||
2000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
0 |
|||
select count(*) from t3; |
|||
count(*) |
|||
0 |
|||
call populate_small(); |
|||
select count(*) from t1; |
|||
count(*) |
|||
4000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
2000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
2000 |
|||
drop table t1; |
|||
drop table t2; |
|||
drop table t3; |
|||
drop procedure populate; |
|||
drop procedure populate_small; |
|||
set global innodb_file_format = Barracuda; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/ |
|||
set global innodb_file_per_table = 1; |
|||
set innodb_strict_mode=OFF; |
|||
create procedure populate() |
|||
begin |
|||
declare i int default 1; |
|||
while (i <= 5000) do |
|||
insert into t1 values (i, 'a', 'b'); |
|||
insert into t2 values (i, 'a', 'b'); |
|||
insert into t3 values (i, 'a', 'b'); |
|||
set i = i + 1; |
|||
end while; |
|||
end| |
|||
create procedure populate_small() |
|||
begin |
|||
declare i int default 10001; |
|||
while (i <= 12000) do |
|||
insert into t1 values (i, 'c', 'd'); |
|||
insert into t2 values (i, 'a', 'b'); |
|||
insert into t3 values (i, 'a', 'b'); |
|||
set i = i + 1; |
|||
end while; |
|||
end| |
|||
set global innodb_file_per_table = 1; |
|||
create table tNUMBER |
|||
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER), |
|||
index cNUMBER_idx(cNUMBER)) |
|||
engine=innodb row_format=compressed |
|||
key_block_size=NUMBER; |
|||
create table t2 |
|||
(i int, c1 char(100), c2 char(100), |
|||
index c1_idx(c1)) |
|||
engine=innodb row_format=compressed |
|||
key_block_size=16; |
|||
create temporary table t3 |
|||
(i int, c1 char(100), c2 char(100), |
|||
index c1_idx(c1)) |
|||
engine=innodb row_format=compressed |
|||
key_block_size=16; |
|||
Warnings: |
|||
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE. |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16. |
|||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED is ignored for TEMPORARY TABLE. |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. |
|||
select count(*) from t1; |
|||
count(*) |
|||
0 |
|||
select count(*) from t2; |
|||
count(*) |
|||
0 |
|||
select count(*) from t3; |
|||
count(*) |
|||
0 |
|||
begin; |
|||
call populate(); |
|||
commit; |
|||
select count(*) from t1; |
|||
count(*) |
|||
5000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
5000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
5000 |
|||
truncate table t1; |
|||
select count(*) from t1; |
|||
count(*) |
|||
0 |
|||
select count(*) from t2; |
|||
count(*) |
|||
5000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
5000 |
|||
call populate_small(); |
|||
select count(*) from t1; |
|||
count(*) |
|||
2000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
7000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
7000 |
|||
truncate table t2; |
|||
truncate table t3; |
|||
select count(*) from t1; |
|||
count(*) |
|||
2000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
0 |
|||
select count(*) from t3; |
|||
count(*) |
|||
0 |
|||
call populate_small(); |
|||
select count(*) from t1; |
|||
count(*) |
|||
4000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
2000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
2000 |
|||
drop table t1; |
|||
drop table t2; |
|||
drop table t3; |
|||
drop procedure populate; |
|||
drop procedure populate_small; |
|||
set global innodb_file_format = Barracuda; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/ |
|||
set global innodb_file_per_table = 1; |
|||
set innodb_strict_mode=OFF; |
|||
create procedure populate() |
|||
begin |
|||
declare i int default 1; |
|||
while (i <= 5000) do |
|||
insert into t1 values (i, 'a', 'b'); |
|||
insert into t2 values (i, 'a', 'b'); |
|||
insert into t3 values (i, 'a', 'b'); |
|||
set i = i + 1; |
|||
end while; |
|||
end| |
|||
create procedure populate_small() |
|||
begin |
|||
declare i int default 10001; |
|||
while (i <= 12000) do |
|||
insert into t1 values (i, 'c', 'd'); |
|||
insert into t2 values (i, 'a', 'b'); |
|||
insert into t3 values (i, 'a', 'b'); |
|||
set i = i + 1; |
|||
end while; |
|||
end| |
|||
set global innodb_file_per_table = 0; |
|||
create table tNUMBER |
|||
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER), |
|||
index cNUMBER_idx(cNUMBER)) |
|||
engine=innodb row_format=compact |
|||
key_block_size=NUMBER; |
|||
Warnings: |
|||
Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. |
|||
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER. |
|||
create table t2 |
|||
(i int, c1 char(100), c2 char(100), |
|||
index c1_idx(c1)) |
|||
engine=innodb row_format=compact |
|||
key_block_size=16; |
|||
Warnings: |
|||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16. |
|||
create temporary table t3 |
|||
(i int, c1 char(100), c2 char(100), |
|||
index c1_idx(c1)) |
|||
engine=innodb row_format=compact |
|||
key_block_size=16; |
|||
Warnings: |
|||
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE. |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16. |
|||
select count(*) from t1; |
|||
count(*) |
|||
0 |
|||
select count(*) from t2; |
|||
count(*) |
|||
0 |
|||
select count(*) from t3; |
|||
count(*) |
|||
0 |
|||
begin; |
|||
call populate(); |
|||
commit; |
|||
select count(*) from t1; |
|||
count(*) |
|||
5000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
5000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
5000 |
|||
truncate table t1; |
|||
select count(*) from t1; |
|||
count(*) |
|||
0 |
|||
select count(*) from t2; |
|||
count(*) |
|||
5000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
5000 |
|||
call populate_small(); |
|||
select count(*) from t1; |
|||
count(*) |
|||
2000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
7000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
7000 |
|||
truncate table t2; |
|||
truncate table t3; |
|||
select count(*) from t1; |
|||
count(*) |
|||
2000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
0 |
|||
select count(*) from t3; |
|||
count(*) |
|||
0 |
|||
call populate_small(); |
|||
select count(*) from t1; |
|||
count(*) |
|||
4000 |
|||
select count(*) from t2; |
|||
count(*) |
|||
2000 |
|||
select count(*) from t3; |
|||
count(*) |
|||
2000 |
|||
drop table t1; |
|||
drop table t2; |
|||
drop table t3; |
|||
drop procedure populate; |
|||
drop procedure populate_small; |
|||
set global innodb_file_format = Barracuda; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/ |
|||
set global innodb_file_per_table = 1; |
@ -1,451 +0,0 @@ |
|||
|
|||
#################################################################### |
|||
# TC to check truncate table statement atomicity for single # |
|||
# tablespace # |
|||
# Sceanrio covered: # |
|||
# 1. Debug points added for worklog # |
|||
# 2. Table with differnt row types # |
|||
# 3. Transactional statement. # |
|||
#################################################################### |
|||
|
|||
|
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
--source include/big_test.inc |
|||
--source include/have_innodb_16k.inc |
|||
|
|||
# Valgrind would result in a "long semaphore wait" inside InnoDB |
|||
--source include/not_valgrind.inc |
|||
# Embedded server does not support crashing |
|||
--source include/not_embedded.inc |
|||
# Avoid CrashReporter popup on Mac |
|||
--source include/not_crashrep.inc |
|||
|
|||
#----------------------------------------------------------------------- |
|||
--disable_query_log |
|||
let $MYSQL_DATA_DIR= `select @@datadir`; |
|||
let $data_directory = data directory='$MYSQL_TMP_DIR/alt_dir'; |
|||
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`; |
|||
|
|||
call mtr.add_suppression("InnoDB.*table did not exist in the InnoDB data dictionary.*"); |
|||
call mtr.add_suppression("InnoDB: A page in the doublewrite buffer is not within space bounds.*"); |
|||
call mtr.add_suppression("InnoDB: Cannot create file.*"); |
|||
call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'.*"); |
|||
call mtr.add_suppression("InnoDB: A page in the doublewrite buffer is not within space bounds"); |
|||
call mtr.add_suppression("InnoDB: Error: table .* does not exist in the InnoDB internal"); |
|||
--enable_query_log |
|||
|
|||
#----------------------------------------------------------------------- |
|||
set global innodb_file_per_table=on; |
|||
--echo # Verify that 'TRUNCATE TABLE' statement works fine and the size |
|||
--echo # of .ibd file is equal to the initial size after truncation. |
|||
|
|||
#----------------------------------------------------------------------- |
|||
drop table if exists t1,t2,t3,t4,t6; |
|||
let $cnt = 6; |
|||
while ($cnt) { |
|||
|
|||
# table with basic data type + primary ,secondary,composite,prefix index |
|||
create table t1(c1 int not null, |
|||
c2 int not null, |
|||
c3 char(255) not null, |
|||
c4 text(500) not null, |
|||
c5 blob(500) not null, |
|||
c6 varchar(500) not null, |
|||
c7 varchar(500) not null, |
|||
c8 datetime, |
|||
c9 decimal(5,3), |
|||
primary key (c1), |
|||
index (c3,c4(50),c5(50)), |
|||
index (c2)) |
|||
engine=innodb row_format=redundant; |
|||
|
|||
|
|||
create table t2(c1 int not null, |
|||
c2 int not null, |
|||
c3 char(255) not null, |
|||
c4 text(500) not null, |
|||
c5 blob(500) not null, |
|||
c6 varchar(500) not null, |
|||
c7 varchar(500) not null, |
|||
c8 datetime, |
|||
c9 decimal(5,3), |
|||
primary key (c1), |
|||
index (c3,c4(50),c5(50)), |
|||
index (c2)) |
|||
engine=innodb row_format=compact; |
|||
|
|||
|
|||
# with row type , key block size = 4K |
|||
create table t3(c1 int not null, |
|||
c2 int not null, |
|||
c3 char(255) not null, |
|||
c4 text(500) not null, |
|||
c5 blob(500) not null, |
|||
c6 varchar(500) not null, |
|||
c7 varchar(500) not null, |
|||
c8 datetime, |
|||
c9 decimal(5,3), |
|||
primary key (c1), |
|||
index (c3,c4(50),c5(50)), |
|||
index (c2)) |
|||
engine=innodb row_format=compressed key_block_size=4; |
|||
|
|||
|
|||
create table t4(c1 int not null, |
|||
c2 int not null, |
|||
c3 char(255) not null, |
|||
c4 text(500) not null, |
|||
c5 blob(500) not null, |
|||
c6 varchar(500) not null, |
|||
c7 varchar(500) not null, |
|||
c8 datetime, |
|||
c9 decimal(5,3), |
|||
primary key (c1), |
|||
index (c3,c4(50),c5(50)), |
|||
index (c2)) |
|||
engine=innodb row_format=dynamic; |
|||
|
|||
|
|||
create temporary table t5(c1 int not null, |
|||
c2 int not null, |
|||
c3 char(255) not null, |
|||
c4 text(500) not null, |
|||
c5 blob(500) not null, |
|||
c6 varchar(500) not null, |
|||
c7 varchar(500) not null, |
|||
c8 datetime, |
|||
c9 decimal(5,3), |
|||
primary key (c1), |
|||
index (c3,c4(50),c5(50)), |
|||
index (c2)) |
|||
engine=innodb; |
|||
|
|||
create table t6 ( a int ) engine = innodb; |
|||
insert into t6 values (50),(100),(150); |
|||
|
|||
--disable_query_log |
|||
--disable_result_log |
|||
let $n=5; |
|||
|
|||
# load created tables. |
|||
while ($n) |
|||
{ |
|||
start transaction; |
|||
|
|||
eval insert ignore into t1 values( |
|||
$n, $n, |
|||
repeat(concat(' tc3_',$n), 42), |
|||
repeat(concat(' tc4_',$n), 300), |
|||
repeat(concat(' tc5_',$n), 300), |
|||
repeat(concat(' tc6_',$n), 300), |
|||
repeat(concat(' tc7_',$n), 300), |
|||
now(), (100.55+$n)); |
|||
|
|||
eval insert ignore into t2 values( |
|||
$n, $n, |
|||
repeat(concat(' tc3_',$n), 42), |
|||
repeat(concat(' tc4_',$n), 300), |
|||
repeat(concat(' tc5_',$n), 300), |
|||
repeat(concat(' tc6_',$n), 300), |
|||
repeat(concat(' tc7_',$n), 300), |
|||
now(), (100.55+$n)); |
|||
|
|||
eval insert ignore into t3 values( |
|||
$n, $n, |
|||
repeat(concat(' tc3_',$n), 42), |
|||
repeat(concat(' tc4_',$n), 300), |
|||
repeat(concat(' tc5_',$n), 300), |
|||
repeat(concat(' tc6_',$n), 300), |
|||
repeat(concat(' tc7_',$n), 300), |
|||
now(), (100.55+$n)); |
|||
|
|||
eval insert ignore into t4 values( |
|||
$n, $n, |
|||
repeat(concat(' tc3_',$n), 42), |
|||
repeat(concat(' tc4_',$n), 300), |
|||
repeat(concat(' tc5_',$n), 300), |
|||
repeat(concat(' tc6_',$n), 300), |
|||
repeat(concat(' tc7_',$n), 300), |
|||
now(), (100.55+$n)); |
|||
|
|||
eval insert ignore into t5 values( |
|||
$n, $n, |
|||
repeat(concat(' tc3_',$n), 42), |
|||
repeat(concat(' tc4_',$n), 300), |
|||
repeat(concat(' tc5_',$n), 300), |
|||
repeat(concat(' tc6_',$n), 300), |
|||
repeat(concat(' tc7_',$n), 300), |
|||
now(), (100.55+$n)); |
|||
|
|||
if ($n <= 3) |
|||
{ |
|||
commit; |
|||
} |
|||
|
|||
if ($n > 3) |
|||
{ |
|||
rollback; |
|||
} |
|||
|
|||
dec $n; |
|||
} |
|||
|
|||
# validate loading of the tables. |
|||
--enable_result_log |
|||
--enable_query_log |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
select count(*) from t4; |
|||
select count(*) from t5; |
|||
select count(*) from t6; |
|||
|
|||
# set the debug crash point and exercise them. |
|||
if ($cnt == 6) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_during_drop_index_temp_table"; |
|||
--echo "---debug ib_trunc_crash_during_drop_index_temp_table point---" |
|||
} |
|||
if ($cnt == 5) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_drop_reinit_done_create_to_start"; |
|||
--echo "---debug ib_trunc_crash_drop_reinit_done_create_to_start---" |
|||
} |
|||
|
|||
if ($cnt >= 5) { |
|||
--echo # Write file to make mysql-test-run.pl expect crash and restart |
|||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
|||
--echo # Run the crashing query |
|||
--error 2013 |
|||
truncate table t5; |
|||
--source include/wait_until_disconnected.inc |
|||
--enable_reconnect |
|||
--echo # Restart the MySQL server |
|||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
|||
--source include/wait_until_connected_again.inc |
|||
--disable_reconnect |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
select count(*) from t4; |
|||
--error ER_NO_SUCH_TABLE |
|||
select count(*) from t5; |
|||
select count(*) from t6; |
|||
} |
|||
|
|||
# set the debug crash point and exercise them. |
|||
if ($cnt == 6) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index"; |
|||
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---" |
|||
} |
|||
if ($cnt == 5) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_on_create_of_sec_index"; |
|||
--echo "---debug ib_trunc_crash_on_create_of_sec_index---" |
|||
} |
|||
if ($cnt == 4) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_before_log_removal"; |
|||
--echo "---debug ib_trunc_crash_before_log_removal point---" |
|||
} |
|||
if ($cnt == 3) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_truncate_done"; |
|||
--echo "---debug ib_trunc_crash_after_truncate_done point---" |
|||
} |
|||
if ($cnt == 2) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_truncate_done"; |
|||
--echo "---debug ib_trunc_crash_after_truncate_done point---" |
|||
} |
|||
if ($cnt == 1) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete"; |
|||
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---" |
|||
} |
|||
|
|||
--echo # Write file to make mysql-test-run.pl expect crash and restart |
|||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
|||
--echo # Run the crashing query |
|||
--error 2013 |
|||
truncate table t1; |
|||
--source include/wait_until_disconnected.inc |
|||
--enable_reconnect |
|||
--echo # Restart the MySQL server |
|||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
|||
--source include/wait_until_connected_again.inc |
|||
--disable_reconnect |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
select count(*) from t4; |
|||
--error ER_NO_SUCH_TABLE |
|||
select count(*) from t5; |
|||
select count(*) from t6; |
|||
|
|||
if ($cnt == 6) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index"; |
|||
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---" |
|||
} |
|||
if ($cnt == 5) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_on_create_of_sec_index"; |
|||
--echo "---debug ib_trunc_crash_on_create_of_sec_index---" |
|||
} |
|||
if ($cnt == 4) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_before_log_removal"; |
|||
--echo "---debug ib_trunc_crash_before_log_removal point---" |
|||
} |
|||
if ($cnt == 3) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_truncate_done"; |
|||
--echo "---debug ib_trunc_crash_after_truncate_done point---" |
|||
} |
|||
if ($cnt == 2) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_truncate_done"; |
|||
--echo "---debug ib_trunc_crash_after_truncate_done point---" |
|||
} |
|||
if ($cnt == 1) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete"; |
|||
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---" |
|||
} |
|||
|
|||
|
|||
--echo # Write file to make mysql-test-run.pl expect crash and restart |
|||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
|||
--echo # Run the crashing query |
|||
--error 2013 |
|||
truncate table t2; |
|||
--source include/wait_until_disconnected.inc |
|||
--enable_reconnect |
|||
--echo # Restart the MySQL server |
|||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
|||
--source include/wait_until_connected_again.inc |
|||
--disable_reconnect |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
select count(*) from t4; |
|||
--error ER_NO_SUCH_TABLE |
|||
select count(*) from t5; |
|||
select count(*) from t6; |
|||
|
|||
if ($cnt == 6) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index"; |
|||
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---" |
|||
} |
|||
if ($cnt == 5) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_on_create_of_sec_index"; |
|||
--echo "---debug ib_trunc_crash_on_create_of_sec_index---" |
|||
} |
|||
if ($cnt == 4) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_before_log_removal"; |
|||
--echo "---debug ib_trunc_crash_before_log_removal point---" |
|||
} |
|||
if ($cnt == 3) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_truncate_done"; |
|||
--echo "---debug ib_trunc_crash_after_truncate_done point---" |
|||
} |
|||
if ($cnt == 2) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_truncate_done"; |
|||
--echo "---debug ib_trunc_crash_after_truncate_done point---" |
|||
} |
|||
if ($cnt == 1) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete"; |
|||
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---" |
|||
} |
|||
|
|||
|
|||
--echo # Write file to make mysql-test-run.pl expect crash and restart |
|||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
|||
--echo # Run the crashing query |
|||
--error 2013 |
|||
truncate table t3; |
|||
--source include/wait_until_disconnected.inc |
|||
--enable_reconnect |
|||
--echo # Restart the MySQL server |
|||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
|||
--source include/wait_until_connected_again.inc |
|||
--disable_reconnect |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
select count(*) from t4; |
|||
--error ER_NO_SUCH_TABLE |
|||
select count(*) from t5; |
|||
select count(*) from t6; |
|||
|
|||
|
|||
if ($cnt == 6) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index"; |
|||
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---" |
|||
} |
|||
if ($cnt == 5) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_on_create_of_sec_index"; |
|||
--echo "---debug ib_trunc_crash_on_create_of_sec_index---" |
|||
} |
|||
if ($cnt == 4) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_before_log_removal"; |
|||
--echo "---debug ib_trunc_crash_before_log_removal point---" |
|||
} |
|||
if ($cnt == 3) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_truncate_done"; |
|||
--echo "---debug ib_trunc_crash_after_truncate_done point---" |
|||
} |
|||
if ($cnt == 2) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_truncate_done"; |
|||
--echo "---debug ib_trunc_crash_after_truncate_done point---" |
|||
} |
|||
if ($cnt == 1) |
|||
{ |
|||
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete"; |
|||
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---" |
|||
} |
|||
|
|||
--echo # Write file to make mysql-test-run.pl expect crash and restart |
|||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
|||
--echo # Run the crashing query |
|||
--error 2013 |
|||
truncate table t4; |
|||
--source include/wait_until_disconnected.inc |
|||
--enable_reconnect |
|||
--echo # Restart the MySQL server |
|||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
|||
--source include/wait_until_connected_again.inc |
|||
--disable_reconnect |
|||
select count(*) from t1; |
|||
select count(*) from t2; |
|||
select count(*) from t3; |
|||
select count(*) from t4; |
|||
--error ER_NO_SUCH_TABLE |
|||
select count(*) from t5; |
|||
select count(*) from t6; |
|||
|
|||
drop table t1, t2, t3, t4, t6; |
|||
|
|||
dec $cnt; |
|||
|
|||
--disable_query_log |
|||
eval set global innodb_file_per_table=$innodb_file_per_table_orig; |
|||
--enable_query_log |
|||
} |
|||
|
|||
|
|||
|
@ -1,25 +0,0 @@ |
|||
# |
|||
# WL#6501: make truncate table atomic |
|||
# |
|||
|
|||
# TC tries to hit crash point during truncate of |
|||
# compressed non-temp table residing in single tablespace |
|||
# with page-size=16k |
|||
|
|||
--source include/have_innodb.inc |
|||
--source include/have_innodb_16k.inc |
|||
--source include/have_debug.inc |
|||
--source include/big_test.inc |
|||
|
|||
# Valgrind would complain about memory leaks when we crash on purpose. |
|||
--source include/not_valgrind.inc |
|||
# Embedded server does not support crashing |
|||
--source include/not_embedded.inc |
|||
# Avoid CrashReporter popup on Mac |
|||
--source include/not_crashrep.inc |
|||
|
|||
let $wl6501_file_per_table = 1; |
|||
let $wl6501_row_fmt = compressed; |
|||
let $wl6501_kbs = 16; |
|||
--source suite/innodb/include/innodb_wl6501_crash.inc |
|||
|
@ -1,27 +0,0 @@ |
|||
# |
|||
# WL#6501: make truncate table atomic |
|||
# |
|||
|
|||
# TC tries to hit crash point during truncate of |
|||
# compressed non-temp table residing in single tablespace. |
|||
# with page-size=4k |
|||
|
|||
--source include/have_innodb.inc |
|||
--source include/have_innodb_4k.inc |
|||
--source include/have_debug.inc |
|||
--source include/big_test.inc |
|||
|
|||
# Valgrind would complain about memory leaks when we crash on purpose. |
|||
--source include/not_valgrind.inc |
|||
# Embedded server does not support crashing |
|||
--source include/not_embedded.inc |
|||
# Avoid CrashReporter popup on Mac |
|||
--source include/not_crashrep.inc |
|||
|
|||
let $wl6501_file_per_table = 1; |
|||
let $wl6501_row_fmt = compressed; |
|||
let $wl6501_kbs = 4; |
|||
--source suite/innodb/include/innodb_wl6501_crash.inc |
|||
|
|||
let $wl6501_temp = temporary; |
|||
--source suite/innodb/include/innodb_wl6501_crash_temp.inc |
@ -1,25 +0,0 @@ |
|||
# |
|||
# WL#6501: make truncate table atomic |
|||
# |
|||
|
|||
# TC tries to hit crash point during truncate of |
|||
# compressed non-temp table residing in single tablespace. |
|||
# with page-size=8k |
|||
|
|||
--source include/have_innodb.inc |
|||
--source include/have_innodb_8k.inc |
|||
--source include/have_debug.inc |
|||
--source include/big_test.inc |
|||
|
|||
# Valgrind would complain about memory leaks when we crash on purpose. |
|||
--source include/not_valgrind.inc |
|||
# Embedded server does not support crashing |
|||
--source include/not_embedded.inc |
|||
# Avoid CrashReporter popup on Mac |
|||
--source include/not_crashrep.inc |
|||
|
|||
let $wl6501_file_per_table = 1; |
|||
let $wl6501_row_fmt = compressed; |
|||
let $wl6501_kbs = 8; |
|||
--source suite/innodb/include/innodb_wl6501_crash.inc |
|||
|
@ -1,37 +0,0 @@ |
|||
# |
|||
# WL#6501: make truncate table atomic |
|||
# |
|||
|
|||
# load table with some significiant amount of data |
|||
# and then try truncate |
|||
|
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
--source include/big_test.inc |
|||
--source include/have_innodb_16k.inc |
|||
|
|||
# Valgrind would complain about memory leaks when we crash on purpose. |
|||
--source include/not_valgrind.inc |
|||
# Embedded server does not support crashing |
|||
--source include/not_embedded.inc |
|||
# Avoid CrashReporter popup on Mac |
|||
--source include/not_crashrep.inc |
|||
|
|||
|
|||
# Single-Tablespace/Non-Compressed |
|||
let $wl6501_file_per_table = 1; |
|||
let $wl6501_row_fmt = compact; |
|||
let $wl6501_kbs = 16; |
|||
--source suite/innodb_zip/include/innodb_wl6501_scale.inc |
|||
|
|||
# Single-Tablespace/Compressed |
|||
let $wl6501_file_per_table = 1; |
|||
let $wl6501_row_fmt = compressed; |
|||
let $wl6501_kbs = 16; |
|||
--source suite/innodb_zip/include/innodb_wl6501_scale.inc |
|||
|
|||
# System-Tablespace/Non-Compressed |
|||
let $wl6501_file_per_table = 0; |
|||
let $wl6501_row_fmt = compact; |
|||
let $wl6501_kbs = 16; |
|||
--source suite/innodb_zip/include/innodb_wl6501_scale.inc |
1270
storage/innobase/row/row0trunc.cc
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue