• Sergey Glukhov's avatar
    Bug #14409015 MEMORY LEAK WHEN REFERENCING OUTER FIELD IN HAVING · 2f30b340
    Sergey Glukhov authored
    When resolving outer fields, Item_field::fix_outer_fields()
    creates new Item_refs for each execution of a prepared statement, so
    these must be allocated in the runtime memroot. The memroot switching
    before resolving JOIN::having causes these to be allocated in the
    statement root, leaking memory for each PS execution.
    
    
    sql/item_subselect.cc:
      addon, fix for 11829691, item could be created in
      runtime memroot, so we need to use real_item instead.
    2f30b340
item_subselect.cc 72 KB