-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ascii
marshal, unmarshall
#322
base: master
Are you sure you want to change the base?
Conversation
6d386e7
to
8e26db1
Compare
8e26db1
to
6bc5d3e
Compare
@illia-li , can you please rebase it |
0d759cc
to
ca3e918
Compare
} | ||
v.SetBytes(decBytes(p)) | ||
case reflect.Interface: | ||
v.Elem().Set(reflect.ValueOf(decBytes(p))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pretty sure that ascii, by default, should be serialized into string
not into []byte
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text
, blob
, varchar
cql types
unmarshalls *interface{}
as []byte
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any logic in old marshal that would inmarshal to interface
, but here is the default behavior when it prepares rows:
func goType(t TypeInfo) (reflect.Type, error) {
switch t.Type() {
case TypeVarchar, TypeAscii, TypeInet, TypeText:
return reflect.TypeOf(*new(string)), nil
ca3e918
to
88e8914
Compare
Changes:
zero data
into[]byte
,*[]byte
, returned([]byte)(nil)
and(*[]byte)(*[nil])
before, now returns([]byte)([])
and(*[]byte)(*[])
custom interface{}
, was unsupported before, now is supported.