Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS-7865 Dropping a table with discarded tablespace crashes the server #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions mysql-test/suite/innodb/r/discard_tablespace.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
#
# PS-7865: Dropping a table with discarded tablespace crashes the server
#
CREATE TABLE t1(a INT)ENGINE=innodb;
INSERT INTO t1 VALUES (10);
SELECT * FROM t1 INTO OUTFILE 'tmp1.txt';
LOAD DATA INFILE 'tmp1.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp2.txt';
LOAD DATA INFILE 'tmp2.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp3.txt';
LOAD DATA INFILE 'tmp3.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp4.txt';
LOAD DATA INFILE 'tmp4.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp5.txt';
LOAD DATA INFILE 'tmp5.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp6.txt';
LOAD DATA INFILE 'tmp6.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp7.txt';
LOAD DATA INFILE 'tmp7.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp8.txt';
LOAD DATA INFILE 'tmp8.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp9.txt';
LOAD DATA INFILE 'tmp9.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp10.txt';
LOAD DATA INFILE 'tmp10.txt' INTO TABLE t1;
ALTER TABLE t1 DISCARD TABLESPACE;
DROP TABLE t1;
#
# Bug #29793800 ASSERT AFTER DISCARD TABLESPACE, RENAME TABLE AND
# CREATE TABLE USING SAME NAME.
#
Expand Down
28 changes: 28 additions & 0 deletions mysql-test/suite/innodb/t/discard_tablespace.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
--echo #
--echo # PS-7865: Dropping a table with discarded tablespace crashes the server
--echo #

CREATE TABLE t1(a INT)ENGINE=innodb;
INSERT INTO t1 VALUES (10);
SELECT * FROM t1 INTO OUTFILE 'tmp1.txt';
LOAD DATA INFILE 'tmp1.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp2.txt';
LOAD DATA INFILE 'tmp2.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp3.txt';
LOAD DATA INFILE 'tmp3.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp4.txt';
LOAD DATA INFILE 'tmp4.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp5.txt';
LOAD DATA INFILE 'tmp5.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp6.txt';
LOAD DATA INFILE 'tmp6.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp7.txt';
LOAD DATA INFILE 'tmp7.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp8.txt';
LOAD DATA INFILE 'tmp8.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp9.txt';
LOAD DATA INFILE 'tmp9.txt' INTO TABLE t1;
SELECT * FROM t1 INTO OUTFILE 'tmp10.txt';
LOAD DATA INFILE 'tmp10.txt' INTO TABLE t1;
ALTER TABLE t1 DISCARD TABLESPACE;
DROP TABLE t1;

--echo #
--echo # Bug #29793800 ASSERT AFTER DISCARD TABLESPACE, RENAME TABLE AND
Expand Down
3 changes: 2 additions & 1 deletion storage/innobase/btr/btr0sea.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,8 @@ void btr_search_drop_page_hash_index(buf_block_t *block) {
ut_ad(!index->disable_ahi);
ut_ad(btr_search_enabled);

ut_ad(block->page.id.space() == index->space);
ut_ad(index->space == FIL_NULL ||
block->page.id.space() == index->space);
ut_a(index_id == index->id);
ut_a(!dict_index_is_ibuf(index));
#ifdef UNIV_DEBUG
Expand Down