mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.0.14 into 10.1
This commit is contained in:
@ -0,0 +1,147 @@
|
||||
--echo #
|
||||
--echo # Testing robustness against random compression failures
|
||||
--echo #
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--disable_query_log
|
||||
# record the file format in order to restore in the end.
|
||||
--let $file_format_save = `SELECT @@innodb_file_format`
|
||||
--let $file_format_max_save = `SELECT @@innodb_file_format_max`
|
||||
--let $simulate_comp_failures_save = `SELECT @@innodb_simulate_comp_failures`
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
SET GLOBAL INNODB_FILE_FORMAT='Barracuda';
|
||||
--enable_warnings
|
||||
|
||||
# since this test generates lot of errors in log, suppress checking errors
|
||||
call mtr.add_suppression(".*");
|
||||
--enable_query_log
|
||||
|
||||
# create the table with compressed pages of size 8K.
|
||||
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(msg)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
|
||||
|
||||
# percentage of compressions that will be forced to fail
|
||||
SET GLOBAL innodb_simulate_comp_failures = 25;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
|
||||
let $num_inserts_ind = $num_inserts;
|
||||
while ($num_inserts_ind)
|
||||
{
|
||||
let $repeat = `select floor(rand() * 10)`;
|
||||
eval
|
||||
INSERT INTO t1(id, msg)
|
||||
VALUES ($num_inserts_ind, REPEAT('abcdefghijklmnopqrstuvwxyz', $repeat));
|
||||
dec $num_inserts_ind;
|
||||
}
|
||||
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
|
||||
SELECT COUNT(*) FROM t1;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
|
||||
# do random ops, making sure that some pages will get fragmented and reorganized.
|
||||
let $num_ops_ind = $num_ops;
|
||||
|
||||
while($num_ops_ind)
|
||||
{
|
||||
let $idx = `select floor(rand()*$num_inserts)`;
|
||||
let $insert_or_update = `select floor(rand()*3)`;
|
||||
|
||||
let $repeat = `select floor(rand() * 9) + 1`;
|
||||
|
||||
let $msg = query_get_value(`select repeat('abcdefghijklmnopqrstuvwxyz', $repeat) as x`, x, 1);
|
||||
|
||||
let $single_or_multi = `select floor(rand()*10)`;
|
||||
|
||||
if ($insert_or_update)
|
||||
{
|
||||
let $cnt = query_get_value(SELECT COUNT(*) cnt FROM t1 WHERE id=$idx, cnt, 1);
|
||||
|
||||
if ($cnt)
|
||||
{
|
||||
let $update = `select floor(rand()*2)`;
|
||||
|
||||
if ($update)
|
||||
{
|
||||
if ($single_or_multi)
|
||||
{
|
||||
eval UPDATE t1 SET msg=\"$msg\" WHERE id=$idx;
|
||||
}
|
||||
|
||||
if (!$single_or_multi)
|
||||
{
|
||||
eval UPDATE t1 SET msg=\"$msg\" WHERE id >= $idx - 100 AND id <= $idx + 100;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!$update)
|
||||
{
|
||||
if ($single_or_multi)
|
||||
{
|
||||
eval INSERT INTO t1(msg, id) VALUES (\"$msg\", $idx) ON DUPLICATE KEY UPDATE msg=VALUES(msg), id = VALUES(id);
|
||||
}
|
||||
|
||||
if (!$single_or_multi)
|
||||
{
|
||||
let $diff = 200;
|
||||
|
||||
while ($diff)
|
||||
{
|
||||
eval INSERT INTO t1(msg, id) VALUES (\"$msg\", $idx + 100 - $diff) ON DUPLICATE KEY UPDATE msg=VALUES(msg), id=VALUES(id);
|
||||
|
||||
dec $diff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$cnt)
|
||||
{
|
||||
let $null_msg = `select floor(rand()*2)`;
|
||||
|
||||
if ($null_msg)
|
||||
{
|
||||
eval INSERT INTO t1(id,msg) VALUES ($idx, NULL);
|
||||
}
|
||||
|
||||
if (!$null_msg)
|
||||
{
|
||||
eval INSERT INTO t1(id, msg) VALUES ($idx, \"$msg\");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$insert_or_update)
|
||||
{
|
||||
if ($single_or_multi)
|
||||
{
|
||||
eval DELETE from t1 WHERE id=$idx;
|
||||
}
|
||||
|
||||
if (!$single_or_multi)
|
||||
{
|
||||
eval DELETE from t1 WHERE id >= $idx - 100 AND id <= $idx + 100;
|
||||
}
|
||||
}
|
||||
|
||||
dec $num_ops_ind;
|
||||
}
|
||||
|
||||
# final cleanup
|
||||
DROP TABLE t1;
|
||||
|
||||
# restore innodb_file_format and innodb_file_format_max
|
||||
eval SET GLOBAL innodb_file_format = \"$file_format_save\";
|
||||
eval SET GLOBAL innodb_file_format_max = \"$file_format_max_save\";
|
||||
eval SET GLOBAL innodb_simulate_comp_failures = $simulate_comp_failures_save;
|
||||
|
||||
--enable_query_log
|
15
mysql-test/suite/innodb/r/blob_unique2pk.result
Normal file
15
mysql-test/suite/innodb/r/blob_unique2pk.result
Normal file
@ -0,0 +1,15 @@
|
||||
create table t1 (f1 tinyblob not null) engine=innodb;
|
||||
alter table t1 add unique index (f1(255));
|
||||
drop table t1;
|
||||
create table t1 (f1 tinyblob not null) engine=innodb;
|
||||
alter table t1 add unique index (f1(356));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` tinyblob NOT NULL,
|
||||
UNIQUE KEY `f1` (`f1`(255))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (f1 point not null) engine=innodb;
|
||||
alter table t1 add unique index (f1);
|
||||
drop table t1;
|
@ -0,0 +1,50 @@
|
||||
create table t1(a int not null primary key, b int) engine=innodb;
|
||||
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 t1 values(current_num, current_num);
|
||||
set current_num = current_num + 1;
|
||||
end while;
|
||||
end//
|
||||
commit;
|
||||
set autocommit=0;
|
||||
call innodb_insert_proc(10000);
|
||||
commit;
|
||||
set autocommit=1;
|
||||
set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28';
|
||||
alter table t1 add testcol int;
|
||||
ERROR HY000: The table 't1' is full
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL,
|
||||
`b` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28_2';
|
||||
alter table t1 add testcol int;
|
||||
ERROR HY000: The table 't1' is full
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL,
|
||||
`b` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
set DEBUG_DBUG=NULL;
|
||||
alter table t1 add testcol2 int;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL,
|
||||
`b` int(11) DEFAULT NULL,
|
||||
`testcol2` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
select count(1) from t1;
|
||||
count(1)
|
||||
10000
|
||||
drop procedure innodb_insert_proc;
|
||||
drop table t1;
|
35
mysql-test/suite/innodb/r/innodb-fk.result
Normal file
35
mysql-test/suite/innodb/r/innodb-fk.result
Normal file
@ -0,0 +1,35 @@
|
||||
#
|
||||
# Bug #18806829 OPENING INNODB TABLES WITH MANY FOREIGN KEY
|
||||
# REFERENCES IS SLOW/CRASHES SEMAPHORE
|
||||
#
|
||||
create table t1 (f1 int primary key) engine=innodb;
|
||||
insert into t1 values (5);
|
||||
insert into t1 values (2882);
|
||||
insert into t1 values (10);
|
||||
update t1 set f1 = 28 where f1 = 2882;
|
||||
select * from fk_120;
|
||||
f1
|
||||
5
|
||||
10
|
||||
28
|
||||
select * from fk_1;
|
||||
f1
|
||||
5
|
||||
10
|
||||
28
|
||||
select * from fk_50;
|
||||
f1
|
||||
5
|
||||
10
|
||||
28
|
||||
drop table t1;
|
||||
#
|
||||
# Check if restrict is working fine.
|
||||
#
|
||||
create table t1 (f1 int primary key) engine=innodb;
|
||||
delete from t1 where f1 = 29;
|
||||
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`fk_29`, CONSTRAINT `pc29` FOREIGN KEY (`f1`) REFERENCES `t1` (`f1`))
|
||||
select * from fk_29;
|
||||
f1
|
||||
29
|
||||
drop table t1;
|
@ -0,0 +1,32 @@
|
||||
call mtr.add_suppression("InnoDB: Warning: Index.*");
|
||||
set DEBUG_DBUG='+d,ib_ha_innodb_stat_not_initialized';
|
||||
create table t1(a int not null primary key, b int, c int, key(b), key(c)) engine=innodb;
|
||||
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 t1 values(current_num, current_num, current_num);
|
||||
set current_num = current_num + 1;
|
||||
end while;
|
||||
end//
|
||||
commit;
|
||||
set autocommit=0;
|
||||
call innodb_insert_proc(10000);
|
||||
commit;
|
||||
set autocommit=1;
|
||||
select count(1) from t1;
|
||||
count(1)
|
||||
10000
|
||||
select count(1) from t1 where a between 5 and 100;
|
||||
count(1)
|
||||
96
|
||||
select count(1) from t1 where b between 5 and 256;
|
||||
count(1)
|
||||
252
|
||||
select count(1) from t1 where c between 7 and 787;
|
||||
count(1)
|
||||
781
|
||||
set DEBUG_DBUG=NULL;
|
||||
drop procedure innodb_insert_proc;
|
||||
drop table t1;
|
@ -1,4 +1,3 @@
|
||||
ERROR 42000: Row size too large (> ####). 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.
|
||||
f4 f8
|
||||
xxx zzz
|
||||
f4 f8
|
||||
xxx zzz
|
||||
|
@ -0,0 +1,8 @@
|
||||
#
|
||||
# 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;
|
||||
SET GLOBAL innodb_simulate_comp_failures = 25;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
100000
|
@ -0,0 +1,8 @@
|
||||
#
|
||||
# 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;
|
||||
SET GLOBAL innodb_simulate_comp_failures = 25;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
1000
|
20
mysql-test/suite/innodb/t/blob_unique2pk.test
Normal file
20
mysql-test/suite/innodb/t/blob_unique2pk.test
Normal file
@ -0,0 +1,20 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
|
||||
#
|
||||
# Bug#16368875 INNODB: FAILING ASSERTION: PRIMARY_KEY_NO == -1 || PRIMARY_KEY_NO == 0
|
||||
#
|
||||
create table t1 (f1 tinyblob not null) engine=innodb;
|
||||
alter table t1 add unique index (f1(255));
|
||||
drop table t1;
|
||||
|
||||
create table t1 (f1 tinyblob not null) engine=innodb;
|
||||
alter table t1 add unique index (f1(356));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (f1 point not null) engine=innodb;
|
||||
alter table t1 add unique index (f1);
|
||||
drop table t1;
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
--innodb-use-native-aio=0
|
47
mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test
Normal file
47
mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test
Normal file
@ -0,0 +1,47 @@
|
||||
# MDEV-6288: Innodb causes server crash after disk full, then can't ALTER TABLE any more
|
||||
--source include/have_innodb.inc
|
||||
|
||||
# DEBUG_SYNC must be compiled in.
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
create table t1(a int not null primary key, b int) engine=innodb;
|
||||
|
||||
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 t1 values(current_num, current_num);
|
||||
set current_num = current_num + 1;
|
||||
end while;
|
||||
end//
|
||||
delimiter ;//
|
||||
commit;
|
||||
|
||||
set autocommit=0;
|
||||
call innodb_insert_proc(10000);
|
||||
commit;
|
||||
set autocommit=1;
|
||||
|
||||
# This caused crash earlier
|
||||
set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28';
|
||||
--error 1114
|
||||
alter table t1 add testcol int;
|
||||
show create table t1;
|
||||
|
||||
# This caused crash earlier
|
||||
set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28_2';
|
||||
--error 1114
|
||||
alter table t1 add testcol int;
|
||||
show create table t1;
|
||||
|
||||
set DEBUG_DBUG=NULL;
|
||||
alter table t1 add testcol2 int;
|
||||
show create table t1;
|
||||
|
||||
select count(1) from t1;
|
||||
|
||||
drop procedure innodb_insert_proc;
|
||||
drop table t1;
|
||||
|
86
mysql-test/suite/innodb/t/innodb-fk.test
Normal file
86
mysql-test/suite/innodb/t/innodb-fk.test
Normal file
@ -0,0 +1,86 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug #18806829 OPENING INNODB TABLES WITH MANY FOREIGN KEY
|
||||
--echo # REFERENCES IS SLOW/CRASHES SEMAPHORE
|
||||
--echo #
|
||||
|
||||
create table t1 (f1 int primary key) engine=innodb;
|
||||
insert into t1 values (5);
|
||||
insert into t1 values (2882);
|
||||
insert into t1 values (10);
|
||||
|
||||
let $fk_tables = 120;
|
||||
|
||||
--disable_query_log
|
||||
let $i = $fk_tables;
|
||||
while ($i)
|
||||
{
|
||||
eval create table fk_$i (f1 int primary key,
|
||||
constraint pc$i foreign key (f1) references t1(f1)
|
||||
on delete cascade on update cascade) engine=innodb;
|
||||
eval insert into fk_$i values (5);
|
||||
eval insert into fk_$i values (2882);
|
||||
eval insert into fk_$i values (10);
|
||||
dec $i;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
update t1 set f1 = 28 where f1 = 2882;
|
||||
|
||||
select * from fk_120;
|
||||
select * from fk_1;
|
||||
select * from fk_50;
|
||||
|
||||
--disable_query_log
|
||||
let $i = $fk_tables;
|
||||
while ($i)
|
||||
{
|
||||
eval drop table fk_$i;
|
||||
dec $i;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # Check if restrict is working fine.
|
||||
--echo #
|
||||
|
||||
create table t1 (f1 int primary key) engine=innodb;
|
||||
|
||||
let $fk_tables = 30;
|
||||
|
||||
--disable_query_log
|
||||
let $i = $fk_tables;
|
||||
while ($i)
|
||||
{
|
||||
eval create table fk_$i (f1 int primary key,
|
||||
constraint pc$i foreign key (f1) references t1(f1)
|
||||
on delete restrict on update restrict) engine=innodb;
|
||||
eval insert into t1 values ($i);
|
||||
eval insert into fk_$i values ($i);
|
||||
dec $i;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
--error ER_ROW_IS_REFERENCED_2
|
||||
delete from t1 where f1 = 29;
|
||||
select * from fk_29;
|
||||
|
||||
--disable_query_log
|
||||
let $i = $fk_tables;
|
||||
while ($i)
|
||||
{
|
||||
eval drop table fk_$i;
|
||||
dec $i;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
drop table t1;
|
||||
|
@ -0,0 +1,39 @@
|
||||
# MDEV-6424: Mariadb server crashes with assertion failure in file ha_innodb.cc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
# DEBUG_SYNC must be compiled in.
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
call mtr.add_suppression("InnoDB: Warning: Index.*");
|
||||
# This caused crash earlier
|
||||
set DEBUG_DBUG='+d,ib_ha_innodb_stat_not_initialized';
|
||||
create table t1(a int not null primary key, b int, c int, key(b), key(c)) engine=innodb;
|
||||
|
||||
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 t1 values(current_num, current_num, current_num);
|
||||
set current_num = current_num + 1;
|
||||
end while;
|
||||
end//
|
||||
delimiter ;//
|
||||
commit;
|
||||
|
||||
set autocommit=0;
|
||||
call innodb_insert_proc(10000);
|
||||
commit;
|
||||
set autocommit=1;
|
||||
|
||||
select count(1) from t1;
|
||||
select count(1) from t1 where a between 5 and 100;
|
||||
select count(1) from t1 where b between 5 and 256;
|
||||
select count(1) from t1 where c between 7 and 787;
|
||||
|
||||
set DEBUG_DBUG=NULL;
|
||||
|
||||
drop procedure innodb_insert_proc;
|
||||
drop table t1;
|
||||
|
@ -1,31 +1,32 @@
|
||||
--source include/have_innodb.inc
|
||||
#
|
||||
# Bug#34300 Tinyblob & tinytext fields currupted after export/import and alter in 5.1
|
||||
# http://bugs.mysql.com/34300
|
||||
#
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
|
||||
call mtr.add_suppression("InnoDB: Warning: a long semaphore wait:");
|
||||
call mtr.add_suppression("the age of the last checkpoint is");
|
||||
call mtr.add_suppression("InnoDB: The total blob data length");
|
||||
|
||||
# set packet size and reconnect
|
||||
let $max_packet=`select @@global.max_allowed_packet`;
|
||||
SET @@global.max_allowed_packet=16777216;
|
||||
--connect (newconn, localhost, root,,)
|
||||
|
||||
DROP TABLE IF EXISTS bug34300;
|
||||
--enable_result_log
|
||||
|
||||
CREATE TABLE bug34300 (
|
||||
f4 TINYTEXT,
|
||||
f6 MEDIUMTEXT,
|
||||
f8 TINYBLOB
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
--replace_regex /\(> [0-9]*\)/(> ####)/
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
INSERT INTO bug34300 VALUES ('xxx', repeat('a', 8459264), 'zzz');
|
||||
|
||||
-- enable_result_log
|
||||
|
||||
SELECT f4, f8 FROM bug34300;
|
||||
|
||||
ALTER TABLE bug34300 ADD COLUMN (f10 INT);
|
||||
|
@ -0,0 +1,2 @@
|
||||
--innodb-file-per-table
|
||||
|
@ -0,0 +1,8 @@
|
||||
--source include/big_test.inc
|
||||
# test takes too long with valgrind
|
||||
--source include/not_valgrind.inc
|
||||
--let $num_inserts = 100000
|
||||
--let $num_ops = 30000
|
||||
--source suite/innodb/include/innodb_simulate_comp_failures.inc
|
||||
# clean exit
|
||||
--exit
|
@ -0,0 +1,2 @@
|
||||
--innodb-file-per-table
|
||||
|
@ -0,0 +1,5 @@
|
||||
--let $num_inserts = 1000
|
||||
--let $num_ops = 30
|
||||
--source suite/innodb/include/innodb_simulate_comp_failures.inc
|
||||
# clean exit
|
||||
--exit
|
Reference in New Issue
Block a user