Add support for SHOW CHARSET (#1974)
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run

Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
This commit is contained in:
etgarperets 2025-07-29 13:38:07 +03:00 committed by GitHub
parent bde269b56f
commit 15d8bfea62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 61 additions and 0 deletions

View file

@ -12595,6 +12595,10 @@ impl<'a> Parser<'a> {
self.parse_show_databases(terse)
} else if self.parse_keyword(Keyword::SCHEMAS) {
self.parse_show_schemas(terse)
} else if self.parse_keywords(&[Keyword::CHARACTER, Keyword::SET]) {
self.parse_show_charset(false)
} else if self.parse_keyword(Keyword::CHARSET) {
self.parse_show_charset(true)
} else {
Ok(Statement::ShowVariable {
variable: self.parse_identifiers()?,
@ -12602,6 +12606,14 @@ impl<'a> Parser<'a> {
}
}
fn parse_show_charset(&mut self, is_shorthand: bool) -> Result<Statement, ParserError> {
// parse one of keywords
Ok(Statement::ShowCharset(ShowCharset {
is_shorthand,
filter: self.parse_show_statement_filter()?,
}))
}
fn parse_show_databases(&mut self, terse: bool) -> Result<Statement, ParserError> {
let history = self.parse_keyword(Keyword::HISTORY);
let show_options = self.parse_show_stmt_options()?;