mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-08 01:15:00 +00:00
Parse ALTER TABLE AUTO_INCREMENT operation for MySQL (#1748)
This commit is contained in:
parent
5b3500139a
commit
c2914f82e1
4 changed files with 36 additions and 0 deletions
|
@ -2470,6 +2470,19 @@ fn parse_alter_table_with_algorithm() {
|
|||
mysql_and_generic().verified_stmt("ALTER TABLE `users` ALGORITHM = COPY");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_alter_table_auto_increment() {
|
||||
let sql = "ALTER TABLE tab AUTO_INCREMENT = 42";
|
||||
let expected_operation = AlterTableOperation::AutoIncrement {
|
||||
equals: true,
|
||||
value: number("42").with_empty_span(),
|
||||
};
|
||||
let operation = alter_table_op(mysql().verified_stmt(sql));
|
||||
assert_eq!(expected_operation, operation);
|
||||
|
||||
mysql_and_generic().verified_stmt("ALTER TABLE `users` AUTO_INCREMENT 42");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_alter_table_modify_column_with_column_position() {
|
||||
let expected_name = ObjectName::from(vec![Ident::new("orders")]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue