summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-10-20 22:16:23 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-10-20 22:16:23 +0300
commit05c3dced8611542df7eae686ab9d28147f0dbe05 (patch)
tree34cfdd873e34113a200f29c184b2607c3d81c99e
parent69b3de830d531e5cbc57c1a43c7bd55b31f7197e (diff)
downloadmariadb-git-05c3dced8611542df7eae686ab9d28147f0dbe05.tar.gz
MDEV-22627 fixup: Cover also ALTER TABLE...ALGORITHM=INPLACE
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_create.result8
-rw-r--r--mysql-test/suite/innodb/t/default_row_format_create.test9
-rw-r--r--storage/innobase/handler/handler0alter.cc2
3 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/default_row_format_create.result b/mysql-test/suite/innodb/r/default_row_format_create.result
index d85fed35d92..0dfcbd80e88 100644
--- a/mysql-test/suite/innodb/r/default_row_format_create.result
+++ b/mysql-test/suite/innodb/r/default_row_format_create.result
@@ -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;
diff --git a/mysql-test/suite/innodb/t/default_row_format_create.test b/mysql-test/suite/innodb/t/default_row_format_create.test
index a1c6ff0d588..534a7312620 100644
--- a/mysql-test/suite/innodb/t/default_row_format_create.test
+++ b/mysql-test/suite/innodb/t/default_row_format_create.test
@@ -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;
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 2dd88e50c07..1bbe99ee34d 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -5584,6 +5584,8 @@ check_if_ok_to_rename:
}
if (!info.innobase_table_flags()) {
+ my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
+ table_type(), "PAGE_COMPRESSED");
goto err_exit_no_heap;
}