• antirez's avatar
    Fix saving of zero-length lists. · 0aa0cdf7
    antirez authored
    Normally in modern Redis you can't create zero-len lists, however it's
    possible to load them from old RDB files generated, for instance, using
    Redis 2.8 (see issue #4409). The "Right Thing" would be not loading such
    lists at all, but this requires to hook in rdb.c random places in a not
    great way, for a problem that is at this point, at best, minor.
    
    Here in this commit instead I just fix the fact that zero length lists,
    materialized as quicklists with the first node set to NULL, were
    iterated in the wrong way while they are saved, leading to a crash.
    
    The other parts of the list implementation are apparently able to deal
    with empty lists correctly, even if they are no longer a thing.
    0aa0cdf7
rdb.c 63.3 KB