• Aleksey Midenkov's avatar
    MDEV-17613 MIN/MAX Optimization (Select tables optimized away) does not work · b96e4424
    Aleksey Midenkov authored
    Current easy fix is not possible, because SELECT clones ha_partition
    and then closes the clone which leads to unclosed transaction in
    partitions we forcely prune out. We cound solve this by closing these
    partitions (and release from transaction) in
    change_partitions_to_open() at versioning conditions stage, but this
    is problematic because table lock is acquired for each partition at
    open stage and therefore must be released when we close partition
    handler in change_partitions_to_open(). More details in MDEV-20376.
    
    This should change after MDEV-20250 where mechanism of opening
    partitions will be improved.
    
    This reverts commit cdbac54d.
    b96e4424
sql_select.cc 896 KB