Commit d9c5eb2f authored by Varun Gupta's avatar Varun Gupta Committed by Sergei Petrunia

MDEV-25078: ALTER INDEX is inconsistent with ADD/DROP/RENAME index

Allowing ALTER KEY syntax in ALTER TABLE,so one can use:

ALTER TABLE tbl ALTER INDEX index_name IGNORED
ALTER TABLE tbl ALTER KEY index_name IGNORED
parent 0540e508
......@@ -458,3 +458,24 @@ BEGIN
SET IGNORED= a+b;
END |
ERROR HY000: Unknown system variable 'IGNORED'
#
# ALLOWING ALTER KEY syntax in ALTER TABLE
#
CREATE TABLE t1 (a INT, KEY (a));
ALTER TABLE t1 ALTER INDEX a IGNORED;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
KEY `a` (`a`) IGNORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a INT, KEY (a));
ALTER TABLE t1 ALTER KEY a IGNORED;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
KEY `a` (`a`) IGNORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
......@@ -429,3 +429,16 @@ BEGIN
SET IGNORED= a+b;
END |
DELIMITER ;|
--echo #
--echo # ALLOWING ALTER KEY syntax in ALTER TABLE
--echo #
CREATE TABLE t1 (a INT, KEY (a));
ALTER TABLE t1 ALTER INDEX a IGNORED;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a INT, KEY (a));
ALTER TABLE t1 ALTER KEY a IGNORED;
SHOW CREATE TABLE t1;
DROP TABLE t1;
......@@ -7794,7 +7794,7 @@ alter_list_item:
if (unlikely(Lex->add_alter_list($4, $7, $3)))
MYSQL_YYABORT;
}
| ALTER INDEX_SYM ident ignorability
| ALTER key_or_index ident ignorability
{
LEX *lex= Lex;
Alter_index_ignorability *ac= new (thd->mem_root)
......
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