fix: sqlserver 表名包含特殊字符

This commit is contained in:
taojinlong 2022-01-27 11:02:16 +08:00
parent 584b8a1f43
commit a92f3c75f8

View File

@ -172,7 +172,7 @@ public class SqlserverQueryProvider extends QueryProvider {
@Override @Override
public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit, boolean isGroup, Datasource ds, List<ChartFieldCustomFilterDTO> fieldCustomFilter) { public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit, boolean isGroup, Datasource ds, List<ChartFieldCustomFilterDTO> fieldCustomFilter) {
String schema = new Gson().fromJson(ds.getConfiguration(), JdbcConfiguration.class).getSchema(); String schema = new Gson().fromJson(ds.getConfiguration(), JdbcConfiguration.class).getSchema();
return String.format("SELECT top %s * from %s ", limit.toString(), schema + "." + table); return String.format("SELECT top %s * from %s ", limit.toString(), schema + "." + String.format(SqlServerSQLConstants.KEYWORD_TABLE, table));
} }
@Override @Override