diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-10-16 18:37:43 +0400 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-10-16 18:37:43 +0400 |
commit | abb5e74df6c9198e403cebf4418d17ab71e23352 (patch) | |
tree | 28962c8ac0508355f874fc75d20cd72fee0396a9 /sql/sql_select.h | |
parent | 3138ee3be1caa12f05e28b8ea3b5264335d4ae07 (diff) | |
download | mariadb-git-abb5e74df6c9198e403cebf4418d17ab71e23352.tar.gz |
Backport of:
----------------------------------------------------------
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.
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r-- | sql/sql_select.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h index bb751c600ed..8311d7fdd2b 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -280,7 +280,7 @@ public: JOIN_TAB *join_tab,**best_ref; JOIN_TAB **map2table; ///< mapping between table indexes and JOIN_TABs JOIN_TAB *join_tab_save; ///< saved join_tab for subquery reexecution - TABLE **table,**all_tables,*sort_by_table; + TABLE **all_tables,*sort_by_table; uint tables,const_tables; uint send_group_parts; bool sort_and_group,first_record,full_join,group, no_field_update; @@ -427,7 +427,7 @@ public: select_result *result_arg) { join_tab= join_tab_save= 0; - table= 0; + all_tables= 0; tables= 0; const_tables= 0; join_list= 0; |