mirror of https://github.com/redis/redis.git
				
				
				
			HSCAN/ZSCAN: skip value when matching.
This fixes issue #1360 and #1362.
This commit is contained in:
		
							parent
							
								
									1a0cea33a0
								
							
						
					
					
						commit
						f56f78d159
					
				
							
								
								
									
										9
									
								
								src/db.c
								
								
								
								
							
							
						
						
									
										9
									
								
								src/db.c
								
								
								
								
							| 
						 | 
				
			
			@ -505,11 +505,16 @@ void scanGenericCommand(redisClient *c, robj *o) {
 | 
			
		|||
        if (filter) {
 | 
			
		||||
            decrRefCount(kobj);
 | 
			
		||||
            listDelNode(keys, node);
 | 
			
		||||
            /* Also remove the value for hashes and sorted sets. */
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /* If this is an hash or a sorted set, we have a flat list of
 | 
			
		||||
         * key-value elements, so if this element was filtered, remove the
 | 
			
		||||
         * value, or skip it if it was not filtered: we only match keys. */
 | 
			
		||||
        if (o && (o->type == REDIS_ZSET || o->type == REDIS_HASH)) {
 | 
			
		||||
            node = nextnode;
 | 
			
		||||
                kobj = listNodeValue(node);
 | 
			
		||||
            nextnode = listNextNode(node);
 | 
			
		||||
            if (filter) {
 | 
			
		||||
                kobj = listNodeValue(node);
 | 
			
		||||
                decrRefCount(kobj);
 | 
			
		||||
                listDelNode(keys, node);
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue