From 9482a2cf09c036efed5ad5e763705a23e2ef8ef0 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Thu, 17 Feb 2011 15:37:38 +0300 Subject: [PATCH] Fix valgrind failure: don't look at join->join_tab[-1] --- sql/sql_select.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 4f0af89b54d..c79ab1a7501 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8531,7 +8531,8 @@ make_join_readinfo(JOIN *join, ulonglong options, uint no_jbuf_after) Later it should be improved. */ JOIN_TAB *prev_tab= tab - 1; - if ((tab->bush_root_tab && tab->bush_root_tab->bush_children->start == tab)) + if ((tab->bush_root_tab && tab->bush_root_tab->bush_children->start == tab) || + (tab == join->join_tab + join->const_tables)) prev_tab= NULL; tab->partial_join_cardinality= join->best_positions[i].records_read * (prev_tab? prev_tab->partial_join_cardinality : 1);