summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-06-27 16:51:27 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-06-27 16:51:27 +0300
commit20cf63fe8bc049db548f3a8ae4172db77f24bd4b (patch)
tree693c776847a9281166c570813e7eec582ce222c0
parent39f45f6f89ce2fc2db54bb8ab0f6076f923beeec (diff)
parent773f1dad94add6db4d61bcbc66398fd61be33149 (diff)
downloadmariadb-git-20cf63fe8bc049db548f3a8ae4172db77f24bd4b.tar.gz
Merge 10.5 into 10.6
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_upgrade.result9
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_upgrade.test16
-rw-r--r--storage/innobase/buf/buf0buf.cc5
-rw-r--r--storage/innobase/handler/handler0alter.cc2
4 files changed, 31 insertions, 1 deletions
diff --git a/mysql-test/suite/innodb/r/instant_alter_upgrade.result b/mysql-test/suite/innodb/r/instant_alter_upgrade.result
new file mode 100644
index 00000000000..fc7d28963ca
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter_upgrade.result
@@ -0,0 +1,9 @@
+#
+# MDEV-26577 InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)
+# during ADD COLUMN
+#
+CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB;
+FLUSH TABLES;
+ALTER TABLE t2 ADD COLUMN b INT;
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/innodb/t/instant_alter_upgrade.test b/mysql-test/suite/innodb/t/instant_alter_upgrade.test
new file mode 100644
index 00000000000..d73fe187a72
--- /dev/null
+++ b/mysql-test/suite/innodb/t/instant_alter_upgrade.test
@@ -0,0 +1,16 @@
+--source include/have_innodb.inc
+--source include/innodb_row_format.inc
+
+--echo #
+--echo # MDEV-26577 InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)
+--echo # during ADD COLUMN
+--echo #
+
+CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB;
+FLUSH TABLES;
+--let $datadir=`select @@datadir`
+--remove_file $datadir/test/t2.frm
+--copy_file $datadir/test/t1.frm $datadir/test/t2.frm
+ALTER TABLE t2 ADD COLUMN b INT;
+DROP TABLE t1,t2;
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 19ef42aceaf..967e82b90a8 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -792,10 +792,13 @@ buf_madvise_do_dump()
}
#endif
+#ifndef UNIV_DEBUG
static inline byte hex_to_ascii(byte hex_digit)
{
- return hex_digit <= 9 ? '0' + hex_digit : ('a' - 10) + hex_digit;
+ const int offset= hex_digit <= 9 ? '0' : 'a' - 10;
+ return byte(hex_digit + offset);
}
+#endif
/** Dump a page to stderr.
@param[in] read_buf database page
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 4a8861dd5dc..828af7cc24a 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -6228,8 +6228,10 @@ prepare_inplace_alter_table_dict(
/* If we promised ALGORITHM=NOCOPY or ALGORITHM=INSTANT,
we must retain the original ROW_FORMAT of the table. */
flags = (user_table->flags & (DICT_TF_MASK_COMPACT
+ | DICT_TF_MASK_ZIP_SSIZE
| DICT_TF_MASK_ATOMIC_BLOBS))
| (flags & ~(DICT_TF_MASK_COMPACT
+ | DICT_TF_MASK_ZIP_SSIZE
| DICT_TF_MASK_ATOMIC_BLOBS));
}