Clickhouse: support empty parenthesized options (#1925)
Some checks failed
license / Release Audit Tool (RAT) (push) Has been cancelled
Rust / codestyle (push) Has been cancelled
Rust / lint (push) Has been cancelled
Rust / benchmark-lint (push) Has been cancelled
Rust / compile (push) Has been cancelled
Rust / docs (push) Has been cancelled
Rust / compile-no-std (push) Has been cancelled
Rust / test (beta) (push) Has been cancelled
Rust / test (nightly) (push) Has been cancelled
Rust / test (stable) (push) Has been cancelled

This commit is contained in:
Sergey Olontsev 2025-07-06 08:06:20 +01:00 committed by GitHub
parent f2fba48a7a
commit 1a33abda63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -16253,9 +16253,9 @@ impl<'a> Parser<'a> {
fn parse_parenthesized_identifiers(&mut self) -> Result<Vec<Ident>, ParserError> { fn parse_parenthesized_identifiers(&mut self) -> Result<Vec<Ident>, ParserError> {
self.expect_token(&Token::LParen)?; self.expect_token(&Token::LParen)?;
let partitions = self.parse_comma_separated(|p| p.parse_identifier())?; let idents = self.parse_comma_separated0(|p| p.parse_identifier(), Token::RParen)?;
self.expect_token(&Token::RParen)?; self.expect_token(&Token::RParen)?;
Ok(partitions) Ok(idents)
} }
fn parse_column_position(&mut self) -> Result<Option<MySQLColumnPosition>, ParserError> { fn parse_column_position(&mut self) -> Result<Option<MySQLColumnPosition>, ParserError> {

View file

@ -224,6 +224,10 @@ fn parse_create_table() {
clickhouse().verified_stmt( clickhouse().verified_stmt(
r#"CREATE TABLE "x" ("a" "int") ENGINE = MergeTree ORDER BY "x" AS SELECT * FROM "t" WHERE true"#, r#"CREATE TABLE "x" ("a" "int") ENGINE = MergeTree ORDER BY "x" AS SELECT * FROM "t" WHERE true"#,
); );
clickhouse().one_statement_parses_to(
"CREATE TABLE x (a int) ENGINE = MergeTree() ORDER BY a",
"CREATE TABLE x (a INT) ENGINE = MergeTree ORDER BY a",
);
} }
#[test] #[test]