@@ -4028,19 +4028,17 @@ fn parse_alter_table() {
40284028
40294029#[ test]
40304030fn parse_rename_table ( ) {
4031- let dialects = all_dialects_where ( |d| d. supports_rename_table ( ) ) ;
4032-
4033- match dialects. verified_stmt ( "RENAME TABLE `test`.`test1` TO `test_db`.`test2`" ) {
4031+ match verified_stmt ( "RENAME TABLE test.test1 TO test_db.test2" ) {
40344032 Statement :: RenameTable ( rename_object_defs) => {
40354033 assert_eq ! (
4036- vec![ RenameObjectDef {
4034+ vec![ RenameTable {
40374035 old_name: ObjectName ( vec![
4038- Ident :: with_quote ( '`' , "test" . to_string( ) ) ,
4039- Ident :: with_quote ( '`' , "test1" . to_string( ) ) ,
4036+ Ident :: new ( "test" . to_string( ) ) ,
4037+ Ident :: new ( "test1" . to_string( ) ) ,
40404038 ] ) ,
40414039 new_name: ObjectName ( vec![
4042- Ident :: with_quote ( '`' , "test_db" . to_string( ) ) ,
4043- Ident :: with_quote ( '`' , "test2" . to_string( ) ) ,
4040+ Ident :: new ( "test_db" . to_string( ) ) ,
4041+ Ident :: new ( "test2" . to_string( ) ) ,
40444042 ] ) ,
40454043 } ] ,
40464044 rename_object_defs
@@ -4049,21 +4047,21 @@ fn parse_rename_table() {
40494047 _ => unreachable ! ( ) ,
40504048 } ;
40514049
4052- match dialects . verified_stmt (
4050+ match verified_stmt (
40534051 "RENAME TABLE old_table1 TO new_table1, old_table2 TO new_table2, old_table3 TO new_table3" ,
40544052 ) {
40554053 Statement :: RenameTable ( rename_object_defs) => {
40564054 assert_eq ! (
40574055 vec![
4058- RenameObjectDef {
4056+ RenameTable {
40594057 old_name: ObjectName ( vec![ Ident :: new( "old_table1" . to_string( ) ) ] ) ,
40604058 new_name: ObjectName ( vec![ Ident :: new( "new_table1" . to_string( ) ) ] ) ,
40614059 } ,
4062- RenameObjectDef {
4060+ RenameTable {
40634061 old_name: ObjectName ( vec![ Ident :: new( "old_table2" . to_string( ) ) ] ) ,
40644062 new_name: ObjectName ( vec![ Ident :: new( "new_table2" . to_string( ) ) ] ) ,
40654063 } ,
4066- RenameObjectDef {
4064+ RenameTable {
40674065 old_name: ObjectName ( vec![ Ident :: new( "old_table3" . to_string( ) ) ] ) ,
40684066 new_name: ObjectName ( vec![ Ident :: new( "new_table3" . to_string( ) ) ] ) ,
40694067 }
@@ -4075,31 +4073,16 @@ fn parse_rename_table() {
40754073 } ;
40764074
40774075 assert_eq ! (
4078- dialects
4079- . parse_sql_statements( "RENAME TABLE `old_table` TO new_table a" )
4080- . unwrap_err( ) ,
4076+ parse_sql_statements( "RENAME TABLE old_table TO new_table a" ) . unwrap_err( ) ,
40814077 ParserError :: ParserError ( "Expected: end of statement, found: a" . to_string( ) )
40824078 ) ;
40834079
40844080 assert_eq ! (
4085- dialects
4086- . parse_sql_statements( "RENAME TABLE1 `old_table` TO new_table a" )
4087- . unwrap_err( ) ,
4081+ parse_sql_statements( "RENAME TABLE1 old_table TO new_table a" ) . unwrap_err( ) ,
40884082 ParserError :: ParserError (
40894083 "Expected: KEYWORD `TABLE` after RENAME, found: TABLE1" . to_string( )
40904084 )
40914085 ) ;
4092-
4093- let dialects = all_dialects_where ( |d| !d. supports_rename_table ( ) ) ;
4094-
4095- assert_eq ! (
4096- dialects
4097- . parse_sql_statements( "RENAME TABLE `old_table` TO new_table" )
4098- . unwrap_err( ) ,
4099- ParserError :: ParserError (
4100- "Expected: KEYWORD `TABLE` after RENAME, found: TABLE" . to_string( )
4101- )
4102- ) ;
41034086}
41044087
41054088#[ test]
0 commit comments