File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
main/java/com/clickhouse/jdbc/internal
test/java/com/clickhouse/jdbc/internal Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -211,11 +211,18 @@ private void appendParameter(int startIndex) {
211211 }
212212 }
213213
214+ @ Override
215+ public void enterTableExprIdentifier (ClickHouseParser .TableExprIdentifierContext ctx ) {
216+ if (ctx .tableIdentifier () != null ) {
217+ this .table = SqlParser .unquoteIdentifier (ctx .tableIdentifier ().getText ());
218+ }
219+ }
220+
214221 @ Override
215222 public void enterInsertStmt (ClickHouseParser .InsertStmtContext ctx ) {
216223 ClickHouseParser .TableIdentifierContext tableId = ctx .tableIdentifier ();
217224 if (tableId != null ) {
218- this .table = tableId . identifier (). IDENTIFIER (). getText ();
225+ this .table = SqlParser . unquoteIdentifier ( tableId . getText () );
219226 }
220227
221228 ClickHouseParser .ColumnsClauseContext columns = ctx .columnsClause ();
Original file line number Diff line number Diff line change @@ -294,6 +294,8 @@ public Object[][] testMiscStmtDp() {
294294 {"SELECT * FROM table test WHERE ts = ?" , 1 },
295295 {"SELECT * FROM table view WHERE ts = ?" , 1 },
296296 {"SELECT * FROM table primary WHERE ts = ?" , 1 },
297+ {"insert into events (s) values ('a')" , 0 },
298+ {"insert into `events` (s) values ('a')" , 0 },
297299 };
298300 }
299301}
You can’t perform that action at this time.
0 commit comments