14 Commits

Author SHA1 Message Date
Angus Pearson
4bbaf621a1 Implement SCAN cursor [TYPE type] modifier suggested in issue #6107.
Add tests to check basic functionality of this optional keyword, and also tested with
a module (redisgraph). Checked quickly with valgrind, no issues.

Copies name the type name canonicalisation code from `typeCommand`, perhaps this would
be better factored out to prevent the two diverging and both needing to be edited to
add new `OBJ_*` types, but this is a little fiddly with C strings.

The [redis-doc](https://github.com/antirez/redis-doc/blob/master/commands.json) repo
will need to be updated with this new arg if accepted.

A quirk to be aware of here is that the GEO commands are backed by zsets not their own
type, so they're not distinguishable from other zsets.

Additionally, for sparse types this has the same behaviour as `MATCH` in that it may
return many empty results before giving something, even for large `COUNT`s.
2019-05-22 16:39:04 +01:00
antirez
030543ce25 Fix SCAN bug regression test, avoiding empty SREM call. 2018-06-14 12:21:58 +02:00
antirez
0a4201713a Improved regression test for #4906.
Removing the fix about 50% of the times the test will not be able to
pass cleanly. It's very hard to write a test that will always fail, or
actually, it is possible but then it's likely that it will consistently
pass if we change some random bit, so better to use randomization here.
2018-06-11 13:10:06 +02:00
antirez
6bef2759bb Regression test for the dictScan() issue #4906. 2018-06-11 12:51:26 +02:00
antirez
ac6a7e5925 Regression test for issue #2175. 2014-12-03 10:38:56 +01:00
antirez
7dfcfe47b6 Added tests for [SHZ]SCAN with MATCH. 2013-11-05 15:19:44 +01:00
antirez
adcc1fc04d SSCAN with integer encoded object test improved. 2013-10-31 10:37:27 +01:00
antirez
4f3d9c0595 Regression test added for [SHZ]SCAN issue #1354. 2013-10-31 09:43:21 +01:00
antirez
996bffbfb6 Test: added a SCAN test trying to trigger HT resize. 2013-10-30 16:50:25 +01:00
antirez
cde7c072ba Test: added ZSCAN test. 2013-10-30 16:25:53 +01:00
antirez
82dcd85503 Test: added HSCAN test. 2013-10-30 16:24:39 +01:00
antirez
35250fa9df Test: added SSCAN test. 2013-10-30 11:58:04 +01:00
antirez
a23bf27718 SCAN test keys sorting turned into more idiomatic Tcl. 2013-10-30 11:36:12 +01:00
antirez
d1bdb17b42 SCAN: tests moved to unit/scan.tcl. 2013-10-30 11:34:01 +01:00