• MySQL Build Team's avatar
    Backport into build-200907211706-5.0.82sp1 · 2cf7f53b
    MySQL Build Team authored
    > ------------------------------------------------------------
    > revno: 2733
    > revision-id: gshchepa@mysql.com-20090430192037-9p1etcynkglte2j3
    > parent: aelkin@mysql.com-20090430143246-zfqaz0t7uoluzdz2
    > committer: Gleb Shchepa <gshchepa@mysql.com>
    > branch nick: mysql-5.0-bugteam
    > timestamp: Fri 2009-05-01 00:20:37 +0500
    > message:
    >   Bug #37362: Crash in do_field_eq
    >   
    >   EXPLAIN EXTENDED of nested query containing a error:
    >   
    >      1054 Unknown column '...' in 'field list'
    >   
    >   may cause a server crash.
    >   
    >   
    >   Parse error like described above forces a call to
    >   JOIN::destroy() on malformed subquery.
    >   That JOIN::destroy function closes and frees temporary
    >   tables. However, temporary fields of these tables
    >   may be listed in st_select_lex::group_list of outer
    >   query, and that st_select_lex may not cleanup them
    >   properly. So, after the JOIN::destroy call that
    >   st_select_lex::group_list may have Item_field
    >   objects with dangling pointers to freed temporary
    >   table Field objects. That caused a crash.
    2cf7f53b
subselect3.test 19.3 KB