summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-06-23 22:12:22 -0700
committerIgor Babaev <igor@askmonty.org>2011-06-23 22:12:22 -0700
commitd6b0767c8c819655e0a90b8f9c33356f92832c87 (patch)
tree53f6ad3f4d402fad71d8dff2df67d72617db7618 /sql/sql_base.cc
parent3cf0d6f446b51b76a53378a11a117a134158f407 (diff)
downloadmariadb-git-d6b0767c8c819655e0a90b8f9c33356f92832c87.tar.gz
Fixed a valgrind problem.
The function setup_tables should handle table_list elements for semijoin materialized tables in a special way when executing a prepared statement for the second time.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index c42551100ae..57775146b90 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -7830,9 +7830,16 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
select_lex->leaf_tables.empty();
while ((table_list= ti++))
{
- table_list->table->tablenr= table_list->tablenr_exec;
- table_list->table->map= table_list->map_exec;
- table_list->table->pos_in_table_list= table_list;
+ if(table_list->jtbm_subselect)
+ {
+ table_list->jtbm_table_no= table_list->tablenr_exec;
+ }
+ else
+ {
+ table_list->table->tablenr= table_list->tablenr_exec;
+ table_list->table->map= table_list->map_exec;
+ table_list->table->pos_in_table_list= table_list;
+ }
select_lex->leaf_tables.push_back(table_list);
}
}