Skip to content

Commit 25549e7

Browse files
committed
Fixed insert statements
1 parent 4efa2c1 commit 25549e7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ assignmentValue
439439
: literal # InsertRawValue
440440
| QUERY # InsertParameter
441441
| identifier (LPAREN columnExprList? RPAREN)? # InsertParameterFuncExpr
442-
| LPAREN columnExpr RPAREN # InserParameterExpr
442+
| LPAREN? columnExpr RPAREN? # InserParameterExpr
443443
;
444444

445445
// KILL statement

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ public Object[][] testMiscStmtDp() {
333333
{"WITH toDate('2025-08-20') as DATE_END, events AS ( SELECT 1 ) SELECT * FROM events", 0},
334334
{"select 1 table where 1 = ?", 1},
335335
{"insert into t (i, t) values (1, timestamp '2010-01-01 00:00:00')", 0},
336-
{"insert into t (i, t) values (1, date '2010-01-01')", 0
337-
}
336+
{"insert into t (i, t) values (1, date '2010-01-01')", 0},
337+
{"SELECT timestamp '2010-01-01 00:00:00' as ts, date '2010-01-01' as d", 0},
338338
};
339339
}
340340

@@ -422,7 +422,6 @@ public Object[][] testMiscStmtDp() {
422422
" EventDate = toDate(?) AND\n" +
423423
" EventTime <= ts_upper_bound;";
424424

425-
426425
@Test(dataProvider = "testStatementWithoutResultSetDP")
427426
public void testStatementsForResultSet(String sql, int args, boolean hasResultSet) {
428427
SqlParser parser = new SqlParser();

0 commit comments

Comments
 (0)