File tree 3 files changed +9
-6
lines changed 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -675,7 +675,11 @@ impl fmt::Display for Statement {
675
675
f,
676
676
"CREATE{}INDEX{}{} ON {}({}" ,
677
677
if * if_unique { " UNIQUE " } else { " " } ,
678
- if * if_not_exists { " IF NOT EXISTS " } else { " " } ,
678
+ if * if_not_exists {
679
+ " IF NOT EXISTS "
680
+ } else {
681
+ " "
682
+ } ,
679
683
name,
680
684
table_name,
681
685
display_separated( columns, "," )
Original file line number Diff line number Diff line change @@ -855,7 +855,7 @@ impl Parser {
855
855
pub fn parse_create ( & mut self ) -> Result < Statement , ParserError > {
856
856
if self . parse_keyword ( "TABLE" ) {
857
857
self . parse_create_table ( )
858
- } else if self . parse_keyword ( "INDEX" ) {
858
+ } else if self . parse_keyword ( "INDEX" ) {
859
859
self . parse_create_index ( false )
860
860
} else if self . parse_keywords ( vec ! [ "UNIQUE" , "INDEX" ] ) {
861
861
self . parse_create_index ( true )
Original file line number Diff line number Diff line change @@ -2635,14 +2635,14 @@ fn ensure_multiple_dialects_are_tested() {
2635
2635
fn parse_create_index ( ) {
2636
2636
let sql = "CREATE UNIQUE INDEX IF NOT EXISTS idx_name ON test(name);" ;
2637
2637
let ident_vec = vec ! [ Ident :: new( "name" ) ] ;
2638
- let vec : Vec < ObjectName > = vec ! [ ObjectName ( ident_vec) ] ;
2638
+ let vec: Vec < ObjectName > = vec ! [ ObjectName ( ident_vec) ] ;
2639
2639
match verified_stmt ( sql) {
2640
- Statement :: CreateIndex {
2640
+ Statement :: CreateIndex {
2641
2641
name,
2642
2642
table_name,
2643
2643
columns,
2644
2644
if_unique,
2645
- if_not_exists
2645
+ if_not_exists,
2646
2646
} => {
2647
2647
assert_eq ! ( "idx_name" , name. to_string( ) ) ;
2648
2648
assert_eq ! ( "test" , table_name. to_string( ) ) ;
@@ -2670,7 +2670,6 @@ fn parse_drop_index() {
2670
2670
}
2671
2671
}
2672
2672
2673
-
2674
2673
fn parse_sql_statements ( sql : & str ) -> Result < Vec < Statement > , ParserError > {
2675
2674
all_dialects ( ) . parse_sql_statements ( sql)
2676
2675
}
You can’t perform that action at this time.
0 commit comments