fix bugs cols with incr when update #623

Merged
lunny merged 1 commits from lunny/fix_cols_incr_update into master 2017-06-20 07:43:22 +00:00
Owner

When use Cols with Incr or Decr, it will generate two update sets. This PR will fix that. When Cols with Incr or Decr. The same column on Cols will be ignored.

When use `Cols` with `Incr` or `Decr`, it will generate two update sets. This PR will fix that. When `Cols` with `Incr` or `Decr`. The same column on `Cols` will be ignored.
codecov-io commented 2017-06-20 07:43:05 +00:00 (Migrated from github.com)
Author
Owner

Codecov Report

Merging #623 into master will increase coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #623      +/-   ##
==========================================
+ Coverage   49.65%   49.65%   +<.01%     
==========================================
  Files          33       33              
  Lines        7016     7020       +4     
==========================================
+ Hits         3484     3486       +2     
- Misses       3065     3066       +1     
- Partials      467      468       +1
Impacted Files Coverage Δ
helpers.go 53.67% <50%> (-0.05%) ⬇️
xorm.go 69.49% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6dd1a9d...57f58f5. Read the comment docs.

# [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/623?src=pr&el=h1) Report > Merging [#623](https://codecov.io/gh/go-xorm/xorm/pull/623?src=pr&el=desc) into [master](https://codecov.io/gh/go-xorm/xorm/commit/6dd1a9db589dd7630191397657bee161055d87ba?src=pr&el=desc) will **increase** coverage by `<.01%`. > The diff coverage is `50%`. [![Impacted file tree graph](https://codecov.io/gh/go-xorm/xorm/pull/623/graphs/tree.svg?src=pr&token=yB5nO1krEe&width=650&height=150)](https://codecov.io/gh/go-xorm/xorm/pull/623?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #623 +/- ## ========================================== + Coverage 49.65% 49.65% +<.01% ========================================== Files 33 33 Lines 7016 7020 +4 ========================================== + Hits 3484 3486 +2 - Misses 3065 3066 +1 - Partials 467 468 +1 ``` | [Impacted Files](https://codecov.io/gh/go-xorm/xorm/pull/623?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [helpers.go](https://codecov.io/gh/go-xorm/xorm/pull/623?src=pr&el=tree#diff-aGVscGVycy5nbw==) | `53.67% <50%> (-0.05%)` | :arrow_down: | | [xorm.go](https://codecov.io/gh/go-xorm/xorm/pull/623?src=pr&el=tree#diff-eG9ybS5nbw==) | `69.49% <0%> (ø)` | :arrow_up: | ------ [Continue to review full report at Codecov](https://codecov.io/gh/go-xorm/xorm/pull/623?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/623?src=pr&el=footer). Last update [6dd1a9d...57f58f5](https://codecov.io/gh/go-xorm/xorm/pull/623?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
wudaoren commented 2019-03-13 03:49:12 +00:00 (Migrated from github.com)
Author
Owner

这个bug并未解决
使用engine.SetMapper(core.SameMapper{})后的sql语句如下
UPDATE User SET Age = ?, Age = Age - ?, Version = Version + 1 WHERE Id=? AND Version=? []interface {}{33, 9, 3, 3}
不使用SetMapper正常

这个bug并未解决 使用engine.SetMapper(core.SameMapper{})后的sql语句如下 UPDATE `User` SET `Age` = ?, `Age` = `Age` - ?, `Version` = `Version` + 1 WHERE `Id`=? AND `Version`=? []interface {}{33, 9, 3, 3} 不使用SetMapper正常
Author
Owner

This is a bug still on SameMapper

This is a bug still on SameMapper
Sign in to join this conversation.
No description provided.