• Yanqi Lv's avatar
    fix wrong data type conversion in zrangeResultBeginStore (#13148) · 464aad9e
    Yanqi Lv authored
    In `beginResultEmission`, -1 means the result length is not known in
    advance. But after #12185, if we pass -1 to `zrangeResultBeginStore`, it
    will convert to SIZE_MAX in `zsetTypeCreate` and try to `dictExpand`.
    Although `dictExpand` won't succeed because the size overflows, I think
    we'd better to avoid this wrong conversion.
    
    This bug can be triggered when the source of `zrangestore` doesn't exist
    or we use `zrangestore` command with `byscore` or `bylex`.
    The impact is that dst keys will be converted to use skiplist instead of
    listpack.
    
    (cherry picked from commit bad33f87)
    464aad9e
t_zset.c 149 KB