mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-07-31 03:32:43 +08:00
bugfix: fix #982 table names were conflicting with database keywords and causing query failures
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user