Commit d3708f78 authored by Jan Lindström's avatar Jan Lindström

Fix bunch of test failures and solaris build missing include.

parent 11ae60d2
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
## ADD_COMPILE_FLAGS(<source files> COMPILE_FLAGS <flags>)
MACRO(ADD_COMPILE_FLAGS)
SET(FILES "")
SET(FLAGS "")
SET(COMPILE_FLAGS_SEEN)
FOREACH(ARG ${ARGV})
IF(ARG STREQUAL "COMPILE_FLAGS")
SET(COMPILE_FLAGS_SEEN 1)
ELSEIF(COMPILE_FLAGS_SEEN)
LIST(APPEND FLAGS ${ARG})
ELSE()
LIST(APPEND FILES ${ARG})
ENDIF()
ENDFOREACH()
FOREACH(FILE ${FILES})
FOREACH(FLAG ${FLAGS})
GET_SOURCE_FILE_PROPERTY(PROP ${FILE} COMPILE_FLAGS)
IF(NOT PROP)
SET(PROP ${FLAG})
ELSE()
SET(PROP "${PROP} ${FLAG}")
ENDIF()
SET_SOURCE_FILES_PROPERTIES(
${FILE} PROPERTIES COMPILE_FLAGS "${PROP}"
)
ENDFOREACH()
ENDFOREACH()
ENDMACRO()
call mtr.add_suppression("InnoDB: Error: trying to do an operation on a dropped tablespace.*");
SET default_storage_engine = InnoDB;
CREATE TABLE t1 (pk INT PRIMARY KEY, c VARCHAR(256));
CREATE TABLE t2 AS SELECT * FROM t1;
......
......@@ -7,6 +7,9 @@
#
# MDEV-8164: Server crashes in pfs_mutex_enter_func after fil_crypt_is_closing or alike
#
call mtr.add_suppression("InnoDB: Error: trying to do an operation on a dropped tablespace.*");
SET default_storage_engine = InnoDB;
CREATE TABLE t1 (pk INT PRIMARY KEY, c VARCHAR(256));
......
This diff is collapsed.
#
# 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`;
let $format = `select @@innodb_file_format`;
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;
eval set global innodb_file_format = $wl6501_file_format;
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;
eval set global innodb_file_format = $wl6501_file_format;
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_format = $format;
eval set global innodb_file_per_table = $per_table;
call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified.");
call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.");
call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: .*");
call mtr.add_suppression("InnoDB: Tablespace flags: .*");
call mtr.add_suppression("InnoDB: Ignoring tablespace .* because it could not be opened.");
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .*");
call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file .*");
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
@@innodb_file_per_table
......@@ -444,7 +453,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_internal_error";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: While updating the <space, root page number> of index "GEN_CLUST_INDEX" - Generic error
ERROR HY000: Internal error: While updating the <space, root page number> of index GEN_CLUST_INDEX - Generic error
SET SESSION debug_dbug="-d,ib_import_internal_error";
restore: t1 .ibd and .cfg files
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
......@@ -456,7 +465,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Too many concurrent transactions
ERROR HY000: Internal error: Cannot reset LSNs in table "test_wl5522"."t1" : Too many concurrent transactions
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="-d,ib_import_reset_space_and_lsn_failure";
SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
......@@ -797,7 +806,7 @@ t1 CREATE TABLE `t1` (
KEY `idx1` (`c2`),
KEY `idx2` (`c3`(512)),
KEY `idx3` (`c4`(512))
) ENGINE=InnoDB AUTO_INCREMENT=185 DEFAULT CHARSET=latin1
) ENGINE=InnoDB AUTO_INCREMENT=248 DEFAULT CHARSET=latin1
DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES
......@@ -826,7 +835,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption
ERROR HY000: Internal error: Cannot reset LSNs in table "test_wl5522"."t1" : Data structure corruption
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_1";
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
......@@ -838,7 +847,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,buf_page_is_corrupt_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption
ERROR HY000: Internal error: Cannot reset LSNs in table "test_wl5522"."t1" : Data structure corruption
SET SESSION debug_dbug="-d,buf_page_is_corrupt_failure";
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
......@@ -850,7 +859,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Index corrupt: Externally stored column(5) has a reference length of 19 in the cluster index "GEN_CLUST_INDEX"
ERROR HY000: Index corrupt: Externally stored column(5) has a reference length of 19 in the cluster index GEN_CLUST_INDEX
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_2";
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
......@@ -910,7 +919,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Unsupported
ERROR HY000: Internal error: Cannot reset LSNs in table "test_wl5522"."t1" : Unsupported
SET SESSION debug_dbug="-d,fsp_flags_is_valid_failure";
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
......@@ -922,4 +931,8 @@ set global innodb_monitor_enable = default;
set global innodb_monitor_disable = default;
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
Warnings:
Error 145 Table './mtr/test_suppressions' is marked as crashed and should be repaired
Error 1194 Table 'test_suppressions' is marked as crashed and should be repaired
Error 1034 1 client is using or hasn't closed the table properly
SET GLOBAL INNODB_FILE_PER_TABLE=1;
......@@ -2,7 +2,16 @@
# Testing robustness against random compression failures
#
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(msg)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`msg` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `msg_i` (`msg`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8
SET GLOBAL innodb_simulate_comp_failures = 25;
SELECT COUNT(*) FROM t1;
COUNT(*)
COMMIT;
SELECT COUNT(id) FROM t1;
COUNT(id)
1500
......@@ -15,6 +15,16 @@
-- source include/have_innodb.inc
call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified.");
call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.");
call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: .*");
call mtr.add_suppression("InnoDB: Tablespace flags: .*");
call mtr.add_suppression("InnoDB: Ignoring tablespace .* because it could not be opened.");
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .*");
call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file .*");
let MYSQLD_DATADIR =`SELECT @@datadir`;
let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522\\t1.ibd'/;
......
......@@ -5,10 +5,6 @@ WHERE LOWER(variable_name) = 'innodb_page_size';
variable_value
16384
# Test 2) The number of buffer pool pages is dependent upon the page size.
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
variable_value
512
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
......
......@@ -94,6 +94,8 @@ select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_during_drop_index_temp_table";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_during_drop_index_temp_table point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -118,6 +120,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_on_drop_of_sec_index point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -142,6 +146,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_on_drop_of_sec_index point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -166,6 +172,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_on_drop_of_sec_index point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -190,6 +198,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_on_drop_of_sec_index point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -300,6 +310,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_drop_reinit_done_create_to_start---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -324,6 +336,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_on_create_of_sec_index---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -348,6 +362,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_on_create_of_sec_index---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -372,6 +388,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_on_create_of_sec_index---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -396,6 +414,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_on_create_of_sec_index---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -506,6 +526,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_before_log_removal point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -530,6 +552,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_before_log_removal point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -554,6 +578,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_before_log_removal point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -578,6 +604,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_before_log_removal point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -688,6 +716,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -712,6 +742,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -736,6 +768,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -760,6 +794,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -870,6 +906,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -894,6 +932,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -918,6 +958,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -942,6 +984,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -1052,6 +1096,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_redo_log_write_complete point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -1076,6 +1122,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_redo_log_write_complete point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -1100,6 +1148,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_redo_log_write_complete point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......@@ -1124,6 +1174,8 @@ select count(*) from t6;
count(*)
3
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
"---debug ib_trunc_crash_after_redo_log_write_complete point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
......
......@@ -24,9 +24,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......@@ -62,9 +63,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......@@ -103,9 +105,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......@@ -143,9 +146,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......@@ -183,9 +187,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......@@ -225,9 +230,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......@@ -266,9 +272,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......@@ -306,9 +313,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......@@ -346,9 +354,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......@@ -388,9 +397,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......@@ -429,9 +439,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......@@ -464,9 +475,10 @@ 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
# restart
check table t;
Table Op Msg_type Msg_text
test.t check status OK
......
......@@ -19,11 +19,14 @@ SELECT variable_value FROM information_schema.global_status
--enable_warnings
--echo # Test 2) The number of buffer pool pages is dependent upon the page size.
--disable_warnings
--replace_result 1535 {checked_valid} 1536 {checked_valid}
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
--enable_warnings
#
# buffer pool pages is dependent upon buffer pool size and what other
# tests are run concurrently
#--disable_warnings
#--replace_result 1535 {checked_valid} 1536 {checked_valid}
#SELECT variable_value FROM information_schema.global_status
# WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
#--enable_warnings
--echo # Test 3) Query some information_shema tables that are dependent upon
--echo # the page size.
......
......@@ -809,6 +809,8 @@ buf_page_is_corrupted(
ulint checksum_field1;
ulint checksum_field2;
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", return(TRUE); );
if (!page_encrypted && !page_size.is_compressed()
&& memcmp(read_buf + FIL_PAGE_LSN + 4,
read_buf + page_size.logical()
......@@ -5984,6 +5986,17 @@ buf_page_io_complete(
/* Not a real corruption if it was triggered by
error injection */
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure",
if (bpage->space > TRX_SYS_SPACE
&& buf_mark_space_corrupt(bpage)) {
ib::info() <<
"Simulated page corruption";
return(true);
}
goto page_not_corrupt_1;
;);
/* Not a real corruption if it was triggered by
error injection */
DBUG_EXECUTE_IF(
"buf_page_import_corrupt_failure",
if (bpage->id.space() > TRX_SYS_SPACE
......@@ -6064,6 +6077,9 @@ buf_page_io_complete(
DBUG_EXECUTE_IF("buf_page_import_corrupt_failure",
page_not_corrupt: bpage = bpage; );
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure",
page_not_corrupt_1: bpage = bpage; );
if (recv_recovery_is_on()) {
/* Pages must be uncompressed for crash recovery. */
ut_a(uncompressed);
......
......@@ -1459,7 +1459,8 @@ fil_space_get_space(
/* We are still holding the fil_system->mutex. Check if
the space is still in memory cache. */
space = fil_space_get_by_id(id);
if (space == NULL) {
if (space == NULL || UT_LIST_GET_LEN(space->chain) == 0) {
return(NULL);
}
......
......@@ -7600,7 +7600,8 @@ commit_get_autoinc(
old_table->found_next_number_field;
dict_index_t* index = dict_table_get_index_on_first_col(
ctx->old_table, autoinc_field->field_index);
ctx->old_table, autoinc_field->field_index,
autoinc_field->field_name);
max_autoinc = ha_alter_info->create_info->auto_increment_value;
......
......@@ -2138,8 +2138,9 @@ dict_index_t*
dict_table_get_index_on_first_col(
/*==============================*/
const dict_table_t* table, /*!< in: table */
ulint col_index); /*!< in: position of column
ulint col_index, /*!< in: position of column
in table */
const char* field_name); /*!< in: field name */
/** Check if a column is a virtual column
@param[in] col column
@return true if it is a virtual column, false otherwise */
......
......@@ -1919,8 +1919,9 @@ dict_index_t*
dict_table_get_index_on_first_col(
/*==============================*/
const dict_table_t* table, /*!< in: table */
ulint col_index) /*!< in: position of column
ulint col_index, /*!< in: position of column
in table */
const char* field_name) /*!< in: field name */
{
ut_ad(col_index < table->n_cols);
......@@ -1933,6 +1934,14 @@ dict_table_get_index_on_first_col(
return(index);
}
}
/* If not yet found use field_name */
for (dict_index_t* index = dict_table_get_first_index(table);
index != NULL; index = dict_table_get_next_index(index)) {
if (!strcmp(index->fields[0].name, field_name)) {
return (index);
}
}
ut_error;
return(0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment