enable for update test for postgres

This commit is contained in:
Lunny Xiao 2023-10-25 15:37:00 +08:00
parent 0f085408af
commit 8e2fda467f
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
2 changed files with 2 additions and 3 deletions

View File

@ -233,8 +233,8 @@ func (statement *Statement) writeForUpdate(w *builder.BytesWriter) error {
return nil
}
if statement.dialect.URI().DBType != schemas.MYSQL {
return errors.New("only support mysql for update")
if statement.dialect.URI().DBType != schemas.MYSQL && statement.dialect.URI().DBType != schemas.POSTGRES {
return errors.New("only support mysql and postgres for update")
}
_, err := fmt.Fprint(w, " FOR UPDATE")
return err

View File

@ -88,7 +88,6 @@ func createEngine(dbType, connStr string) error {
}
}
db.Close()
*ignoreSelectUpdate = true
case schemas.MYSQL:
db, err := sql.Open(dbType, strings.ReplaceAll(connStr, "xorm_test", "mysql"))
if err != nil {