summaryrefslogtreecommitdiff
path: root/sql/sql_cursor.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-04-30 12:28:27 +0200
committerSergey Petrunya <psergey@askmonty.org>2011-04-30 12:28:27 +0200
commitea43df76856aece6278a1487266784bbae673503 (patch)
treec5c159995a06f331bb9281fc58bd207002c5847a /sql/sql_cursor.cc
parent65b9fb5a1323e5ddc65efe58ddad4eb8626dc96d (diff)
downloadmariadb-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.cc10
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);
}