scylladb / cpp-driver

Scylla C/C++ Driver
25 stars 25 forks source link

decoder: handle empty non-string types #60

Closed psarna closed 2 years ago

psarna commented 2 years ago

For legacy reasons, non-string types support "empty" values, e.g. you can have an empty int, distinct from NULL. This case used to trigger deserialization errors, so now it's simply a fallback to NULL. Another option is to introduce a new "empty" state that a value can be in, but it's semantically no different from NULL, even though it's serialized in a different way.

Ref: https://github.com/apache/cassandra/blob/7b58b79fe24c612f8bbf7984c325e88496f482d6/doc/native_protocol_v4.spec#L861-L863

Fixes #59

psarna commented 2 years ago

/cc @jul-stas