{"action":"closed","issue":{"url":"https://api.github.com/repos/gocql/gocql/issues/172","labels_url":"https://api.github.com/repos/gocql/gocql/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/gocql/gocql/issues/172/comments","events_url":"https://api.github.com/repos/gocql/gocql/issues/172/events","html_url":"https://github.com/gocql/gocql/issues/172","id":33723788,"number":172,"title":"Cant mark field as nil/null","user":{"login":"corydoras","id":124418,"avatar_url":"https://avatars.githubusercontent.com/u/124418?v=3","gravatar_id":"","url":"https://api.github.com/users/corydoras","html_url":"https://github.com/corydoras","followers_url":"https://api.github.com/users/corydoras/followers","following_url":"https://api.github.com/users/corydoras/following{/other_user}","gists_url":"https://api.github.com/users/corydoras/gists{/gist_id}","starred_url":"https://api.github.com/users/corydoras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corydoras/subscriptions","organizations_url":"https://api.github.com/users/corydoras/orgs","repos_url":"https://api.github.com/users/corydoras/repos","events_url":"https://api.github.com/users/corydoras/events{/privacy}","received_events_url":"https://api.github.com/users/corydoras/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gocql/gocql/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":42,"created_at":"2014-05-17T05:17:11Z","updated_at":"2015-11-21T11:55:31Z","closed_at":"2015-11-21T11:55:31Z","body":"When invoking session.Query (as below), where one of the values is nil, the resulting value passed to the database is not nil. For example, if you try to insert nil into a date field, the result is this:\r\n\r\n    myschema> select uuid, discontinued_from from mytable;\r\n    \r\n     uuid                                 | discontinued_from\r\n    --------------------------------------+--------------------------\r\n     a0db0350-dd67-11e3-adb0-b8f6b11b1965 |          -6795364578.871\r\n\r\nUpdating this field to nil, works when you try to do it from in cqlsh. (i.e. the problem only occurs in the go driver):\r\n\r\n    myschema> update course set discontinued_from=null where uuid=a0db0350-dd67-11e3-adb0-b8f6b11b1965 ;\r\n    cqlsh:handbook> select uuid, discontinued_from from mytable;\r\n    uuid                                 | discontinued_from\r\n    --------------------------------------+--------------------------\r\n    a0db0350-dd67-11e3-adb0-b8f6b11b1965 |                     null\r\n\r\nReproducing the problem:\r\n\r\n    err := cql.Query(\"update mytable set discontinued_from=? where uuid=?\", nil, uid).Exec()\r\n\r\nResults in a marshalling problem:\r\n\r\n    panic: reflect: call of reflect.Value.Type on zero Value\r\n    \r\n    goroutine 1 [running]:\r\n    runtime.panic(0x10fb00, 0x107398d0)\r\n    \t/usr/local/go/src/pkg/runtime/panic.c:266 +0x9a\r\n    reflect.Value.Type(0x0, 0x0, 0x0, 0x0, 0x0)\r\n    \t/usr/local/go/src/pkg/reflect/value.go:1698 +0x6f\r\n    github.com/gocql/gocql.marshalTimestamp(0x10742540, 0x0, 0x0, 0x0, 0x0, ...)\r\n    \t/Users/jacob/Documents/handbook/src/github.com/gocql/gocql/marshal.go:779 +0x2b6\r\n\r\n"}}