check driver.Valuer response, and skip the column if nil #1167

Merged
koron merged 1 commits from koron/valuer-update-by-nil-always into master 2020-03-10 03:01:36 +00:00
koron commented 2018-12-07 04:30:08 +00:00 (Migrated from github.com)

Problem:
Some sort of column are updated by nil always, when type for the column implements driver.Valuer interface and it's Value() method return nil. It should check requiredField.

Solution:
Check the response value of driver.Valuer.Value(), if it is nil and not requiredField, skip the column.

**Problem:** Some sort of column are updated by nil always, when type for the column implements `driver.Valuer` interface and it's `Value()` method return `nil`. It should check `requiredField`. **Solution:** Check the response value of `driver.Valuer.Value()`, if it is `nil` and not `requiredField`, skip the column.
codecov-io commented 2018-12-07 04:46:09 +00:00 (Migrated from github.com)

Codecov Report

Merging #1167 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1167      +/-   ##
=========================================
- Coverage    54.7%   54.7%   -0.01%     
=========================================
  Files          42      42              
  Lines        7646    7648       +2     
=========================================
+ Hits         4183    4184       +1     
  Misses       2935    2935              
- Partials      528     529       +1
Impacted Files Coverage Δ
statement.go 66.96% <100%> (+0.08%) ⬆️
xorm.go 64.61% <0%> (-1.54%) ⬇️

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 fd49db5...fa40f1e. Read the comment docs.

# [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=h1) Report > Merging [#1167](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=desc) into [master](https://codecov.io/gh/go-xorm/xorm/commit/fd49db598f00c3d2af461a85f55f4d00e0ae213b?src=pr&el=desc) will **decrease** coverage by `<.01%`. > The diff coverage is `100%`. [![Impacted file tree graph](https://codecov.io/gh/go-xorm/xorm/pull/1167/graphs/tree.svg?width=650&token=yB5nO1krEe&height=150&src=pr)](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #1167 +/- ## ========================================= - Coverage 54.7% 54.7% -0.01% ========================================= Files 42 42 Lines 7646 7648 +2 ========================================= + Hits 4183 4184 +1 Misses 2935 2935 - Partials 528 529 +1 ``` | [Impacted Files](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [statement.go](https://codecov.io/gh/go-xorm/xorm/pull/1167/diff?src=pr&el=tree#diff-c3RhdGVtZW50Lmdv) | `66.96% <100%> (+0.08%)` | :arrow_up: | | [xorm.go](https://codecov.io/gh/go-xorm/xorm/pull/1167/diff?src=pr&el=tree#diff-eG9ybS5nbw==) | `64.61% <0%> (-1.54%)` | :arrow_down: | ------ [Continue to review full report at Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1167?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/1167?src=pr&el=footer). Last update [fd49db5...fa40f1e](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
codecov-io commented 2018-12-07 04:46:10 +00:00 (Migrated from github.com)

Codecov Report

Merging #1167 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1167      +/-   ##
=========================================
- Coverage    54.7%   54.7%   -0.01%     
=========================================
  Files          42      42              
  Lines        7646    7648       +2     
=========================================
+ Hits         4183    4184       +1     
  Misses       2935    2935              
- Partials      528     529       +1
Impacted Files Coverage Δ
statement.go 66.96% <100%> (+0.08%) ⬆️
xorm.go 64.61% <0%> (-1.54%) ⬇️

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 fd49db5...fa40f1e. Read the comment docs.

# [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=h1) Report > Merging [#1167](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=desc) into [master](https://codecov.io/gh/go-xorm/xorm/commit/fd49db598f00c3d2af461a85f55f4d00e0ae213b?src=pr&el=desc) will **decrease** coverage by `<.01%`. > The diff coverage is `100%`. [![Impacted file tree graph](https://codecov.io/gh/go-xorm/xorm/pull/1167/graphs/tree.svg?width=650&token=yB5nO1krEe&height=150&src=pr)](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #1167 +/- ## ========================================= - Coverage 54.7% 54.7% -0.01% ========================================= Files 42 42 Lines 7646 7648 +2 ========================================= + Hits 4183 4184 +1 Misses 2935 2935 - Partials 528 529 +1 ``` | [Impacted Files](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [statement.go](https://codecov.io/gh/go-xorm/xorm/pull/1167/diff?src=pr&el=tree#diff-c3RhdGVtZW50Lmdv) | `66.96% <100%> (+0.08%)` | :arrow_up: | | [xorm.go](https://codecov.io/gh/go-xorm/xorm/pull/1167/diff?src=pr&el=tree#diff-eG9ybS5nbw==) | `64.61% <0%> (-1.54%)` | :arrow_down: | ------ [Continue to review full report at Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1167?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/1167?src=pr&el=footer). Last update [fd49db5...fa40f1e](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
lunny added this to the 1.0.0 milestone 2020-02-24 06:44:36 +00:00

We needs some tests.

We needs some tests.
lunny modified the milestone from 1.0.0 to 1.1.1 2020-03-01 13:24:57 +00:00
lunny modified the milestone from 1.1.1 to 1.0.0 2020-03-10 02:20:24 +00:00
lunny added the
kind
enhancement
label 2020-03-10 02:20:32 +00:00
lunny closed this pull request 2020-03-10 03:01:36 +00:00
Sign in to join this conversation.
No description provided.