• Konstantin Osipov's avatar
    Backport of: · abb5e74d
    Konstantin Osipov authored
    ----------------------------------------------------------
    revno: 2630.13.6
    committer: Konstantin Osipov <konstantin@mysql.com>
    branch nick: mysql-6.0-3288
    timestamp: Fri 2008-07-11 20:22:44 +0400
    message:
      WL#3288, step 1: ensure that the SQL layer always closes an open
      cursor (rnd or index read) before closing a handler.
    
    
    sql/handler.h:
      Assert that the read is closed in handler destructor.
    sql/sql_select.cc:
      Remove JOIN::table which was a piece of redundancy. The problem was
      that JOIN::cleanup() works only if JOIN::table is not null,
      but JOIN::cleanup also assigns JOIN::table to NULL. This assignment
      is apparently there for safety, from the times when we had no support for correlated
      subqueries. Indeed, in case of a evaluation of a correlated subquery more than once it led
      to JOIN::cleanup doing nothing, and leaving the rnd or index read open.
          
      In do_select(), make sure we call JOIN::join_free() even in case of an
      error.
    sql/sql_select.h:
      Remove JOIN::table, JOIN::all_tables has the same functionality.
    abb5e74d
handler.h 73.7 KB