diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2011-04-30 12:28:27 +0200 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2011-04-30 12:28:27 +0200 |
commit | ea43df76856aece6278a1487266784bbae673503 (patch) | |
tree | c5c159995a06f331bb9281fc58bd207002c5847a /sql/sql_cursor.cc | |
parent | 65b9fb5a1323e5ddc65efe58ddad4eb8626dc96d (diff) | |
download | mariadb-git-ea43df76856aece6278a1487266784bbae673503.tar.gz |
- Release build: Fix compiler warning about unused variable
- Debug build: make DBUG_ASSERT statements really look at the first table
One can't expect cursors to work with semi-join subqueries anyway,
though (which isn't a problem because cursors are not used anywhere)
Diffstat (limited to 'sql/sql_cursor.cc')
-rw-r--r-- | sql/sql_cursor.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc index 2f52726eea5..8094d0b7629 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); @@ -394,13 +393,16 @@ Sensitive_cursor::open(JOIN *join_arg) 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); } |