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

Local merge of mariadb-5.5.39

bzr merge -r4264 maria/5.5

Text conflict in sql/mysqld.cc
Text conflict in storage/xtradb/btr/btr0cur.c
Text conflict in storage/xtradb/buf/buf0buf.c
Text conflict in storage/xtradb/buf/buf0lru.c
Text conflict in storage/xtradb/handler/ha_innodb.cc
5 conflicts encountered.
This commit is contained in:
Nirbhay Choubey
2014-08-06 14:06:11 -04:00
294 changed files with 7871 additions and 5706 deletions

View File

@@ -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

View 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;

View 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;

View File

@@ -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

View File

@@ -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(*)
10000

View 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;

View 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;

View File

@@ -1 +1 @@
--lower-case-table-names=2
--lower-case-table-names=2

View File

@@ -0,0 +1,2 @@
--innodb-file-per-table

View File

@@ -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

View File

@@ -0,0 +1,2 @@
--innodb-file-per-table

View File

@@ -0,0 +1,5 @@
--let $num_inserts = 10000
--let $num_ops = 3000
--source suite/innodb/include/innodb_simulate_comp_failures.inc
# clean exit
--exit