• unknown's avatar
    Fix bug lp:894326 · dc1b1d39
    unknown authored
    The patch also fixes an unrelated compiler warning.
    
    Analysis:
    The temporary table created during SJ-materialization
    might be used for sorting for a group by operation. The
    sort buffers for this internal temporary table were not
    cleared by the execution code after each subquery
    re-execution. This resulted in a memory leak detected
    by valgrind.
    
    Solution:
    Cleanup the sort buffers for the semijon tables as well.
    
    
    sql/item_subselect.cc:
      - Fix a compiler warning and add logic to revert to table
        scan partial match when there are more rows in the materialized
        subquery than there can be bits in the NULL bitmap index used
        for partial matching.
    sql/opt_subselect.cc:
      - Fixed a memory leak detected by valgrind
    dc1b1d39
opt_subselect.cc 162 KB