@@ -3696,6 +3696,12 @@ pub enum Statement {
36963696 history : bool ,
36973697 show_options : ShowStatementOptions ,
36983698 } ,
3699+ // ```sql
3700+ // SHOW {CHARACTER SET | CHARSET}
3701+ // ```
3702+ // [MySQL]:
3703+ // <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>
3704+ ShowCharset ( ShowCharset ) ,
36993705 /// ```sql
37003706 /// SHOW OBJECTS LIKE 'line%' IN mydb.public
37013707 /// ```
@@ -5680,6 +5686,7 @@ impl fmt::Display for Statement {
56805686 }
56815687 Ok ( ( ) )
56825688 }
5689+ Statement :: ShowCharset ( show_stm) => show_stm. fmt ( f) ,
56835690 Statement :: StartTransaction {
56845691 modes,
56855692 begin : syntax_begin,
@@ -9859,6 +9866,32 @@ impl fmt::Display for ShowStatementIn {
98599866 }
98609867}
98619868
9869+ /// A Show Charset statement
9870+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
9871+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
9872+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
9873+ pub struct ShowCharset {
9874+ /// The statement can be written as `SHOW CHARSET` or `SHOW CHARACTER SET`
9875+ /// true means CHARSET was used and false means CHARACTER SET was used
9876+ pub is_shorthand : bool ,
9877+ pub filter : Option < ShowStatementFilter > ,
9878+ }
9879+
9880+ impl fmt:: Display for ShowCharset {
9881+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
9882+ write ! ( f, "SHOW" ) ?;
9883+ if self . is_shorthand {
9884+ write ! ( f, " CHARSET" ) ?;
9885+ } else {
9886+ write ! ( f, " CHARACTER SET" ) ?;
9887+ }
9888+ if self . filter . is_some ( ) {
9889+ write ! ( f, " {}" , self . filter. as_ref( ) . unwrap( ) ) ?;
9890+ }
9891+ Ok ( ( ) )
9892+ }
9893+ }
9894+
98629895#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
98639896#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
98649897#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
0 commit comments