Skip to content

Commit

Permalink
MDEV-22627 fixup: Cover also ALTER TABLE...ALGORITHM=INPLACE
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Oct 20, 2021
1 parent 69b3de8 commit 05c3dce
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mysql-test/suite/innodb/r/default_row_format_create.result
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,12 @@ DROP TABLE IF EXISTS t;
SET GLOBAL innodb_compression_level=1;
CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1;
DROP TABLE IF EXISTS t;
SET GLOBAL innodb_compression_level=1;
CREATE TABLE t(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1;
SET GLOBAL innodb_compression_level=0;
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=INPLACE;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSED'
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=COPY;
ERROR HY000: Can't create table `test`.`t` (errno: 140 "Wrong create options")
DROP TABLE t;
SET GLOBAL innodb_compression_level=@save_level;
9 changes: 9 additions & 0 deletions mysql-test/suite/innodb/t/default_row_format_create.test
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,13 @@ SET GLOBAL innodb_compression_level=1;
CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1;
DROP TABLE IF EXISTS t;
--enable_warnings

SET GLOBAL innodb_compression_level=1;
CREATE TABLE t(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1;
SET GLOBAL innodb_compression_level=0;
--error ER_ILLEGAL_HA_CREATE_OPTION
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=INPLACE;
--error ER_CANT_CREATE_TABLE
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=COPY;
DROP TABLE t;
SET GLOBAL innodb_compression_level=@save_level;
2 changes: 2 additions & 0 deletions storage/innobase/handler/handler0alter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5584,6 +5584,8 @@ ha_innobase::prepare_inplace_alter_table(
}

if (!info.innobase_table_flags()) {
my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
table_type(), "PAGE_COMPRESSED");
goto err_exit_no_heap;
}

Expand Down

0 comments on commit 05c3dce

Please sign in to comment.