Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colblk: Bitmap, BitmapBuilder bug fixes #4112

Merged
merged 2 commits into from
Oct 25, 2024

Commits on Oct 25, 2024

  1. colblk: fix Invert to initialize memory

    Previously, Invert used slices.Grow to grow the b.words slice if necessary. If
    len(b.words) < cap(b.words), words in the unused capacity were not initialized
    to zero and were assumed to be zero. Most of the time this was okay, because
    Reset zeroed b.words up to len(b.words).
    
    However if the BitmapBuilder was previously used to Finish fewer rows than were
    Set, it's possible Finish may have truncated b.words to exclude words with
    non-zero bits. Since Reset only reset words within len(b.words), the truncated
    words were left unzeroed.
    
    This commit updates Invert to make no assumptions as to the value of words
    beyond len(b.words). It also removes the zeroing in Reset which obscured this
    bug in most cases, instead relying on Set, Finish and Invert to properly
    initialize memory as necessary as it's used.
    
    Fix cockroachdb#4103.
    jbowens committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    f0b039c View commit details
    Browse the repository at this point in the history
  2. colblk: fix summary table bounds

    Fix an off-by-one on the summary table end bound. This could cause SeekSetBitGE
    to return the wrong index in bitmaps with more than 4096 represented bits.
    jbowens committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    86c652e View commit details
    Browse the repository at this point in the history