handle weird update n by mysql
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
344985f6bd
commit
d7eb965a92
|
@ -145,6 +145,11 @@ func (session *Session) upsertMap(doUpdate bool, columns []string, args []interf
|
|||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if doUpdate && session.engine.dialect.URI().DBType == schemas.MYSQL && affected == 2 {
|
||||
// for MYSQL if INSERT ... ON CONFLICT RowsAffected == 2 means UPDATE
|
||||
affected = 1
|
||||
}
|
||||
|
||||
return affected, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue