Fix bad merge in SCAN KEYS command

Former-commit-id: c21af6b351328ffbdb1d1e2a7eed44f8f929f8b2
This commit is contained in:
John Sully 2019-07-19 00:43:23 -04:00
parent c178b67ded
commit 1c8c4a5db2
2 changed files with 4 additions and 4 deletions

View File

@ -820,8 +820,8 @@ void scanGenericCommand(client *c, robj_roptr o, unsigned long cursor) {
/* Filter an element if it isn't the type we want. */
if (!filter && o == nullptr && type){
robj_roptr typecheck = lookupKeyReadWithFlags(c->db, kobj, LOOKUP_NOTOUCH);
const char* type = getObjectTypeName(typecheck);
if (strcasecmp((char*) type, type)) filter = 1;
const char* typeT = getObjectTypeName(typecheck);
if (strcasecmp((char*) type, typeT)) filter = 1;
}
/* Filter element if it is an expired key. */

View File

@ -69,7 +69,7 @@ start_server {tags {"scan"}} {
if {$cur == 0} break
}
assert_equal 0 [llength $keys]
assert_equal 0 [llength $keys] "non-strings excluded"
# Check strings are included
set cur 0
@ -82,7 +82,7 @@ start_server {tags {"scan"}} {
if {$cur == 0} break
}
assert_equal 1000 [llength $keys]
assert_equal 1000 [llength $keys] "strings included"
# Check all three args work together
set cur 0