For nullable columns, store nil values as NULL #531
No reviewers
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#531
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "jcsalem/fix/nil_ptr_is_nullable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have a struct defined as:
If
field
is nil, I would likeNULL
stored in the database. Currently, however, it stores the string "null". I think this is an error since the zero value of*MyStruct
is nil.This PR fixes this by using reflect.IsNil to determine whether a field's value is nil for the types where it makes sense.
@jcsalem Thank you! And could you send some tests PR to github.com/go-xorm/tests.
Any progress by this PR? I have the same issue
Not yet. Hasn't been a priority for me. I think the fix works well, but I'd
love it if you could write some tests for us!
On Mon, Jul 10, 2017 at 10:45 AM, Oleh Herych notifications@github.com
wrote:
@oherych @jcsalem I have moved tests file from https://github.com/go-xorm/tests to this project so that the PR authors could write tests more easy.
Hi, I added tests https://github.com/go-xorm/xorm/pull/661
but actually, I'm not sure is this correct work. Is
Nullable("nullable2")
should be mandatory on this case