Support ALTER TABLE DROP PRIMARY KEY (#682)

* parse alter table drop primary key

* cargo nightly fmt

* add Dialect validation
This commit is contained in:
ding-young 2022-11-02 23:15:33 +09:00 committed by GitHub
parent 1b3778e2d5
commit 27c3ec87db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 0 deletions

View file

@ -875,6 +875,19 @@ fn parse_update_with_joins() {
}
}
#[test]
fn parse_alter_table_drop_primary_key() {
match mysql_and_generic().verified_stmt("ALTER TABLE tab DROP PRIMARY KEY") {
Statement::AlterTable {
name,
operation: AlterTableOperation::DropPrimaryKey,
} => {
assert_eq!("tab", name.to_string());
}
_ => unreachable!(),
}
}
#[test]
fn parse_alter_table_change_column() {
let expected_name = ObjectName(vec![Ident::new("orders")]);