Commit c0f5fd27 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-27683 EXCHANGE PARTITION allows different index direction, but causes further errors

parent a450d58a
......@@ -1239,3 +1239,14 @@ DROP TABLE t1, t2;
#
# End of 10.3 tests
#
#
# MDEV-27683 EXCHANGE PARTITION allows different index direction, but causes further errors
#
CREATE TABLE t1 (a INT, KEY(a DESC)) PARTITION BY KEY(a) PARTITIONS 4;
CREATE TABLE t2 (a INT, KEY(a));
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Tables have different definitions
DROP TABLE t1, t2;
#
# End of 10.8 tests
#
......@@ -535,3 +535,16 @@ DROP TABLE t1, t2;
--echo #
--echo # End of 10.3 tests
--echo #
--echo #
--echo # MDEV-27683 EXCHANGE PARTITION allows different index direction, but causes further errors
--echo #
CREATE TABLE t1 (a INT, KEY(a DESC)) PARTITION BY KEY(a) PARTITIONS 4;
CREATE TABLE t2 (a INT, KEY(a));
--error ER_TABLES_DIFFERENT_METADATA
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
DROP TABLE t1, t2;
--echo #
--echo # End of 10.8 tests
--echo #
......@@ -7147,7 +7147,8 @@ bool mysql_compare_tables(TABLE *table, Alter_info *alter_info,
are equal. Comparing field numbers is sufficient.
*/
if ((table_part->length != new_part->length) ||
(table_part->fieldnr - 1 != new_part->fieldnr))
(table_part->fieldnr - 1 != new_part->fieldnr) ||
((table_part->key_part_flag ^ new_part->key_part_flag) & HA_REVERSE_SORT))
DBUG_RETURN(false);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment