@@ -3725,6 +3725,12 @@ pub enum Statement {
37253725 history : bool ,
37263726 show_options : ShowStatementOptions ,
37273727 } ,
3728+ // ```sql
3729+ // SHOW {CHARACTER SET | CHARSET}
3730+ // ```
3731+ // [MySQL]:
3732+ // <https://dev.mysql.com/doc/refman/8.4/en/show.html#:~:text=SHOW%20%7BCHARACTER%20SET%20%7C%20CHARSET%7D%20%5Blike_or_where%5D>
3733+ ShowCharset ( ShowCharset ) ,
37283734 /// ```sql
37293735 /// SHOW OBJECTS LIKE 'line%' IN mydb.public
37303736 /// ```
@@ -5709,6 +5715,7 @@ impl fmt::Display for Statement {
57095715 }
57105716 Ok ( ( ) )
57115717 }
5718+ Statement :: ShowCharset ( show_stm) => show_stm. fmt ( f) ,
57125719 Statement :: StartTransaction {
57135720 modes,
57145721 begin : syntax_begin,
@@ -9888,6 +9895,32 @@ impl fmt::Display for ShowStatementIn {
98889895 }
98899896}
98909897
9898+ /// A Show Charset statement
9899+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
9900+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
9901+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
9902+ pub struct ShowCharset {
9903+ /// The statement can be written as `SHOW CHARSET` or `SHOW CHARACTER SET`
9904+ /// true means CHARSET was used and false means CHARACTER SET was used
9905+ pub is_shorthand : bool ,
9906+ pub filter : Option < ShowStatementFilter > ,
9907+ }
9908+
9909+ impl fmt:: Display for ShowCharset {
9910+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
9911+ write ! ( f, "SHOW" ) ?;
9912+ if self . is_shorthand {
9913+ write ! ( f, " CHARSET" ) ?;
9914+ } else {
9915+ write ! ( f, " CHARACTER SET" ) ?;
9916+ }
9917+ if self . filter . is_some ( ) {
9918+ write ! ( f, " {}" , self . filter. as_ref( ) . unwrap( ) ) ?;
9919+ }
9920+ Ok ( ( ) )
9921+ }
9922+ }
9923+
98919924#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
98929925#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
98939926#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
0 commit comments