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