forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ClickHouse#63425 from CurtizJ/fix-create-index-par…
…sing Fix parsing of `CREATE INDEX` query
- Loading branch information
Showing
3 changed files
with
54 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/queries/0_stateless/03146_create_index_compatibility.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE TABLE default.t_index_3146\n(\n `a` UInt64,\n `b` UInt64,\n INDEX i1 a TYPE minmax GRANULARITY 1,\n INDEX i2 (a, b) TYPE minmax GRANULARITY 1,\n INDEX i3 (a, b) TYPE minmax GRANULARITY 1,\n INDEX i4 a TYPE minmax GRANULARITY 1\n)\nENGINE = MergeTree\nORDER BY tuple()\nSETTINGS index_granularity = 8192 |
17 changes: 17 additions & 0 deletions
17
tests/queries/0_stateless/03146_create_index_compatibility.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
DROP TABLE IF EXISTS t_index_3146; | ||
|
||
CREATE TABLE t_index_3146 (a UInt64, b UInt64) ENGINE = MergeTree ORDER BY tuple(); | ||
|
||
SET allow_create_index_without_type = 1; | ||
|
||
CREATE INDEX i1 ON t_index_3146 (a) TYPE minmax; | ||
CREATE INDEX i2 ON t_index_3146 (a, b) TYPE minmax; | ||
CREATE INDEX i3 ON t_index_3146 (a DESC, b ASC) TYPE minmax; | ||
CREATE INDEX i4 ON t_index_3146 a TYPE minmax; | ||
CREATE INDEX i5 ON t_index_3146 (a); -- ignored | ||
CREATE INDEX i6 ON t_index_3146 (a DESC, b ASC); -- ignored | ||
CREATE INDEX i7 ON t_index_3146; -- { clientError SYNTAX_ERROR } | ||
CREATE INDEX i8 ON t_index_3146 a, b TYPE minmax; -- { clientError SYNTAX_ERROR } | ||
|
||
SHOW CREATE TABLE t_index_3146; | ||
DROP TABLE t_index_3146; |