Skip to content

Commit 8b2406e

Browse files
committed
fixed ANTLR4 for expressions with IP keyword
1 parent 967e7dc commit 8b2406e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

jdbc-v2/src/main/antlr4/com/clickhouse/jdbc/internal/parser/antlr4/ClickHouseParser.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,7 @@ keyword
13001300
| INSERT
13011301
| INTERVAL
13021302
| INTO
1303+
| IP
13031304
| IS
13041305
| IS_OBJECT_ID
13051306
| JOIN

jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/BaseSqlParserFacadeTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ public Object[][] testMiscStmtDp() {
282282
{"SELECT COUNT() FROM system.databases WHERE name = ?", 1},
283283
{"alter table user delete where reg_time = ?", 1},
284284
{"SELECT * FROM a,b WHERE id > ?", 1},
285+
{"select ip from myusers where tenant=?", 1},
285286
{"DROP USER IF EXISTS default_impersonation_user", 0},
286287
{"DROP ROLE IF EXISTS `vkonfwxapllzkkgkqdvt`", 0},
287288
{"CREATE ROLE `kjxrsscptauligukwgmf` ON CLUSTER '{cluster}'", 0},
@@ -550,6 +551,7 @@ public static Object[][] testStatementWithoutResultSetDP() {
550551
{"CREATE TABLE `test_table` (id UInt64) ENGINE = MergeTree() ORDER BY id ON CLUSTER `cluster`", 0, false},
551552
{"CREATE TABLE `test_table` (id UInt64) ENGINE = MergeTree() ORDER BY id ON CLUSTER `cluster` ENGINE = Replicated('clickhouse1:9000', 'test_db')", 0, false},
552553
{"CREATE TABLE `test_table` (id UInt64) ENGINE = MergeTree() ORDER BY id ON CLUSTER `cluster` ENGINE = Replicated('clickhouse1:9000', 'test_db') COMMENT 'for tests'", 0, false},
554+
{"CREATE TABLE myusers ( id UInt64, ip String, url String, tenant String) ENGINE = MergeTree() PRIMARY KEY (id)", 0, false},
553555
{"CREATE VIEW `test_db`.`source_table` source AS ( SELECT * FROM source_a UNION SELECT * FROM source_b)", 0, false},
554556
{"CREATE OR REPLACE VIEW `test_db`.`source_table` source AS ( SELECT * FROM source_a UNION SELECT * FROM source_b)", 0, false},
555557
{"CREATE OR REPLACE VIEW `test_db`.`source_table` source ON CLUSTER `cluster` AS ( SELECT * FROM source_a UNION SELECT * FROM source_b)", 0, false},

0 commit comments

Comments
 (0)