-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Remove proto.Value.Integer. #1380
Conversation
row.Value = &t.NewValue | ||
row.setTimestamp(t.Timestamp) |
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.
Is this a bug that we don't set the timestamp originally?
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.
Probably. I don't think anything is using KeyValue.Timestamp
right now.
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.
Let's track this somewhere then.
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.
Ok. See #1383.
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.
thanks Pete.
LGTM |
@@ -149,7 +149,7 @@ message GetResponse { | |||
|
|||
// A PutRequest is arguments to the Put() method. Note that to write | |||
// an empty value, the value parameter is still specified, but both |
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.
"both"
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.
Fixed.
\o/ LGTM |
b1933d4
to
db479ed
Compare
Integer values are now encoded into proto.Value.Bytes and any 0 or 8 byte value can be intepreted as an int64. Some of the printing niceness disappeared from the cockroach cli, but that will hopefully return once we move to the table-based API where we know the types of columns.
db479ed
to
3d52588
Compare
Remove proto.Value.Integer.
@@ -90,7 +89,14 @@ func (kv *KeyValue) ValueBytes() []byte { | |||
// ValueInt returns the value as an int64. This method will panic if the |
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.
This method no longer panics.
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.
It can still panic if the byte slice is less than 8 bytes long. See https://github.com/cockroachdb/cockroach/blob/master/util/encoding/encoding.go#L193.
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.
Ah, OK, so the interpretation of "value's type" has changed. This is a little unclear since Value
is still exposed as an interface{}
.
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'll clean up the comment in a subsequent PR.
Integer values are now encoded into proto.Value.Bytes and any 0 or 8
byte value can be intepreted as an int64. Some of the printing niceness
disappeared from the cockroach cli, but that will hopefully return once
we move to the table-based API where we know the types of columns.