bugfix: fix #982 table names were conflicting with database keywords and causing query failures

This commit is contained in:
leven.chen
2023-12-23 13:05:28 +08:00
parent a4457edb64
commit 094043b0de

View File

@ -71,7 +71,8 @@ public class RdbDmlController {
if (DataSourceTypeEnum.MONGODB.getCode().equals(type)) {
param.setSql("db." + request.getTableName() + ".find()");
} else {
param.setSql("select * from " + request.getTableName());
// 拼接`tableName`,避免关键字被占用问题
param.setSql("select * from " +"`"+ request.getTableName()+"`");
}
return dlTemplateService.execute(param)
.map(rdbWebConverter::dto2vo);