Open jameshartig opened 2 years ago
The marshaling as []byte{}
was added in https://github.com/gocql/gocql/pull/441 .
Also note that CQL protocol recognizes zero bytes as empty value:
For legacy compatibility reasons, note that most non-string types support "empty" values (i.e. a value with zero length). An empty value is distinct from NULL, which is encoded with a negative length.
However, I don't have any experience with how these empty values (should) behave.
It seems that the Java driver treats the empty value as null. How do the other drivers treat those values?
I believe that's how Yugabyte is interpreting the empty bytes so b > NULL
is false since you can't compare against NULL
.
It looks like the datastax Node.JS driver always encodes an int: https://github.com/datastax/nodejs-driver/blob/fe7b965b6241545f03b6fbbca20fe72c8bc99196/lib/encoder.js#L433
Please answer these questions before submitting your issue. Thanks!
What version of Cassandra are you using?
Yugabyte 2.14
What version of Gocql are you using?
v1.2.1
What version of Go are you using?
Go 1.19
What did you do?
What did you expect to see?
I expect the last query to not fail with not found.
Ran yugabyte with:
What did you see instead?
Instead it panic's because the last query was not found.
Related: https://github.com/yugabyte/yugabyte-db/issues/14084
I believe this is because gocql encodes empty
time.Time
values as[]byte{}
rather than just letting them encode as-62135596800000
.