Fix clone statement for Unscoped, UpdatingColumn, close #3681

This commit is contained in:
Jinzhu 2020-10-26 10:17:25 +08:00
parent cb591a7129
commit d011ebe7af
1 changed files with 2 additions and 0 deletions

View File

@ -408,6 +408,7 @@ func (stmt *Statement) clone() *Statement {
TableExpr: stmt.TableExpr,
Table: stmt.Table,
Model: stmt.Model,
Unscoped: stmt.Unscoped,
Dest: stmt.Dest,
ReflectValue: stmt.ReflectValue,
Clauses: map[string]clause.Clause{},
@ -419,6 +420,7 @@ func (stmt *Statement) clone() *Statement {
Schema: stmt.Schema,
Context: stmt.Context,
RaiseErrorOnNotFound: stmt.RaiseErrorOnNotFound,
UpdatingColumn: stmt.UpdatingColumn,
}
for k, c := range stmt.Clauses {