summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-03-01 10:22:22 +0300
committerSergey Petrunya <psergey@askmonty.org>2011-03-01 10:22:22 +0300
commitc6ba9598026b06f5d64e7508abb652ac22d50e48 (patch)
tree006aac08895dc2b538ee6b1dcc84ff9e9190e521 /sql
parent6cd1ec3b6be78f10929463264b12c2c9950b797e (diff)
parent10b8119ad3e5fa10fdddfb959a2e9878888bfed6 (diff)
downloadmariadb-git-c6ba9598026b06f5d64e7508abb652ac22d50e48.tar.gz
Merge fix for BUG#725275
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_select.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 5df506156b6..9e496cde197 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1056,6 +1056,7 @@ JOIN::optimize()
*/
for (JOIN_TAB *tab= join_tab + const_tables; tab < join_tab + tables; tab++)
{
+ uint key_copy_index=0;
for (uint i=0; i < tab->ref.key_parts; i++)
{
@@ -1071,13 +1072,14 @@ JOIN::optimize()
{
*ref_item_ptr= ref_item;
Item *item= ref_item->real_item();
- store_key *key_copy= tab->ref.key_copy[i];
+ store_key *key_copy= tab->ref.key_copy[key_copy_index];
if (key_copy->type() == store_key::FIELD_STORE_KEY)
{
store_key_field *field_copy= ((store_key_field *)key_copy);
field_copy->change_source_field((Item_field *) item);
}
}
+ key_copy_index++;
}
}