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) {
211
211
}
212
212
}
213
213
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
+
214
221
@ Override
215
222
public void enterInsertStmt (ClickHouseParser .InsertStmtContext ctx ) {
216
223
ClickHouseParser .TableIdentifierContext tableId = ctx .tableIdentifier ();
217
224
if (tableId != null ) {
218
- this .table = tableId . identifier (). IDENTIFIER (). getText ();
225
+ this .table = SqlParser . unquoteIdentifier ( tableId . getText () );
219
226
}
220
227
221
228
ClickHouseParser .ColumnsClauseContext columns = ctx .columnsClause ();
Original file line number Diff line number Diff line change @@ -294,6 +294,8 @@ public Object[][] testMiscStmtDp() {
294
294
{"SELECT * FROM table test WHERE ts = ?" , 1 },
295
295
{"SELECT * FROM table view WHERE ts = ?" , 1 },
296
296
{"SELECT * FROM table primary WHERE ts = ?" , 1 },
297
+ {"insert into events (s) values ('a')" , 0 },
298
+ {"insert into `events` (s) values ('a')" , 0 },
297
299
};
298
300
}
299
301
}
You can’t perform that action at this time.
0 commit comments