summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorigor@linux.local <>2005-03-04 20:24:13 -0800
committerigor@linux.local <>2005-03-04 20:24:13 -0800
commit6d7862aeafa2376910c28dc27fc998b9675b5d16 (patch)
tree72f84de3e52863a097fb641a744c97492b1c6ea3 /sql/opt_sum.cc
parentd565920ba296bb13eafc1482bda58e2eebff029d (diff)
downloadmariadb-git-6d7862aeafa2376910c28dc27fc998b9675b5d16.tar.gz
logging_ok:
Logging to logging@openlogging.org accepted func_group.result, func_group.test: Added a test case for bug #8893. opt_sum.cc: A misplaced initialization for the returned parameter prefix_len in the function find_key_for_maxmin caused usage of a wrong key prefix by the min/max optimization in cases when the matching index was not the first index that contained the min/max field.
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 613b2a4aec1..4ab506cc4e1 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -624,7 +624,6 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
{
if (!(field->flags & PART_KEY_FLAG))
return 0; // Not key field
- *prefix_len= 0;
TABLE *table= field->table;
uint idx= 0;
@@ -637,6 +636,7 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
KEY_PART_INFO *part,*part_end;
key_part_map key_part_to_use= 0;
uint jdx= 0;
+ *prefix_len= 0;
for (part= keyinfo->key_part, part_end= part+keyinfo->key_parts ;
part != part_end ;
part++, jdx++, key_part_to_use= (key_part_to_use << 1) | 1)