support update join
This commit is contained in:
parent
a13564976c
commit
860e0aca85
|
@ -1471,8 +1471,12 @@ func TestNilFromDB(t *testing.T) {
|
|||
assert.NotNil(t, tt4.Field1.cb)
|
||||
}
|
||||
|
||||
/*
|
||||
func TestUpdateWithJoin(t *testing.T) {
|
||||
if testEngine.Dialect().URI().DBType == schemas.SQLITE {
|
||||
t.Skip()
|
||||
return
|
||||
}
|
||||
|
||||
type TestUpdateWithJoin struct {
|
||||
Id int64
|
||||
ExtId int64
|
||||
|
@ -1500,4 +1504,3 @@ func TestUpdateWithJoin(t *testing.T) {
|
|||
Update(&TestUpdateWithJoin{Name: "test2"})
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -436,10 +436,16 @@ func (statement *Statement) WriteUpdate(updateWriter *builder.BytesWriter, cond
|
|||
return err
|
||||
}
|
||||
|
||||
// write table name
|
||||
if err := statement.writeUpdateTableName(updateWriter); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// write join
|
||||
if err := statement.writeJoins(updateWriter); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// write set
|
||||
if _, err := fmt.Fprint(updateWriter, " SET "); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue