summaryrefslogtreecommitdiff
path: root/sql/sql_derived.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-10-10 10:08:26 -0700
committerIgor Babaev <igor@askmonty.org>2013-10-10 10:08:26 -0700
commit7c87385e3075143de18e50c1d327eeb2e224603a (patch)
tree7819d66c3d59be663839b70b0204d281b849f98a /sql/sql_derived.cc
parentec226e553aa56718ed9939e333fe36b3499ac9be (diff)
downloadmariadb-git-7c87385e3075143de18e50c1d327eeb2e224603a.tar.gz
Fixed bug mdev-5105.
The bug caused a memory overwrite in the function update_ref_and_keys() It happened due to a wrong value of SELECT_LEX::cond_count. This value historically was calculated by the fix_fields method. Now the logic of calling this method became too complicated and, as a result, this value is calculated not always correctly. The patch changes the way how and when the values of SELECT_LEX::cond_count and of SELECT_LEX::between_count are calculated. The new code does it just at the beginning of update_ref_and_keys().
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r--sql/sql_derived.cc2
1 files changed, 0 insertions, 2 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index a8bfc8a11a7..db6ab1fb269 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -394,8 +394,6 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived)
if (dt_select->options & OPTION_SCHEMA_TABLE)
parent_lex->options |= OPTION_SCHEMA_TABLE;
- parent_lex->cond_count+= dt_select->cond_count;
-
if (!derived->get_unit()->prepared)
{
dt_select->leaf_tables.empty();