You need to sign in or sign up before continuing.
  • Sergei Petrunia's avatar
    MDEV-20371: Invalid reads at plan refinement stage: join->positions... · 72055d69
    Sergei Petrunia authored
    (Backported to 10.2-compatiblity, build 22257)
    
    best_access_path() is called from two optimization phases:
    
    1. Plan choice phase, in choose_plan(). Here, the join prefix being
       considered is in join->positions[]
    
    2. Plan refinement stage, in fix_semijoin_strategies_for_picked_join_order
       Here, the join prefix is in join->best_positions[]
    
    It used to access join->positions[] from stage #2. This didnt cause any
    valgrind or asan failures (as join->positions[] has been written-to before)
    but the effect was similar to that of reading the random data:
    The join prefix we've picked (in join->best_positions) could have
    nothing in common with the join prefix that was last to be considered
    (in join->positions).
    72055d69
sql_select.cc 876 KB