mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-16 04:54:59 +00:00
create table: add clone syntax (#542)
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
This commit is contained in:
parent
c2ccc80c28
commit
5363d4e399
4 changed files with 30 additions and 1 deletions
|
@ -1992,6 +1992,18 @@ fn parse_create_table_with_options() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_create_table_clone() {
|
||||
let sql = "CREATE OR REPLACE TABLE a CLONE a_tmp";
|
||||
match verified_stmt(sql) {
|
||||
Statement::CreateTable { name, clone, .. } => {
|
||||
assert_eq!(ObjectName(vec![Ident::new("a")]), name);
|
||||
assert_eq!(Some(ObjectName(vec![(Ident::new("a_tmp"))])), clone)
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_create_table_trailing_comma() {
|
||||
let sql = "CREATE TABLE foo (bar int,)";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue