1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

maria-10.0.16 merge

bzr merge -r4588 maria/10.0
This commit is contained in:
Nirbhay Choubey
2015-01-26 22:54:27 -05:00
409 changed files with 13043 additions and 2869 deletions

View File

@@ -1,3 +1,4 @@
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
CREATE TABLE t1(a CHAR(255),
b CHAR(255),
c CHAR(255),

View File

@@ -1,3 +1,4 @@
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
CREATE TABLE t1(a CHAR(255),
b CHAR(255),
c CHAR(255),

View File

@@ -0,0 +1,31 @@
# Create and populate a table
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
INSERT INTO t1 (b) VALUES ('corrupt me');
INSERT INTO t1 (b) VALUES ('corrupt me');
CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT)
ROW_FORMAT=COMPRESSED ENGINE=InnoDB ;
INSERT INTO t2(b) SELECT b from t1;
CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT)
ROW_FORMAT=COMPRESSED ENGINE=InnoDB KEY_BLOCK_SIZE=16;
INSERT INTO t3(b) SELECT b from t1;
# Write file to make mysql-test-run.pl expect the "crash", but don't
# start it until it's told to
# We give 30 seconds to do a clean shutdown because we do not want
# to redo apply the pages of t1.ibd at the time of recovery.
# We want SQL to initiate the first access to t1.ibd.
# Wait until disconnected.
# Run innochecksum on t1
InnoDB offline file checksum utility.
Table is uncompressed
Page size is 16384
# Run innochecksum on t2
InnoDB offline file checksum utility.
Table is compressed
Key block size is 8192
# Run innochecksum on t3
InnoDB offline file checksum utility.
Table is compressed
Key block size is 16384
# Write file to make mysql-test-run.pl start up the server again
# Cleanup
DROP TABLE t1, t2, t3;

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1,4 @@
Variable_name Value
innodb_stats_sample_pages 1
Variable_name Value
innodb_stats_traditional OFF

View File

@@ -104,7 +104,7 @@ 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";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 44 'Tablespace not found' from ./test_wl5522/t1.ibd
ERROR HY000: Got error 44 't1.ibd
SET SESSION debug_dbug="-d,ib_import_open_tablespace_failure";
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
@@ -537,7 +537,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fil_space_create_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 11 'Generic error' from ./test_wl5522/t1.ibd
ERROR HY000: Got error 11 't1.ibd
SET SESSION debug_dbug="-d,fil_space_create_failure";
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
@@ -550,7 +550,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 39 'Data structure corruption' from ./test_wl5522/t1.ibd
ERROR HY000: Got error 39 't1.ibd
SET SESSION debug_dbug="-d,dict_tf_to_fsp_flags_failure";
DROP TABLE test_wl5522.t1;
unlink: t1.ibd

View File

@@ -1,4 +1,4 @@
call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too");
call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too*");
set @old_innodb_undo_logs = @@innodb_undo_logs;
set global innodb_undo_logs=1;
show variables like "max_connections";

View File

@@ -78,4 +78,5 @@ z
31
32
drop table corrupt_bit_test_ā;
DROP DATABASE pad;
SET GLOBAL innodb_change_buffering_debug = 0;

View File

@@ -17,4 +17,16 @@ avg_row_length 0
max_data_length 0
index_length 0
ALTER TABLE mysql.innodb_index_stats_ RENAME TO mysql.innodb_index_stats;
SELECT seq_in_index, column_name, cardinality
FROM information_schema.statistics WHERE table_name = 'test_ps_create_on_corrupted'
ORDER BY index_name, seq_in_index;
seq_in_index 1
column_name a
cardinality 0
SELECT table_rows, avg_row_length, max_data_length, index_length
FROM information_schema.tables WHERE table_name = 'test_ps_create_on_corrupted';
table_rows 0
avg_row_length 0
max_data_length 0
index_length 0
DROP TABLE test_ps_create_on_corrupted;

View File

@@ -1,3 +1,4 @@
call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table*");
CREATE TABLE test_ps_fetch_nonexistent
(a INT, PRIMARY KEY (a))
ENGINE=INNODB STATS_PERSISTENT=1;

View File

@@ -0,0 +1,11 @@
#
# Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1
# CAUSES INFINITE PAGE SPLIT
#
SET GLOBAL innodb_change_buffering_debug=1;
SET GLOBAL innodb_limit_optimistic_insert_debug=1;
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB
PARTITION BY HASH (c1) PARTITIONS 15;
DROP TABLE t1;
SET GLOBAL innodb_change_buffering_debug=0;
SET GLOBAL innodb_limit_optimistic_insert_debug=0;

View File

@@ -0,0 +1,21 @@
create table `t1`(`a` int) engine=innodb partition by key (`a`);
create table `t2`(`b` int) engine=innodb;
create table `t3`(`c` int) engine=innodb;
insert t1 values (1);
insert t2 values (2);
insert t3 values (3);
repair table `t1`,`t2`,`t3`;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
select * from t1;
a
1
select * from t2;
b
2
select * from t3;
c
3
drop table t1, t2, t3;

View File

@@ -0,0 +1,253 @@
#
# Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE
# CALLED FROM A FUNCTION
#
call mtr.add_suppression("MySQL is trying to drop table");
CREATE PROCEDURE cachedata(
IN obj_id BIGINT UNSIGNED,
IN start DATETIME,
IN end DATETIME
)
cachedata:BEGIN
DECLARE cache_count BIGINT;
SET @timestamp := NOW();
CREATE TEMPORARY TABLE IF NOT EXISTS cachedata (
timestamp DATETIME,
object_id BIGINT UNSIGNED NOT NULL,
start DATETIME,
end DATETIME,
seqno BIGINT AUTO_INCREMENT,
value FLOAT,
PRIMARY KEY (seqno),
INDEX (timestamp),
INDEX (object_id, start, end)
) ENGINE=INNODB;
DELETE FROM cachedata WHERE
timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND);
SELECT count(*) INTO cache_count FROM cachedata WHERE
object_id = obj_id
AND start = start
AND end = end;
IF cache_count > 0 THEN LEAVE cachedata;
END IF;
INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345);
END$$
CREATE FUNCTION get_cache(
obj_id BIGINT UNSIGNED,
start DATETIME,
end DATETIME
)
RETURNS FLOAT
READS SQL DATA
BEGIN
DECLARE result FLOAT;
CALL cachedata(obj_id, start, end);
SELECT SUM(value) INTO result FROM cachedata WHERE
object_id = obj_id
AND start = start
AND end = end;
RETURN result;
END$$
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
DROP FUNCTION get_cache;
DROP PROCEDURE cachedata;

View File

@@ -0,0 +1,242 @@
#
# Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN
# INNODB_STRICT_MODE = 1
#
set innodb_strict_mode = 0;
create table t1 (id int auto_increment primary key,
v varchar(32),
col1 text,
col2 text,
col3 text,
col4 text,
col5 text,
col6 text,
col7 text,
col8 text,
col9 text,
col10 text,
col11 text,
col12 text,
col13 text,
col14 text,
col15 text,
col16 text,
col17 text,
col18 text,
col19 text,
col20 text,
col21 text,
col22 text,
col23 text,
col24 text,
col25 text,
col26 text,
col27 text,
col28 text,
col29 text,
col30 text,
col31 text,
col32 text,
col33 text,
col34 text,
col35 text,
col36 text,
col37 text,
col38 text,
col39 text,
col40 text,
col41 text,
col42 text,
col43 text,
col44 text,
col45 text ,
col46 text,
col47 text,
col48 text,
col49 text,
col50 text,
col51 text,
col52 text,
col53 text,
col54 text,
col55 text,
col56 text,
col57 text,
col58 text,
col59 text,
col60 text,
col61 text,
col62 text,
col63 text,
col64 text,
col65 text,
col66 text,
col67 text,
col68 text ,
col69 text,
col70 text,
col71 text,
col72 text,
col73 text,
col74 text,
col75 text,
col76 text,
col77 text,
col78 text,
col79 text,
col80 text,
col81 text,
col82 text,
col83 text,
col84 text,
col85 text,
col86 text,
col87 text,
col88 text,
col89 text,
col90 text,
col91 text,
col92 text,
col93 text,
col94 text,
col95 text,
col96 text,
col97 text,
col98 text,
col99 text,
col100 text,
col101 text,
col102 text,
col103 text,
col104 text,
col105 text,
col106 text,
col107 text,
col108 text,
col109 text,
col110 text,
col111 text,
col112 text,
col113 text,
col114 text,
col115 text,
col116 text,
col117 text,
col118 text,
col119 text,
col120 text,
col121 text,
col122 text,
col123 text,
col124 text,
col125 text,
col126 text ,
col127 text,
col128 text,
col129 text,
col130 text,
col131 text,
col132 text,
col133 text,
col134 text,
col135 text,
col136 text,
col137 text,
col138 text,
col139 text,
col140 text,
col141 text,
col142 text,
col143 text,
col144 text,
col145 text,
col146 text,
col147 text ,
col148 text,
col149 text,
col150 text,
col151 text,
col152 text,
col153 text,
col154 text,
col155 text,
col156 text,
col157 text,
col158 text,
col159 text,
col160 text,
col161 text,
col162 text,
col163 text,
col164 text,
col165 text,
col166 text,
col167 text,
col168 text,
col169 text,
col170 text,
col171 text,
col172 text ,
col173 text,
col174 text,
col175 text,
col176 text,
col177 text,
col178 text,
col179 text,
col180 text,
col181 text,
col182 text,
col183 text,
col184 text,
col185 text,
col186 text,
col187 text,
col188 text,
col189 text,
col190 text,
col191 text,
col192 text,
col193 text,
col194 text,
col195 text,
col196 text,
col197 text,
col198 text,
col199 text,
col200 text,
col201 text,
col202 text,
col203 text,
col204 text,
col205 text,
col206 text,
col207 text,
col208 text,
col209 text,
col210 text,
col211 text,
col212 text,
col213 text,
col214 text,
col215 text,
col216 text,
col217 text,
col218 text,
col219 text,
col220 text,
col221 text,
col222 text,
col223 text,
col224 text,
col225 text,
col226 text,
col227 text,
col228 text
) ENGINE=InnoDB;
Warnings:
Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
set innodb_strict_mode = 1;
alter table t1 engine=InnoDB;
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
drop table t1;

View File

@@ -9,6 +9,8 @@
--source include/have_debug.inc
--source include/have_log_bin.inc
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
let $file_format_max=`SELECT @@innodb_file_format_max`;
CREATE TABLE t1(a CHAR(255),
b CHAR(255),

View File

@@ -9,6 +9,8 @@
--source include/have_debug.inc
--source include/have_log_bin.inc
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
let $file_format_max=`SELECT @@innodb_file_format_max`;
CREATE TABLE t1(a CHAR(255),
b CHAR(255),

View File

@@ -0,0 +1,2 @@
--innodb_file_per_table=1
--innodb_file_format=Barracuda

View File

@@ -0,0 +1,70 @@
#
# Test innochecksum
#
# Don't test under embedded
source include/not_embedded.inc;
# Require InnoDB
source include/have_innodb.inc;
if (!$INNOCHECKSUM) {
--echo Need innochecksum binary
--die Need innochecksum binary
}
--echo # Create and populate a table
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
INSERT INTO t1 (b) VALUES ('corrupt me');
--disable_query_log
--let $i = 1000
while ($i)
{
INSERT INTO t1 (b) VALUES (REPEAT('abcdefghijklmnopqrstuvwxyz', 100));
dec $i;
}
--enable_query_log
INSERT INTO t1 (b) VALUES ('corrupt me');
CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT)
ROW_FORMAT=COMPRESSED ENGINE=InnoDB ;
INSERT INTO t2(b) SELECT b from t1;
CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT)
ROW_FORMAT=COMPRESSED ENGINE=InnoDB KEY_BLOCK_SIZE=16;
INSERT INTO t3(b) SELECT b from t1;
let $MYSQLD_DATADIR=`select @@datadir`;
let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd;
let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd;
--echo # Write file to make mysql-test-run.pl expect the "crash", but don't
--echo # start it until it's told to
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--echo # We give 30 seconds to do a clean shutdown because we do not want
--echo # to redo apply the pages of t1.ibd at the time of recovery.
--echo # We want SQL to initiate the first access to t1.ibd.
shutdown_server 30;
--echo # Wait until disconnected.
--source include/wait_until_disconnected.inc
--echo # Run innochecksum on t1
--exec $INNOCHECKSUM $t1_IBD
--echo # Run innochecksum on t2
--exec $INNOCHECKSUM $t2_IBD
--echo # Run innochecksum on t3
--exec $INNOCHECKSUM $t3_IBD
--echo # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
--echo # Cleanup
DROP TABLE t1, t2, t3;

View File

@@ -1,5 +1,8 @@
# MDEV-6288: Innodb causes server crash after disk full, then can't ALTER TABLE any more
--source include/have_innodb.inc
--source include/not_windows.inc
--source include/not_valgrind.inc
--source include/not_embedded.inc
# DEBUG_SYNC must be compiled in.
--source include/have_debug_sync.inc

View File

@@ -14,6 +14,8 @@ if (`select plugin_auth_version < "5.6.17" from information_schema.plugins where
--source include/not_embedded.inc
# DBUG_SUICIDE() hangs under valgrind
--source include/not_valgrind.inc
# No windows, need perl
--source include/not_windows.inc
# The flag innodb_change_buffering_debug is only available in debug builds.
# It instructs InnoDB to try to evict pages from the buffer pool when

View File

@@ -0,0 +1,48 @@
--source include/have_innodb.inc
--source include/have_partition.inc
--disable_query_log
--disable_result_log
--disable_warnings
# Ignore OS errors
call mtr.add_suppression("InnoDB: File ./test/t1*");
call mtr.add_suppression("InnoDB: Error number*");
call mtr.add_suppression("InnoDB: File ./test/t1#p#p1#sp#p1sp0.ibd: 'rename' returned OS error*");
# MDEV-7046: MySQL#74480 - Failing assertion: os_file_status(newpath, &exists, &type)
# after Operating system error number 36 in a file operation
USE test;
create table t1(f1 INT,f2 INT,f3 CHAR (10),primary key(f1,f2)) partition by range(f1) subpartition by hash(f2) subpartitions 2 (partition p1 values less than (0),partition p2 values less than (2),partition p3 values less than (2147483647));
--replace_regex /'.*t2_new.*'/'t2_new'/
--error 7
RENAME TABLE t1 TO `t2_new..............................................end`;
alter table t1 engine=innodb;
--replace_regex /'.*t2_new.*'/'t2_new'/
--error 1025
RENAME TABLE t1 TO `t2_new..............................................end`;
--replace_regex /'.*t2_new.*'/'t2_new'/
show warnings;
drop table t1;
DROP DATABASE test;CREATE DATABASE test;USE test;
SET @@session.storage_engine=MYISAM;
--error 0,1,1103
CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0 DATA DIRECTORY='/tmp/not-existing' INDEX DIRECTORY='/tmp/not-existing',SUBPARTITION sp1));
drop table if exists t1;
CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0,SUBPARTITION sp1));
ALTER TABLE t1 ENGINE=InnoDB;
drop table t1;
let $datadir=`select @@datadir`;
--remove_file $datadir/test/db.opt
--enable_query_log
--enable_result_log
--enable_warnings
# make sure that we have at least some ouput to avoid mtr warning
--echo 1

View File

@@ -0,0 +1,78 @@
--source include/have_innodb.inc
#
# Test that mysqld does not crash when running ANALYZE TABLE with
# different values of the parameter innodb_stats_sample_pages.
#
# we care only that the following SQL commands do not produce errors
# and do not crash the server
-- disable_query_log
-- disable_result_log
-- enable_warnings
let $sample_pages=`select @@innodb_stats_sample_pages`;
let $traditional=`select @@innodb_stats_traditional`;
SET GLOBAL innodb_stats_sample_pages=0;
#use new method to calculate statistics
SET GLOBAL innodb_stats_traditional=0;
# check that the value has been adjusted to 1
-- enable_result_log
SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
SHOW VARIABLES LIKE 'innodb_stats_traditional';
-- disable_result_log
CREATE TABLE innodb_analyze (
a INT,
b INT,
c char(50),
KEY(a),
KEY(b,a)
) ENGINE=InnoDB;
# test with empty table
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=2;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=1;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=8000;
ANALYZE TABLE innodb_analyze;
delimiter //;
create procedure innodb_insert_proc (repeat_count int)
begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into innodb_analyze values(current_num, current_num*100,substring(MD5(RAND()), -44));
set current_num = current_num + 1;
end while;
end//
delimiter ;//
commit;
set autocommit=0;
call innodb_insert_proc(7000);
commit;
set autocommit=1;
SET GLOBAL innodb_stats_sample_pages=1;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=8;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=16;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=8000;
ANALYZE TABLE innodb_analyze;
DROP PROCEDURE innodb_insert_proc;
DROP TABLE innodb_analyze;
EVAL SET GLOBAL innodb_stats_sample_pages=$sample_pages;
EVAL SET GLOBAL innodb_stats_traditional=$traditional;

View File

@@ -22,7 +22,7 @@ let MYSQLD_DATADIR =`SELECT @@datadir`;
let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
let $innodb_file_format = `SELECT @@innodb_file_format`;
let $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522\\t1.ibd'/;
let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522_t1.ibd'/;
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
@@ -233,8 +233,7 @@ SET SESSION debug_dbug="-d,ib_import_reset_space_and_lsn_failure";
# Test failure after attempting a tablespace open
SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
--replace_regex /file: '.*t1.ibd'/'t1.ibd'/
--replace_regex /'.*[\/\\]/'/
--error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
@@ -637,8 +636,7 @@ EOF
SET SESSION debug_dbug="+d,fil_space_create_failure";
--replace_regex $pathfix
--replace_regex /'.*[\/\\]/'/
--error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
@@ -669,8 +667,7 @@ EOF
SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure";
--replace_regex $pathfix
--replace_regex /'.*[\/\\]/'/
--error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

View File

@@ -10,8 +10,13 @@ if (`select count(*)=0 from information_schema.global_variables where variable_n
# Don't test under valgrind, undo slots of the previous test might exist still
# and cause unstable result.
--source include/not_valgrind.inc
# undo slots of the previous test might exist still
--source include/not_windows.inc
call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too");
# Previous undo slots cause unnecessary failures
--source include/not_windows.inc
call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too*");
--disable_query_log
set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug;

View File

@@ -12,6 +12,9 @@ source include/not_embedded.inc;
source include/have_innodb.inc;
# Require Debug for SET DEBUG
source include/have_debug.inc;
# Test could open crash reporter on Windows
# if compiler set up
source include/not_windows.inc;
CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");

View File

@@ -4,6 +4,11 @@
-- source include/have_innodb.inc
-- source include/have_innodb_16k.inc
if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier
}
# Issues with innodb_change_buffering_debug on Windows, so the test scenario
# cannot be created on windows
--source include/not_windows.inc
@@ -18,14 +23,20 @@ call mtr.add_suppression("Flagged corruption of idx.*in CHECK TABLE");
# It instructs InnoDB to try to evict pages from the buffer pool when
# change buffering is possible, so that the change buffer will be used
# whenever possible.
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = 1;
# Turn off Unique Check to create corrupted index with dup key
SET UNIQUE_CHECKS=0;
CREATE DATABASE pad;
let $i=345;
while ($i)
{
--eval CREATE TABLE pad.t$i (a INT PRIMARY KEY) ENGINE=InnoDB;
dec $i;
}
-- enable_query_log
set names utf8;
@@ -121,6 +132,6 @@ select z from corrupt_bit_test_ā limit 10;
# Drop table
drop table corrupt_bit_test_ā;
DROP DATABASE pad;
-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = 0;

View File

@@ -33,4 +33,16 @@ FROM information_schema.tables WHERE table_name = 'test_ps_create_on_corrupted';
# restore the persistent storage
ALTER TABLE mysql.innodb_index_stats_ RENAME TO mysql.innodb_index_stats;
--source include/restart_mysqld.inc
-- vertical_results
# check again
SELECT seq_in_index, column_name, cardinality
FROM information_schema.statistics WHERE table_name = 'test_ps_create_on_corrupted'
ORDER BY index_name, seq_in_index;
SELECT table_rows, avg_row_length, max_data_length, index_length
FROM information_schema.tables WHERE table_name = 'test_ps_create_on_corrupted';
DROP TABLE test_ps_create_on_corrupted;

View File

@@ -4,6 +4,8 @@
-- source include/have_innodb.inc
call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table*");
-- vertical_results
CREATE TABLE test_ps_fetch_nonexistent

View File

@@ -0,0 +1,22 @@
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_partition.inc
if (`select plugin_auth_version < "5.6.22" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in InnoDB/XtraDB as of 5.6.21 or earlier
}
--echo #
--echo # Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1
--echo # CAUSES INFINITE PAGE SPLIT
--echo #
SET GLOBAL innodb_change_buffering_debug=1;
SET GLOBAL innodb_limit_optimistic_insert_debug=1;
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB
PARTITION BY HASH (c1) PARTITIONS 15;
DROP TABLE t1;
SET GLOBAL innodb_change_buffering_debug=0;
SET GLOBAL innodb_limit_optimistic_insert_debug=0;

View File

@@ -0,0 +1,18 @@
#
# MDEV-7404 REPAIR multiple tables crash in MDL_ticket::has_stronger_or_equal_type
#
--source include/have_partition.inc
--source include/have_innodb.inc
create table `t1`(`a` int) engine=innodb partition by key (`a`);
create table `t2`(`b` int) engine=innodb;
create table `t3`(`c` int) engine=innodb;
insert t1 values (1);
insert t2 values (2);
insert t3 values (3);
repair table `t1`,`t2`,`t3`;
select * from t1;
select * from t2;
select * from t3;
drop table t1, t2, t3;

View File

@@ -0,0 +1,108 @@
--source include/have_innodb.inc
--source include/big_test.inc
if (`select plugin_auth_version < "5.6.22" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in InnoDB/XtraDB as of 5.6.21 or earlier
}
--echo #
--echo # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE
--echo # CALLED FROM A FUNCTION
--echo #
call mtr.add_suppression("MySQL is trying to drop table");
DELIMITER $$;
CREATE PROCEDURE cachedata(
IN obj_id BIGINT UNSIGNED,
IN start DATETIME,
IN end DATETIME
)
cachedata:BEGIN
DECLARE cache_count BIGINT;
SET @timestamp := NOW();
CREATE TEMPORARY TABLE IF NOT EXISTS cachedata (
timestamp DATETIME,
object_id BIGINT UNSIGNED NOT NULL,
start DATETIME,
end DATETIME,
seqno BIGINT AUTO_INCREMENT,
value FLOAT,
PRIMARY KEY (seqno),
INDEX (timestamp),
INDEX (object_id, start, end)
) ENGINE=INNODB;
DELETE FROM cachedata WHERE
timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND);
SELECT count(*) INTO cache_count FROM cachedata WHERE
object_id = obj_id
AND start = start
AND end = end;
IF cache_count > 0 THEN LEAVE cachedata;
END IF;
INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345);
END$$
CREATE FUNCTION get_cache(
obj_id BIGINT UNSIGNED,
start DATETIME,
end DATETIME
)
RETURNS FLOAT
READS SQL DATA
BEGIN
DECLARE result FLOAT;
CALL cachedata(obj_id, start, end);
SELECT SUM(value) INTO result FROM cachedata WHERE
object_id = obj_id
AND start = start
AND end = end;
RETURN result;
END$$
DELIMITER ;$$
let $i = 30;
while ($i)
{
SELECT get_cache(1, '2014-01-01', '2014-02-01');
select sleep(1);
dec $i;
}
DROP FUNCTION get_cache;
DROP PROCEDURE cachedata;

View File

@@ -0,0 +1,251 @@
--source include/have_innodb.inc
if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier
}
--echo #
--echo # Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN
--echo # INNODB_STRICT_MODE = 1
--echo #
set innodb_strict_mode = 0;
create table t1 (id int auto_increment primary key,
v varchar(32),
col1 text,
col2 text,
col3 text,
col4 text,
col5 text,
col6 text,
col7 text,
col8 text,
col9 text,
col10 text,
col11 text,
col12 text,
col13 text,
col14 text,
col15 text,
col16 text,
col17 text,
col18 text,
col19 text,
col20 text,
col21 text,
col22 text,
col23 text,
col24 text,
col25 text,
col26 text,
col27 text,
col28 text,
col29 text,
col30 text,
col31 text,
col32 text,
col33 text,
col34 text,
col35 text,
col36 text,
col37 text,
col38 text,
col39 text,
col40 text,
col41 text,
col42 text,
col43 text,
col44 text,
col45 text ,
col46 text,
col47 text,
col48 text,
col49 text,
col50 text,
col51 text,
col52 text,
col53 text,
col54 text,
col55 text,
col56 text,
col57 text,
col58 text,
col59 text,
col60 text,
col61 text,
col62 text,
col63 text,
col64 text,
col65 text,
col66 text,
col67 text,
col68 text ,
col69 text,
col70 text,
col71 text,
col72 text,
col73 text,
col74 text,
col75 text,
col76 text,
col77 text,
col78 text,
col79 text,
col80 text,
col81 text,
col82 text,
col83 text,
col84 text,
col85 text,
col86 text,
col87 text,
col88 text,
col89 text,
col90 text,
col91 text,
col92 text,
col93 text,
col94 text,
col95 text,
col96 text,
col97 text,
col98 text,
col99 text,
col100 text,
col101 text,
col102 text,
col103 text,
col104 text,
col105 text,
col106 text,
col107 text,
col108 text,
col109 text,
col110 text,
col111 text,
col112 text,
col113 text,
col114 text,
col115 text,
col116 text,
col117 text,
col118 text,
col119 text,
col120 text,
col121 text,
col122 text,
col123 text,
col124 text,
col125 text,
col126 text ,
col127 text,
col128 text,
col129 text,
col130 text,
col131 text,
col132 text,
col133 text,
col134 text,
col135 text,
col136 text,
col137 text,
col138 text,
col139 text,
col140 text,
col141 text,
col142 text,
col143 text,
col144 text,
col145 text,
col146 text,
col147 text ,
col148 text,
col149 text,
col150 text,
col151 text,
col152 text,
col153 text,
col154 text,
col155 text,
col156 text,
col157 text,
col158 text,
col159 text,
col160 text,
col161 text,
col162 text,
col163 text,
col164 text,
col165 text,
col166 text,
col167 text,
col168 text,
col169 text,
col170 text,
col171 text,
col172 text ,
col173 text,
col174 text,
col175 text,
col176 text,
col177 text,
col178 text,
col179 text,
col180 text,
col181 text,
col182 text,
col183 text,
col184 text,
col185 text,
col186 text,
col187 text,
col188 text,
col189 text,
col190 text,
col191 text,
col192 text,
col193 text,
col194 text,
col195 text,
col196 text,
col197 text,
col198 text,
col199 text,
col200 text,
col201 text,
col202 text,
col203 text,
col204 text,
col205 text,
col206 text,
col207 text,
col208 text,
col209 text,
col210 text,
col211 text,
col212 text,
col213 text,
col214 text,
col215 text,
col216 text,
col217 text,
col218 text,
col219 text,
col220 text,
col221 text,
col222 text,
col223 text,
col224 text,
col225 text,
col226 text,
col227 text,
col228 text
) ENGINE=InnoDB;
set innodb_strict_mode = 1;
--error ER_TOO_BIG_ROWSIZE
alter table t1 engine=InnoDB;
drop table t1;