mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Fix and test case for BUG#3899
mysql-test/r/alter_table.result: Test case for BUG#3899 mysql-test/t/alter_table.test: Test case for BUG#3899 sql/sql_yacc.yy: Fix for BUG#3899: call ALTER_INFO::reset to clear ALTER_INFO::drop_list and ALTER_INFO::alter_list
This commit is contained in:
parent
5adf6574bd
commit
91e27b0266
3 changed files with 15 additions and 1 deletions
|
@ -470,3 +470,9 @@ t1 CREATE TABLE `t1` (
|
|||
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||
ERROR 42000: Can't DROP 'PRIMARY'; check that column/key exists
|
||||
DROP TABLE t1;
|
||||
create table t1 (a int, b int, key(a));
|
||||
insert into t1 values (1,1), (2,2);
|
||||
alter table t1 drop key no_such_key;
|
||||
ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists
|
||||
alter table t1 drop key a;
|
||||
drop table t1;
|
||||
|
|
|
@ -304,3 +304,11 @@ SHOW CREATE TABLE t1;
|
|||
--error 1091
|
||||
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||
DROP TABLE t1;
|
||||
|
||||
# BUG#3899
|
||||
create table t1 (a int, b int, key(a));
|
||||
insert into t1 values (1,1), (2,2);
|
||||
--error 1091
|
||||
alter table t1 drop key no_such_key;
|
||||
alter table t1 drop key a;
|
||||
drop table t1;
|
||||
|
|
|
@ -1817,7 +1817,7 @@ alter:
|
|||
lex->create_info.db_type= DB_TYPE_DEFAULT;
|
||||
lex->create_info.default_table_charset= thd->variables.collation_database;
|
||||
lex->create_info.row_type= ROW_TYPE_NOT_USED;
|
||||
lex->alter_info.clear();
|
||||
lex->alter_info.reset();
|
||||
lex->alter_info.is_simple= 1;
|
||||
lex->alter_info.flags= 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue