diff --git a/src/db.cpp b/src/db.cpp index a71bef5df..114b84297 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -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. */ diff --git a/tests/unit/scan.tcl b/tests/unit/scan.tcl index 9f9ff4df2..25549c4ac 100644 --- a/tests/unit/scan.tcl +++ b/tests/unit/scan.tcl @@ -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