mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-08 13:10:20 +00:00
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
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:
parent
bde269b56f
commit
15d8bfea62
4 changed files with 61 additions and 0 deletions
|
@ -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()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue