mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 06:18:17 +00:00
Parse MySQL ALTER TABLE DROP FOREIGN KEY
syntax (#1762)
This commit is contained in:
parent
6ec5223f50
commit
1e54a34acd
4 changed files with 27 additions and 4 deletions
|
@ -2273,6 +2273,16 @@ fn parse_alter_table_drop_primary_key() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_alter_table_drop_foreign_key() {
|
||||
assert_matches!(
|
||||
alter_table_op(
|
||||
mysql_and_generic().verified_stmt("ALTER TABLE tab DROP FOREIGN KEY foo_ibfk_1")
|
||||
),
|
||||
AlterTableOperation::DropForeignKey { name } if name.value == "foo_ibfk_1"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_alter_table_change_column() {
|
||||
let expected_name = ObjectName::from(vec![Ident::new("orders")]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue