• Sergey Glukhov's avatar
    Bug#52336 Segfault / crash in 5.1 copy_fields (param=0x9872980) at sql_select.cc:15355 · c1ad5072
    Sergey Glukhov authored
    The problem is that we can not use make_cond_for_table().
    This function relies on used_tables() condition
    which is not set properly for subqueries.
    As result subquery is not filtered out.
    The fix is to use remove_eq_conds() function instead
    of make_cond_for_table() func. 'remove_eq_conds()'
    algorithm relies on const_item() value and it allows
    to handle subqueries in right way.
    
    
    mysql-test/r/having.result:
      test case
    mysql-test/t/having.test:
      test case
    sql/sql_select.cc:
      The fix is to use remove_eq_conds() function instead
      of make_cond_for_table() function.
    c1ad5072
having.result 15.4 KB