mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-29481 mariadb-upgrade prints confusing statement
This is a new version of the patch instead of the reverted: MDEV-28727 ALTER TABLE ALGORITHM=NOCOPY does not work after upgrade Ignore the difference in key packing flags HA_BINARY_PACK_KEY and HA_PACK_KEY during ALTER to allow ALGORITHM=INSTANT and ALGORITHM=NOCOPY in more cases. If for some reasons (e.g. due to a bug fix such as MDEV-20704) these cumulative (over all segments) flags in KEY::flags are different for the old and new table inside compare_keys_but_name(), the difference in HA_BINARY_PACK_KEY and HA_PACK_KEY in KEY::flags is not really important: MyISAM and Aria can handle such cases well: per-segment flags are stored in MYI and MAI files anyway and they are read during ha_myisam::open() ha_maria::open() time. So indexes get opened with correct per-segment flags that were calculated during the table CREATE time, no matter what the old (CREATE time) and new (ALTER TIME) per-index compression flags are, and no matter if they are equal or not. All other engine ignore key compression flags, so this change is safe for other engines as well.
This commit is contained in:
36
mysql-test/suite/innodb/r/alter_table_upgrade.result
Normal file
36
mysql-test/suite/innodb/r/alter_table_upgrade.result
Normal file
@ -0,0 +1,36 @@
|
||||
#
|
||||
# Start of 10.4 tests
|
||||
#
|
||||
#
|
||||
# MDEV-29481 mariadb-upgrade prints confusing statement
|
||||
#
|
||||
CREATE TABLE pet4 (
|
||||
build_time double(18,7) DEFAULT NULL,
|
||||
KEY idx1 (build_time)) ENGINE=InnoDB;
|
||||
FLUSH TABLES;
|
||||
SHOW CREATE TABLE pet4;
|
||||
Table Create Table
|
||||
pet4 CREATE TABLE `pet4` (
|
||||
`build_time` double(18,7) DEFAULT NULL,
|
||||
KEY `idx1` (`build_time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci
|
||||
CHECK TABLE pet4 FOR UPGRADE;
|
||||
Table Op Msg_type Msg_text
|
||||
test.pet4 check status OK
|
||||
ALTER TABLE pet4 ADD i1 INTEGER, ALGORITHM=INSTANT;
|
||||
DROP TABLE pet4;
|
||||
CREATE TABLE pet4 (
|
||||
build_time double(18,7) DEFAULT NULL,
|
||||
KEY idx1 (build_time)) ENGINE=InnoDB;
|
||||
FLUSH TABLES;
|
||||
SHOW CREATE TABLE pet4;
|
||||
Table Create Table
|
||||
pet4 CREATE TABLE `pet4` (
|
||||
`build_time` double(18,7) DEFAULT NULL,
|
||||
KEY `idx1` (`build_time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci
|
||||
ALTER TABLE pet4 ADD i1 INTEGER, ALGORITHM=NOCOPY;
|
||||
DROP TABLE pet4;
|
||||
#
|
||||
# End of 10.4 tests
|
||||
#
|
36
mysql-test/suite/innodb/t/alter_table_upgrade.test
Normal file
36
mysql-test/suite/innodb/t/alter_table_upgrade.test
Normal file
@ -0,0 +1,36 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
let $datadir=`select @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.4 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-29481 mariadb-upgrade prints confusing statement
|
||||
--echo #
|
||||
|
||||
CREATE TABLE pet4 (
|
||||
build_time double(18,7) DEFAULT NULL,
|
||||
KEY idx1 (build_time)) ENGINE=InnoDB;
|
||||
FLUSH TABLES;
|
||||
remove_file $datadir/test/pet4.frm;
|
||||
copy_file std_data/mysql_upgrade/mdev29481_100104_innodb.frm $datadir/test/pet4.frm;
|
||||
SHOW CREATE TABLE pet4;
|
||||
CHECK TABLE pet4 FOR UPGRADE;
|
||||
ALTER TABLE pet4 ADD i1 INTEGER, ALGORITHM=INSTANT;
|
||||
DROP TABLE pet4;
|
||||
|
||||
CREATE TABLE pet4 (
|
||||
build_time double(18,7) DEFAULT NULL,
|
||||
KEY idx1 (build_time)) ENGINE=InnoDB;
|
||||
FLUSH TABLES;
|
||||
remove_file $datadir/test/pet4.frm;
|
||||
copy_file std_data/mysql_upgrade/mdev29481_100104_innodb.frm $datadir/test/pet4.frm;
|
||||
SHOW CREATE TABLE pet4;
|
||||
ALTER TABLE pet4 ADD i1 INTEGER, ALGORITHM=NOCOPY;
|
||||
DROP TABLE pet4;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
Reference in New Issue
Block a user