Commit 135f203d authored by Alexander Barkov's avatar Alexander Barkov

A cleanup for the contributed patch for

MDEV-7816 ALTER with DROP INDEX and ADD INDEX .. COMMENT='comment2' ignores the new comment
parent 23e90e9a
...@@ -2007,6 +2007,12 @@ INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8); ...@@ -2007,6 +2007,12 @@ INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e; INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e;
ALTER TABLE t1 MODIFY i FLOAT; ALTER TABLE t1 MODIFY i FLOAT;
DROP TABLE t1; DROP TABLE t1;
#
# Start of 10.1 tests
#
#
# MDEV-7816 ALTER with DROP INDEX and ADD INDEX .. COMMENT='comment2' ignores the new comment
#
CREATE TABLE t1(a INT); CREATE TABLE t1(a INT);
CREATE INDEX i1 ON t1(a) COMMENT 'comment1'; CREATE INDEX i1 ON t1(a) COMMENT 'comment1';
ALTER TABLE t1 DROP INDEX i1, ADD INDEX i1(a) COMMENT 'comment2'; ALTER TABLE t1 DROP INDEX i1, ADD INDEX i1(a) COMMENT 'comment2';
...@@ -2017,3 +2023,6 @@ t1 CREATE TABLE `t1` ( ...@@ -2017,3 +2023,6 @@ t1 CREATE TABLE `t1` (
KEY `i1` (`a`) COMMENT 'comment2' KEY `i1` (`a`) COMMENT 'comment2'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1; DROP TABLE t1;
#
# Start of 10.1 tests
#
...@@ -1697,11 +1697,19 @@ INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e; ...@@ -1697,11 +1697,19 @@ INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e;
ALTER TABLE t1 MODIFY i FLOAT; ALTER TABLE t1 MODIFY i FLOAT;
DROP TABLE t1; DROP TABLE t1;
# --echo #
# MDEV-7816 ALTER with DROP INDEX and ADD INDEX .. COMMENT='comment2' ignores the new comment --echo # Start of 10.1 tests
# --echo #
--echo #
--echo # MDEV-7816 ALTER with DROP INDEX and ADD INDEX .. COMMENT='comment2' ignores the new comment
--echo #
CREATE TABLE t1(a INT); CREATE TABLE t1(a INT);
CREATE INDEX i1 ON t1(a) COMMENT 'comment1'; CREATE INDEX i1 ON t1(a) COMMENT 'comment1';
ALTER TABLE t1 DROP INDEX i1, ADD INDEX i1(a) COMMENT 'comment2'; ALTER TABLE t1 DROP INDEX i1, ADD INDEX i1(a) COMMENT 'comment2';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # Start of 10.1 tests
--echo #
...@@ -6387,7 +6387,8 @@ static bool fill_alter_inplace_info(THD *thd, ...@@ -6387,7 +6387,8 @@ static bool fill_alter_inplace_info(THD *thd,
/* Check that key comment is not changed. */ /* Check that key comment is not changed. */
if (table_key->comment.length != new_key->comment.length || if (table_key->comment.length != new_key->comment.length ||
(table_key->comment.length && (table_key->comment.length &&
strcmp(table_key->comment.str, new_key->comment.str) != 0)) memcmp(table_key->comment.str, new_key->comment.str,
table_key->comment.length) != 0))
goto index_changed; goto index_changed;
continue; continue;
......
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