mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-30 03:50:25 +08:00
修复SysLocker无法写入新Key的问题
This commit is contained in:
@@ -157,7 +157,7 @@ func (this *SysLockerDAO) Increase(tx *dbs.Tx, key string, defaultValue int64) (
|
||||
}
|
||||
|
||||
// combine statements to make increasing faster
|
||||
colValue, err := tx.FindCol(0, "INSERT INTO `"+this.Table+"` (`key`, `version`) VALUES ('"+key+"', "+types.String(defaultValue)+") ON DUPLICATE KEY UPDATE `version`=`version`+"+types.String(sysLockerStep)+"; SELECT `version` FROM `"+this.Table+"` WHERE `key`='"+key+"'")
|
||||
colValue, err := tx.FindCol(0, "INSERT INTO `"+this.Table+"` (`key`, `version`) VALUES ('"+key+"', "+types.String(defaultValue+sysLockerStep)+") ON DUPLICATE KEY UPDATE `version`=`version`+"+types.String(sysLockerStep)+"; SELECT `version` FROM `"+this.Table+"` WHERE `key`='"+key+"'")
|
||||
if err != nil {
|
||||
if CheckSQLErrCode(err, 1064 /** syntax error **/) {
|
||||
// continue to use seperated query
|
||||
|
||||
Reference in New Issue
Block a user