@@ -975,81 +975,6 @@ pub struct TableFunctionArgs {
975975 pub settings : Option < Vec < Setting > > ,
976976}
977977
978- #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
979- #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
980- #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
981- pub enum TableIndexHintType {
982- Use ,
983- Ignore ,
984- Force ,
985- }
986-
987- impl fmt:: Display for TableIndexHintType {
988- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
989- f. write_str ( match self {
990- TableIndexHintType :: Use => "USE" ,
991- TableIndexHintType :: Ignore => "IGNORE" ,
992- TableIndexHintType :: Force => "FORCE" ,
993- } )
994- }
995- }
996-
997- #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
998- #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
999- #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
1000- pub enum TableIndexType {
1001- Index ,
1002- Key ,
1003- }
1004-
1005- impl fmt:: Display for TableIndexType {
1006- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1007- f. write_str ( match self {
1008- TableIndexType :: Index => "INDEX" ,
1009- TableIndexType :: Key => "KEY" ,
1010- } )
1011- }
1012- }
1013-
1014- #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
1015- #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
1016- #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
1017- pub enum TableIndexHintForClause {
1018- Join ,
1019- OrderBy ,
1020- GroupBy ,
1021- }
1022-
1023- impl fmt:: Display for TableIndexHintForClause {
1024- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1025- f. write_str ( match self {
1026- TableIndexHintForClause :: Join => "JOIN" ,
1027- TableIndexHintForClause :: OrderBy => "ORDER BY" ,
1028- TableIndexHintForClause :: GroupBy => "GROUP BY" ,
1029- } )
1030- }
1031- }
1032-
1033- #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
1034- #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
1035- #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
1036- pub struct TableIndexHints {
1037- pub hint_type : TableIndexHintType ,
1038- pub index_type : TableIndexType ,
1039- pub for_clause : Option < TableIndexHintForClause > ,
1040- pub index_names : Vec < Ident > ,
1041- }
1042-
1043- impl fmt:: Display for TableIndexHints {
1044- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1045- write ! ( f, "{} {} " , self . hint_type, self . index_type) ?;
1046- if let Some ( for_clause) = & self . for_clause {
1047- write ! ( f, "FOR {} " , for_clause) ?;
1048- }
1049- write ! ( f, "({})" , display_comma_separated( & self . index_names) )
1050- }
1051- }
1052-
1053978/// A table name or a parenthesized subquery with an optional alias
1054979#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
1055980#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
@@ -1084,9 +1009,6 @@ pub enum TableFactor {
10841009 /// Optional table sample modifier
10851010 /// See: <https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#sample-clause>
10861011 sample : Option < TableSampleKind > ,
1087- /// Optional index hints(mysql)
1088- /// See: <https://dev.mysql.com/doc/refman/8.4/en/index-hints.html>
1089- index_hints : Vec < TableIndexHints > ,
10901012 } ,
10911013 Derived {
10921014 lateral : bool ,
@@ -1668,7 +1590,6 @@ impl fmt::Display for TableFactor {
16681590 with_ordinality,
16691591 json_path,
16701592 sample,
1671- index_hints,
16721593 } => {
16731594 write ! ( f, "{name}" ) ?;
16741595 if let Some ( json_path) = json_path {
@@ -1697,9 +1618,6 @@ impl fmt::Display for TableFactor {
16971618 if let Some ( alias) = alias {
16981619 write ! ( f, " AS {alias}" ) ?;
16991620 }
1700- if !index_hints. is_empty ( ) {
1701- write ! ( f, " {}" , display_separated( index_hints, " " ) ) ?;
1702- }
17031621 if !with_hints. is_empty ( ) {
17041622 write ! ( f, " WITH ({})" , display_comma_separated( with_hints) ) ?;
17051623 }
0 commit comments