mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-12-23 11:12:51 +00:00
Allow semi-colon at the end of UNCACHE statement (#1320)
This commit is contained in:
parent
f3d2f78fb2
commit
7a9793b72e
2 changed files with 10 additions and 18 deletions
|
|
@ -3611,21 +3611,13 @@ impl<'a> Parser<'a> {
|
|||
|
||||
/// Parse a UNCACHE TABLE statement
|
||||
pub fn parse_uncache_table(&mut self) -> Result<Statement, ParserError> {
|
||||
let has_table = self.parse_keyword(Keyword::TABLE);
|
||||
if has_table {
|
||||
let if_exists = self.parse_keywords(&[Keyword::IF, Keyword::EXISTS]);
|
||||
let table_name = self.parse_object_name(false)?;
|
||||
if self.peek_token().token == Token::EOF {
|
||||
Ok(Statement::UNCache {
|
||||
table_name,
|
||||
if_exists,
|
||||
})
|
||||
} else {
|
||||
self.expected("an `EOF`", self.peek_token())
|
||||
}
|
||||
} else {
|
||||
self.expected("a `TABLE` keyword", self.peek_token())
|
||||
}
|
||||
self.expect_keyword(Keyword::TABLE)?;
|
||||
let if_exists = self.parse_keywords(&[Keyword::IF, Keyword::EXISTS]);
|
||||
let table_name = self.parse_object_name(false)?;
|
||||
Ok(Statement::UNCache {
|
||||
table_name,
|
||||
if_exists,
|
||||
})
|
||||
}
|
||||
|
||||
/// SQLite-specific `CREATE VIRTUAL TABLE`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue