mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-12-23 11:12:51 +00:00
Add LOCK operation for ALTER TABLE (#1768)
This commit is contained in:
parent
10cf7c164e
commit
da5892802f
6 changed files with 104 additions and 1 deletions
|
|
@ -8311,6 +8311,24 @@ impl<'a> Parser<'a> {
|
|||
AlterTableOperation::SuspendRecluster
|
||||
} else if self.parse_keywords(&[Keyword::RESUME, Keyword::RECLUSTER]) {
|
||||
AlterTableOperation::ResumeRecluster
|
||||
} else if self.parse_keyword(Keyword::LOCK) {
|
||||
let equals = self.consume_token(&Token::Eq);
|
||||
let lock = match self.parse_one_of_keywords(&[
|
||||
Keyword::DEFAULT,
|
||||
Keyword::EXCLUSIVE,
|
||||
Keyword::NONE,
|
||||
Keyword::SHARED,
|
||||
]) {
|
||||
Some(Keyword::DEFAULT) => AlterTableLock::Default,
|
||||
Some(Keyword::EXCLUSIVE) => AlterTableLock::Exclusive,
|
||||
Some(Keyword::NONE) => AlterTableLock::None,
|
||||
Some(Keyword::SHARED) => AlterTableLock::Shared,
|
||||
_ => self.expected(
|
||||
"DEFAULT, EXCLUSIVE, NONE or SHARED after LOCK [=]",
|
||||
self.peek_token(),
|
||||
)?,
|
||||
};
|
||||
AlterTableOperation::Lock { equals, lock }
|
||||
} else if self.parse_keyword(Keyword::ALGORITHM) {
|
||||
let equals = self.consume_token(&Token::Eq);
|
||||
let algorithm = match self.parse_one_of_keywords(&[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue