1.修复Oracle使用Replace出错的BUG

2.降低框架在原版Oracle操作中可能出现删数据的风险
3.降低原版Execute执行器可能出现误删数据的风险
This commit is contained in:
tuuz
2023-10-30 11:51:03 +08:00
parent bba22d56d5
commit bc2d85858c

View File

@@ -174,12 +174,7 @@ func (b *BuilderOracle) BuildExecuteOra(operType string) (sqlStr string, args []
sqlStr = fmt.Sprintf("DELETE FROM %s%s", b.BuildTable(), where)
break
case "replace":
if where == "" && b.IOrm.GetForce() == false {
err = errors.New("出于安全考虑, update时where条件不能为空, 如果真的不需要where条件, 请使用Force()(如: db.xxx.Force().Update())")
b.IOrm.GetISession().GetIEngin().GetLogger().Error(err.Error())
return
}
sqlStr = fmt.Sprintf("REPLACE INTO %s (%s) VALUES %s", b.BuildTable(), insertkey, insertval)
err = errors.New("Oracle不支持Replace查询如需使用Replace()函数可以手动在Fields()中输入")
break
}