Skip to content

Commit

Permalink
Merge 10.2 into bb-10.2-ext
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Sep 8, 2017
2 parents a82ed92 + 2425f2a commit fb14761
Show file tree
Hide file tree
Showing 14 changed files with 596 additions and 557 deletions.
700 changes: 172 additions & 528 deletions extra/mariabackup/xtrabackup.cc

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5057,13 +5057,6 @@ ($$)
$path_vardir_trace, $mysqld->name());
}

if (IS_WINDOWS)
{
# Trick the server to send output to stderr, with --console
if (!(grep(/^--log-error/, @$args))) {
mtr_add_arg($args, "--console");
}
}

# "Dynamic" version of MYSQLD_CMD is reevaluated with each mysqld_start.
# Use it to restart the server at testing a failing server start (e.g
Expand Down Expand Up @@ -5526,14 +5519,6 @@ ($)
my $extra_opts= get_extra_opts($mysqld, $tinfo);
mysqld_arguments($mysqld_args, $mysqld, $extra_opts);
mtr_add_arg($args, "--server-arg=%s", $_) for @$mysqld_args;

if (IS_WINDOWS)
{
# Trick the server to send output to stderr, with --console
if (!(grep(/^--server-arg=--log-error/, @$args))) {
mtr_add_arg($args, "--server-arg=--console");
}
}
}

# ----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/encryption/r/innodb_encrypt_log.result
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ INSERT INTO t0 VALUES(NULL, 5, 5, 'public', 'gossip');
# ib_logfile0 expecting NOT FOUND
NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in ib_logfile0
# ib_logfile0 expecting FOUND
FOUND 3 /public|gossip/ in ib_logfile0
FOUND 1 /(public|gossip).*/ in ib_logfile0
# ibdata1 expecting NOT FOUND
NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)|public|gossip/ in ibdata1
# t0.ibd expecting NOT FOUND
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/encryption/t/innodb_encrypt_log.test
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ INSERT INTO t0 VALUES(NULL, 5, 5, 'public', 'gossip');
--echo # ib_logfile0 expecting NOT FOUND
-- let SEARCH_FILE=$MYSQLD_DATADIR/ib_logfile0
-- source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=public|gossip
--let SEARCH_PATTERN=(public|gossip).*
--echo # ib_logfile0 expecting FOUND
-- let SEARCH_FILE=$MYSQLD_DATADIR/ib_logfile0
-- source include/search_pattern_in_file.inc
Expand Down
149 changes: 149 additions & 0 deletions mysql-test/suite/innodb/r/alter_crash.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
#
# Bug#20015132 ALTER TABLE FAILS TO CHECK IF TABLE IS CORRUPTED
#
CREATE TABLE t1(c1 INT PRIMARY KEY, c2 CHAR(1), c3 INT UNSIGNED) ENGINE=InnoDB;
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET DEBUG_DBUG='+d,ib_create_table_fail_too_many_trx';
ALTER TABLE t1 ADD INDEX (c2), ADD INDEX (c3);
ERROR HY000: Too many active concurrent transactions
SET DEBUG_DBUG=@saved_debug_dbug;
ALTER TABLE t1 ADD INDEX (c2), ADD INDEX (c3);
SET DEBUG_DBUG='+d,dict_set_index_corrupted';
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check Warning InnoDB: Index c2 is marked as corrupted
test.t1 check Warning InnoDB: Index c3 is marked as corrupted
test.t1 check error Corrupt
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check Warning InnoDB: Index c2 is marked as corrupted
test.t1 check Warning InnoDB: Index c3 is marked as corrupted
test.t1 check error Corrupt
ALTER TABLE t1 DROP INDEX c2;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check Warning InnoDB: Index c3 is marked as corrupted
test.t1 check error Corrupt
ALTER TABLE t1 ADD INDEX (c2,c3);
ERROR HY000: Index c3 is corrupted
ALTER TABLE t1 CHANGE c3 c3 INT NOT NULL;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
ALTER TABLE t1 ADD INDEX (c2,c3);
DROP TABLE t1;
#
# Bug #14669848 CRASH DURING ALTER MAKES ORIGINAL TABLE INACCESSIBLE
#
# -- Scenario 1:
# Crash the server in ha_innobase::commit_inplace_alter_table()
# just after committing the dictionary changes.
CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
INSERT INTO t1 VALUES (1,2),(3,4);
SET DEBUG_DBUG='+d,innodb_alter_commit_crash_after_commit';
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
ERROR HY000: Lost connection to MySQL server during query
# Restart mysqld after the crash and reconnect.
# Manual *.frm recovery begin.
# Manual recovery end
FLUSH TABLES;
# Drop the orphaned original table.
# Files in datadir after manual recovery.
t1.frm
t1.ibd
SHOW TABLES;
Tables_in_test
t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` int(11) NOT NULL,
PRIMARY KEY (`f2`,`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (5,6),(7,8);
SELECT * FROM t1;
f1 f2
1 2
3 4
5 6
7 8
DROP TABLE t1;
CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=InnoDB;
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
DROP TABLE t1;
# -- Scenario 2:
# Crash the server in ha_innobase::commit_inplace_alter_table()
# just before committing the dictionary changes, but after
# writing the MLOG_FILE_RENAME records. As the mini-transaction
# is not committed, the renames will not be replayed.
CREATE TABLE t2 (f1 int not null, f2 int not null) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1,2),(3,4);
SET DEBUG_DBUG='+d,innodb_alter_commit_crash_before_commit';
ALTER TABLE t2 ADD PRIMARY KEY (f2, f1);
ERROR HY000: Lost connection to MySQL server during query
# Startup the server after the crash
# Read and remember the temporary table name
# Manual *.frm recovery begin. The dictionary was not updated
# and the files were not renamed. The rebuilt table
# was left behind on purpose, to faciliate data recovery.
# Manual recovery end
# Drop the orphaned rebuilt table.
SHOW TABLES;
Tables_in_test
t2
INSERT INTO t2 VALUES (5,6),(7,8);
SELECT * from t2;
f1 f2
1 2
3 4
5 6
7 8
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`f1` int(11) NOT NULL,
`f2` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=InnoDB;
ALTER TABLE t2 ADD PRIMARY KEY (f2, f1);
DROP TABLE t2;
# -------------------------
# End of Testing Scenario 2
# -------------------------
#
# Bug#19330255 WL#7142 - CRASH DURING ALTER TABLE LEADS TO
# DATA DICTIONARY INCONSISTENCY
#
CREATE TABLE t1(a int PRIMARY KEY, b varchar(255), c int NOT NULL)
ENGINE=InnoDB;
INSERT INTO t1 SET a=1,c=2;
SET DEBUG_DBUG='+d,innodb_alter_commit_crash_after_commit';
ALTER TABLE t1 ADD INDEX (b), CHANGE c d int, ALGORITHM=INPLACE;
ERROR HY000: Lost connection to MySQL server during query
# Restart mysqld after the crash and reconnect.
# Manual *.frm recovery begin.
# Manual recovery end
FLUSH TABLES;
# Drop the orphaned original table.
# Files in datadir after manual recovery.
t1.frm
t1.ibd
SHOW TABLES;
Tables_in_test
t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(255) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
UPDATE t1 SET d=NULL;
SELECT * FROM t1;
a b d
1 NULL NULL
DROP TABLE t1;
1 change: 1 addition & 0 deletions mysql-test/suite/innodb/t/alter_crash.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--loose-innodb-sys-tables
Loading

0 comments on commit fb14761

Please sign in to comment.