• Nirbhay Choubey's avatar
    MDEV-9021: MYSQLD SEGFAULTS WHEN BUILT USING --WITH-MAX-INDEXES=128 · 7ec65585
    Nirbhay Choubey authored
    The bitmap implementation defines two template Bitmap classes. One
    optimized for 64-bit (default) wide bitmaps while the other is used for
    all other widths.
    
    In order to optimize the computations, Bitmap<64> class has defined its
    own member functions for bitmap operations, the other one, however,
    relies on mysys' bitmap implementation (mysys/my_bitmap.c).
    
    Issue 1:
    In case of non 64-bit Bitmap class, intersect() wrongly reset the
    received bitmap while initialising a new local bitmap structure
    (bitmap_init() clears the bitmap buffer) thus, the received bitmap was
    getting cleared.
    
    Fixed by initializing the local bitmap structure by using a temporary
    buffer and later copying the received bitmap to the initialised bitmap
    structure.
    
    Issue 2:
    The non 64-bit Bitmap class had the Iterator missing which caused
    compilation failure.
    
    Also added a cmake variable to hold the MAX_INDEXES value when supplied
    from the command prompt. (eg. cmake .. -DMA...
    7ec65585
ps_5merge.result 224 KB