fix mysql

This commit is contained in:
Lunny Xiao 2023-12-23 11:39:32 +08:00
parent 22d763c312
commit 01aa1574f2
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 10 additions and 2 deletions

View File

@ -617,6 +617,12 @@ func (statement *Statement) WriteUpdate(updateWriter *builder.BytesWriter, cond
return err
}
if statement.dialect.URI().DBType == schemas.MYSQL {
if err := statement.writeJoins(updateWriter); err != nil {
return err
}
}
if err := statement.writeUpdateSets(updateWriter, v, colNames, args); err != nil {
return err
}
@ -626,9 +632,11 @@ func (statement *Statement) WriteUpdate(updateWriter *builder.BytesWriter, cond
return err
}
if statement.dialect.URI().DBType != schemas.MYSQL {
if err := statement.writeJoins(updateWriter); err != nil {
return err
}
}
if statement.dialect.URI().DBType == schemas.MSSQL {
table := statement.RefTable