diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2011-05-29 12:58:44 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2011-05-29 12:58:44 +0400 |
commit | 5cd18326c2167ddf1fe989154c519809cd26f175 (patch) | |
tree | 0166109cba0ae1b9b6bfa81d8c38ecd1a0fe2276 /sql/sql_cursor.cc | |
parent | 8ce2e1bcbe1f00b6030b1c82ea62b3a64b1d0de9 (diff) | |
parent | 4efe046352f61cc7b8a44a604f96f8b68cf155c0 (diff) | |
download | mariadb-git-5cd18326c2167ddf1fe989154c519809cd26f175.tar.gz |
Merge 5.3->main -> 5.3-mwl90
Diffstat (limited to 'sql/sql_cursor.cc')
-rw-r--r-- | sql/sql_cursor.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc index 274d418dc19..ab5308affa9 100644 --- a/sql/sql_cursor.cc +++ b/sql/sql_cursor.cc @@ -363,7 +363,6 @@ Sensitive_cursor::open(JOIN *join_arg) join= join_arg; THD *thd= join->thd; /* First non-constant table */ - JOIN_TAB *join_tab= join->join_tab + join->const_tables; DBUG_ENTER("Sensitive_cursor::open"); join->change_result(result); @@ -381,26 +380,29 @@ Sensitive_cursor::open(JOIN *join_arg) /* Prepare JOIN for reading rows. */ join->tmp_table= 0; - join->join_tab[join->tables-1].next_select= setup_end_select_func(join); + join->join_tab[join->top_join_tab_count - 1].next_select= setup_end_select_func(join); join->send_records= 0; join->fetch_limit= join->unit->offset_limit_cnt; /* Disable JOIN CACHE as it is not working with cursors yet */ - for (JOIN_TAB *tab= join_tab; - tab != join->join_tab + join->tables - 1; - tab++) + for (JOIN_TAB *tab= first_linear_tab(join, WITHOUT_CONST_TABLES); + tab != join->join_tab + join->top_join_tab_count - 1; + tab= next_linear_tab(join, tab, WITH_BUSH_ROOTS)) { if (tab->next_select == sub_select_cache) tab->next_select= sub_select; } - DBUG_ASSERT(join_tab->table->reginfo.not_exists_optimize == 0); - DBUG_ASSERT(join_tab->not_used_in_distinct == 0); +#ifndef DBUG_OFF + JOIN_TAB *first_tab= first_linear_tab(join, WITHOUT_CONST_TABLES); + DBUG_ASSERT(first_tab->table->reginfo.not_exists_optimize == 0); + DBUG_ASSERT(first_tab->not_used_in_distinct == 0); /* null_row is set only if row not found and it's outer join: should never happen for the first table in join_tab list */ - DBUG_ASSERT(join_tab->table->null_row == 0); + DBUG_ASSERT(first_tab->table->null_row == 0); +#endif DBUG_RETURN(0); } |