gorm
gorm copied to clipboard
Fix null setting on reused objects
- [x] Do only one thing
- [x] Non breaking API changes
- [ ] Tested
What did this pull request do?
Starting from v1.25.1 GORM seems to not reset null fields, causing incosistent behavior compared to the previous way GORM was working.
The fixes I have added are fixing this for Scanner interfaces and time.Time, however there's still a test failure in case of the int and most likely other primitive variables.
I am opening this PR just to illustrate the fixes, but I think we need to debate it further what's the expected behavior.
User Case Description
The regression seems to be coming from this PR: https://github.com/go-gorm/gorm/pull/6311
The unit tests are still failing on the integer default value setting. I can dig that out too @jinzhu, but this partially reverts #6311. What do you think about this fix?
This PR is being closed due to failed tests.