• Martin Hansson's avatar
    Bug#52357: Assertion failed: join->best_read in · 4e75f7c0
    Martin Hansson authored
    greedy_search optimizer_search_depth=0
    
    The algorithm inside restore_prev_nj_state failed to
    properly update the counters within the NESTED_JOIN
    tree. The counter was decremented each time a table in the
    node was removed from the QEP, the correct thing to do being
    only to decrement it when the last table in the child node
    was removed from the plan. This lead to node counters
    getting negative values and the plan thus appeared
    impossible. An assertion caught this.
    
    Fixed by not recursing up the tree unless the last table in
    the join nest node is removed from the plan
    4e75f7c0
sql_select.cc 510 KB