Skip to content
Permalink
Browse files
Merge 10.3 into 10.4
  • Loading branch information
dr-m committed Sep 22, 2020
2 parents 98f03e5 + fde3d89 commit 55e48b7
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 18 deletions.
@@ -1,5 +1,4 @@
SET @save_threads = @@GLOBAL.innodb_encryption_threads;
SET @save_tables = @@GLOBAL.innodb_encrypt_tables;
SET default_storage_engine = InnoDB;
SET GLOBAL innodb_encryption_threads = 4;
CREATE TABLE `table10_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
@@ -18,4 +17,3 @@ connection default;
drop table create_or_replace_t, table1_int_autoinc, table0_int_autoinc,
table10_int_autoinc;
SET GLOBAL innodb_encryption_threads = @save_threads;
SET GLOBAL innodb_encrypt_tables = @save_tables;
@@ -0,0 +1 @@
--innodb-encrypt-tables
@@ -3,7 +3,6 @@
--source include/count_sessions.inc

SET @save_threads = @@GLOBAL.innodb_encryption_threads;
SET @save_tables = @@GLOBAL.innodb_encrypt_tables;

SET default_storage_engine = InnoDB;

@@ -76,5 +75,4 @@ drop table create_or_replace_t, table1_int_autoinc, table0_int_autoinc,
table10_int_autoinc;

SET GLOBAL innodb_encryption_threads = @save_threads;
SET GLOBAL innodb_encrypt_tables = @save_tables;
--source include/wait_until_count_sessions.inc
@@ -60,6 +60,16 @@ CREATE TABLE t1(a INT NOT NULL UNIQUE) ENGINE=InnoDB;
INSERT INTO t1 SELECT * FROM seq_1_to_128;
ALTER TABLE t1 ADD b TINYINT AUTO_INCREMENT PRIMARY KEY, DROP KEY a;
DROP TABLE t1;
#
# MDEV-22939 Server crashes in row_make_new_pathname()
#
CREATE TABLE t (a INT) ENGINE=INNODB;
ALTER TABLE t DISCARD TABLESPACE;
ALTER TABLE t ENGINE INNODB;
ERROR HY000: Tablespace has been discarded for table `t`
ALTER TABLE t FORCE;
ERROR HY000: Tablespace has been discarded for table `t`
DROP TABLE t;
create table t1 (a int) transactional=1 engine=aria;
create table t2 (a int) transactional=1 engine=innodb;
show create table t1;
@@ -39,3 +39,14 @@ TRUNCATE t1;
SELECT * FROM t1;
a
DROP TEMPORARY TABLE t1;
#
# MDEV-23705 Assertion 'table->data_dir_path || !space'
#
CREATE TABLE t(c INT) ENGINE=InnoDB;
ALTER TABLE t DISCARD TABLESPACE;
RENAME TABLE t TO u;
TRUNCATE u;
Warnings:
Warning 1814 Tablespace has been discarded for table `u`
TRUNCATE u;
DROP TABLE u;
@@ -69,6 +69,17 @@ INSERT INTO t1 SELECT * FROM seq_1_to_128;
ALTER TABLE t1 ADD b TINYINT AUTO_INCREMENT PRIMARY KEY, DROP KEY a;
DROP TABLE t1;

--echo #
--echo # MDEV-22939 Server crashes in row_make_new_pathname()
--echo #
CREATE TABLE t (a INT) ENGINE=INNODB;
ALTER TABLE t DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
ALTER TABLE t ENGINE INNODB;
--error ER_TABLESPACE_DISCARDED
ALTER TABLE t FORCE;
DROP TABLE t;

#
# Check that innodb supports transactional=1
#
@@ -50,3 +50,13 @@ INSERT INTO t1 VALUES(1);
TRUNCATE t1;
SELECT * FROM t1;
DROP TEMPORARY TABLE t1;

--echo #
--echo # MDEV-23705 Assertion 'table->data_dir_path || !space'
--echo #
CREATE TABLE t(c INT) ENGINE=InnoDB;
ALTER TABLE t DISCARD TABLESPACE;
RENAME TABLE t TO u;
TRUNCATE u;
TRUNCATE u;
DROP TABLE u;
@@ -2638,7 +2638,7 @@ static const char* dict_load_table_low(const table_name_t& name,
name.m_name, NULL, n_cols + n_v_col, n_v_col, flags, flags2);
(*table)->space_id = space_id;
(*table)->id = table_id;
(*table)->file_unreadable = false;
(*table)->file_unreadable = !!(flags2 & DICT_TF2_DISCARDED);

return(NULL);
}
@@ -2692,20 +2692,14 @@ dict_get_and_save_data_dir_path(
ut_ad(!table->is_temporary());
ut_ad(!table->space || table->space->id == table->space_id);

if (!table->data_dir_path && table->space_id) {
if (!table->data_dir_path && table->space_id && table->space) {
if (!dict_mutex_own) {
dict_mutex_enter_for_mysql();
}

if (const char* p = table->space
? table->space->chain.start->name : NULL) {
table->flags |= (1 << DICT_TF_POS_DATA_DIR);
dict_save_data_dir_path(table, p);
} else if (char* path = dict_get_first_path(table->space_id)) {
table->flags |= (1 << DICT_TF_POS_DATA_DIR);
dict_save_data_dir_path(table, path);
ut_free(path);
}
table->flags |= (1 << DICT_TF_POS_DATA_DIR);
dict_save_data_dir_path(table,
table->space->chain.start->name);

if (table->data_dir_path == NULL) {
/* Since we did not set the table data_dir_path,
@@ -11008,9 +11008,14 @@ ha_innobase::commit_inplace_alter_table(
= static_cast<ha_innobase_inplace_ctx*>(*pctx);

DBUG_ASSERT(new_clustered == ctx->need_rebuild());

fail = commit_set_autoinc(ha_alter_info, ctx, altered_table,
table);
if (ctx->need_rebuild() && !ctx->old_table->space) {
my_error(ER_TABLESPACE_DISCARDED, MYF(0),
table->s->table_name.str);
fail = true;
} else {
fail = commit_set_autoinc(ha_alter_info, ctx,
altered_table, table);
}

if (fail) {
} else if (ctx->need_rebuild()) {

0 comments on commit 55e48b7

Please sign in to comment.