fix: machine file bug

This commit is contained in:
meilin.huang
2024-12-26 12:17:58 +08:00
parent 3f6fb5afef
commit e4d949a64b
8 changed files with 52 additions and 45 deletions

View File

@@ -446,11 +446,11 @@ func (d *dbSqlExecAppImpl) doUpdate(ctx context.Context, sqlExecParam *sqlExecPa
}
execRecord.Table = tableName
whereStr := updatestmt.Where.GetText()
if whereStr == "" {
if updatestmt.Where == nil {
logx.ErrorContext(ctx, "update SQL - there is no where condition")
return d.doExec(ctx, dbConn, sqlExecParam.Sql)
}
whereStr := updatestmt.Where.GetText()
// 获取表主键列名,排除使用别名
primaryKey, err := dbConn.GetMetadata().GetPrimaryKey(tableName)