mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
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
This commit is contained in:
parent
0540e50873
commit
d9c5eb2f33
3 changed files with 35 additions and 1 deletions
|
@ -458,3 +458,24 @@ BEGIN
|
||||||
SET IGNORED= a+b;
|
SET IGNORED= a+b;
|
||||||
END |
|
END |
|
||||||
ERROR HY000: Unknown system variable 'IGNORED'
|
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;
|
SET IGNORED= a+b;
|
||||||
END |
|
END |
|
||||||
DELIMITER ;|
|
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)))
|
if (unlikely(Lex->add_alter_list($4, $7, $3)))
|
||||||
MYSQL_YYABORT;
|
MYSQL_YYABORT;
|
||||||
}
|
}
|
||||||
| ALTER INDEX_SYM ident ignorability
|
| ALTER key_or_index ident ignorability
|
||||||
{
|
{
|
||||||
LEX *lex= Lex;
|
LEX *lex= Lex;
|
||||||
Alter_index_ignorability *ac= new (thd->mem_root)
|
Alter_index_ignorability *ac= new (thd->mem_root)
|
||||||
|
|
Loading…
Add table
Reference in a new issue