diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-09-27 16:01:55 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-09-27 16:01:55 +0300 |
commit | ea2b19dee6a6ed69faffa368c9b1ce9338556299 (patch) | |
tree | b3cd6139c4c7f70171a26c2bdaaa7016a2eab041 /mysql-test/suite/innodb/r | |
parent | 1f4ee3fa5a80e9715b0dc77b72fabb95a4045745 (diff) | |
download | mariadb-git-ea2b19dee6a6ed69faffa368c9b1ce9338556299.tar.gz |
MDEV-20117: Fix another scenario
Thanks to Eugene Kosov for noting that the fix is incomplete.
It turns out that on instant DROP/reorder column (MDEV-15562),
we must always write the metadata record, even though the table
was empty. Alternatively, we should guarantee that all undo
log records for the table have been purged. (Attempting to do
that by updating table_id leads to other problems; see
commit 1b31d8852c00b4bab6e6fe179b97db45ccb8d535.)
It would be tempting to remove dict_index_t::clear_instant_alter()
altogether, but it turns that we need that when the instant ALTER TABLE
operation of a first-time DROP COLUMN is being rolled back.
innobase_instant_try(): Clarify a comment. Purge never calls
dict_index_t::clear_instant_alter(), but it may invoke
dict_index_t::clear_instant_add(). On first-time instant DROP/reorder,
always write a metadata record, even if the table is empty.
Diffstat (limited to 'mysql-test/suite/innodb/r')
-rw-r--r-- | mysql-test/suite/innodb/r/instant_alter_bugs.result | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result index c630432585a..661db48099d 100644 --- a/mysql-test/suite/innodb/r/instant_alter_bugs.result +++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result @@ -1,3 +1,5 @@ +SET @save_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency; +SET GLOBAL innodb_purge_rseg_truncate_frequency=1; # # MDEV-17821 Assertion `!page_rec_is_supremum(rec)' failed # in btr_pcur_store_position @@ -295,3 +297,16 @@ ALTER TABLE t DROP COLUMN c, ALGORITHM=INSTANT; SELECT * FROM t; a b DROP TABLE t; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c INT, d INT, e INT) ENGINE=InnoDB; +INSERT INTO t1 SET a=1; +INSERT INTO t1 SET a=2; +BEGIN; +UPDATE t1 SET b=1; +DELETE FROM t1; +COMMIT; +ALTER TABLE t1 DROP b, DROP c, DROP d, DROP e; +InnoDB 0 transactions not purged +SELECT * FROM t1; +a +DROP TABLE t1; +SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency; |