aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/xorm.io/xorm/session_update.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-01-05 14:28:51 +0800
committerGitHub <noreply@github.com>2021-01-05 14:28:51 +0800
commit126c9331d6d8789563fae5d5bac2196d63fee0e8 (patch)
tree304d5f1ce134bd75344a4e7e1a376d7a6dc9cfb1 /vendor/xorm.io/xorm/session_update.go
parent8db0372a45082c8827bdee1b449f618b393c026d (diff)
downloadgitea-126c9331d6d8789563fae5d5bac2196d63fee0e8.tar.gz
gitea-126c9331d6d8789563fae5d5bac2196d63fee0e8.zip
upgrade xorm to v1.0.6 (#14246)
Diffstat (limited to 'vendor/xorm.io/xorm/session_update.go')
-rw-r--r--vendor/xorm.io/xorm/session_update.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/xorm.io/xorm/session_update.go b/vendor/xorm.io/xorm/session_update.go
index 7df8c75253..0adac25e43 100644
--- a/vendor/xorm.io/xorm/session_update.go
+++ b/vendor/xorm.io/xorm/session_update.go
@@ -273,8 +273,15 @@ func (session *Session) Update(bean interface{}, condiBean ...interface{}) (int6
k = ct.Elem().Kind()
}
if k == reflect.Struct {
+ var refTable = session.statement.RefTable
+ if refTable == nil {
+ refTable, err = session.engine.TableInfo(condiBean[0])
+ if err != nil {
+ return 0, err
+ }
+ }
var err error
- autoCond, err = session.statement.BuildConds(session.statement.RefTable, condiBean[0], true, true, false, true, false)
+ autoCond, err = session.statement.BuildConds(refTable, condiBean[0], true, true, false, true, false)
if err != nil {
return 0, err
}