-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
clientv3: translate WithPrefix() into WithFromKey() for empty key #7752
clientv3: translate WithPrefix() into WithFromKey() for empty key #7752
Conversation
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.
lgtm
@@ -381,6 +381,36 @@ func TestKVRange(t *testing.T) { | |||
{Key: []byte("fop"), Value: nil, CreateRevision: 9, ModRevision: 9, Version: 1}, | |||
}, | |||
}, | |||
// fetch entire keyspace using WithFromKey | |||
{ | |||
"\x00", "", |
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.
if the key is ""
with the opt WithFromKey()
, what's the expected behavior?
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'll fail because no key is defined. No one complains about Get(ctx, "", WithFromKey())
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.
got it.
Codecov Report
@@ Coverage Diff @@
## master #7752 +/- ##
=========================================
Coverage ? 75.71%
=========================================
Files ? 331
Lines ? 26011
Branches ? 0
=========================================
Hits ? 19693
Misses ? 4894
Partials ? 1424
Continue to review full report at Codecov.
|
lgtm |
1 similar comment
lgtm |
Users seem to expect the client to do this.