mirror of
https://github.com/go-gitea/gitea
synced 2025-08-24 18:38:28 +00:00
Upgrade xorm to v1.2.2 (#16663) & Add test to ensure that dumping of login sources remains correct (#16847) (#16848)
* Upgrade xorm to v1.2.2 (#16663) Backport #16663 Fix #16683 * Add test to ensure that dumping of login sources remains correct (#16847) #16831 has occurred because of a missed regression. This PR adds a simple test to try to prevent this occuring again. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
13
vendor/xorm.io/xorm/session_update.go
generated
vendored
13
vendor/xorm.io/xorm/session_update.go
generated
vendored
@@ -81,6 +81,9 @@ func (session *Session) cacheUpdate(table *schemas.Table, tableName, sqlStr stri
|
||||
|
||||
ids = append(ids, pk)
|
||||
}
|
||||
if rows.Err() != nil {
|
||||
return rows.Err()
|
||||
}
|
||||
session.engine.logger.Debugf("[cache] find updated id: %v", ids)
|
||||
} /*else {
|
||||
session.engine.LogDebug("[xorm:cacheUpdate] del cached sql:", tableName, newsql, args)
|
||||
@@ -212,7 +215,10 @@ func (session *Session) Update(bean interface{}, condiBean ...interface{}) (int6
|
||||
!session.statement.OmitColumnMap.Contain(table.Updated) {
|
||||
colNames = append(colNames, session.engine.Quote(table.Updated)+" = ?")
|
||||
col := table.UpdatedColumn()
|
||||
val, t := session.engine.nowTime(col)
|
||||
val, t, err := session.engine.nowTime(col)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if session.engine.dialect.URI().DBType == schemas.ORACLE {
|
||||
args = append(args, t)
|
||||
} else {
|
||||
@@ -518,7 +524,10 @@ func (session *Session) genUpdateColumns(bean interface{}) ([]string, []interfac
|
||||
|
||||
if col.IsUpdated && session.statement.UseAutoTime /*&& isZero(fieldValue.Interface())*/ {
|
||||
// if time is non-empty, then set to auto time
|
||||
val, t := session.engine.nowTime(col)
|
||||
val, t, err := session.engine.nowTime(col)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
args = append(args, val)
|
||||
|
||||
var colName = col.Name
|
||||
|
Reference in New Issue
Block a user