Genuineh commented on PR #3024:
URL: https://github.com/apache/kvrocks/pull/3024#issuecomment-2975227802
@git-hulk I found a new problem of scan when input the empty prefix in
unstable branch.
The go test case like this
```cpp
t.Run("SCAN MATCH for empty prefix", func(t *testing.T) {
require.NoError(t, rdb.FlushDB(ctx).Err())
util.Populate(t, rdb, "key:", 10, 10)
keys := scanAll(t, rdb, "match", "")
require.Len(t, keys, 10)
})
```
error
```log
=== RUN TestScanWithNumberCursor/SCAN_MATCH_for_empty_prefix
/home/jerryg/github/forked/kvrocks/tests/gocase/unit/scan/scan_test.go:101:
Error Trace:
/home/jerryg/github/forked/kvrocks/tests/gocase/unit/scan/scan_test.go:101
Error: "[]" should have 10 item(s), but has 0
Test:
TestScanWithNumberCursor/SCAN_MATCH_for_empty_prefix
```
Need to fix it? Under normal circumstances, it should be rare for the input
to be empty. But in Redis, it seems that this is supported. From the
perspective of Redis compatibility, it is best to fix this issue, which occurs
in both standalone and cluster scenarios.
If necessary, I think a new merge request should be opened to address this
issue after this submission is merged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]