{{ message }}
Commit ae90c08
committed
Reject CREATE TABLE ... CLONE AS SELECT / table function
The parser accepted CREATE TABLE t CLONE AS SELECT ... and CREATE TABLE t
CLONE AS <table_function>, but neither shape has partitions to attach, so
the CLONE keyword was silently ignored and the table was created as a
plain CREATE ... AS SELECT. Reject these shapes early in
getTablePropertiesAndNormalizeCreateQuery with BAD_ARGUMENTS instead.
Also fix ASTCreateQuery::formatQueryImpl: the `if (select)` branch did
not emit CLONE, so an AST round-trip silently dropped the keyword. Add
add_clone_if_needed alongside the existing add_empty_if_needed call so
CLONE survives reformatting. After this, the randomized-settings
injection in clickhouse-test round-trips CLONE faithfully and the
interpreter check above catches the rewritten query.
Fixes #1049941 parent c1ccce2 commit ae90c08
4 files changed
Lines changed: 48 additions & 0 deletions
File tree
- src
- Interpreters
- Parsers
- tests/queries/0_stateless
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
596 | 601 | | |
597 | 602 | | |
598 | 603 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 33 additions & 0 deletions

0 commit comments