summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-10-22 00:14:27 -0700
committerIgor Babaev <igor@askmonty.org>2011-10-22 00:14:27 -0700
commitfdf789a7eadf864ecc0e617f25f795fafda55026 (patch)
tree3435f1ab04045ad0e94c7b3b59eaada904d06c1a /sql/sql_lex.cc
parentb117a3c453a9a8a67906aa2bb06648c213a85b35 (diff)
downloadmariadb-git-fdf789a7eadf864ecc0e617f25f795fafda55026.tar.gz
Fixed LP bug #874378.
This bug happened for the queries over multi-table mergeable views because the bitmap TABLE::read_set of the underlying tables were not updated after the views had been merged into the query. Now this bitmaps are updated properly. Also the bitmap TABLE::merge_keys now is updated in prevention of future bugs.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 64e295d82ea..cc10cd5dee3 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -3411,7 +3411,7 @@ void SELECT_LEX::update_used_tables()
while ((tl= ti++))
{
TABLE_LIST *embedding;
- if (tl->table)
+ if (tl->table && !tl->is_view_or_derived())
{
embedding= tl->embedding;
for (embedding= tl->embedding; embedding; embedding=embedding->embedding)
@@ -3422,6 +3422,9 @@ void SELECT_LEX::update_used_tables()
TABLE *tab= tl->table;
tab->covering_keys= tab->s->keys_for_keyread;
tab->covering_keys.intersect(tab->keys_in_use_for_query);
+ tab->merge_keys.clear_all();
+ bitmap_clear_all(tab->read_set);
+ bitmap_clear_all(tab->vcol_set);
break;
}
}