summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorunknown <igor@linux.local>2005-03-04 20:24:13 -0800
committerunknown <igor@linux.local>2005-03-04 20:24:13 -0800
commitf1c81bf66960527140d6fe4251ded1a818a3a45e (patch)
tree72f84de3e52863a097fb641a744c97492b1c6ea3 /sql/opt_sum.cc
parent58002dddc105f9f87e03bdaa67574d16c8673423 (diff)
downloadmariadb-git-f1c81bf66960527140d6fe4251ded1a818a3a45e.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. sql/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. mysql-test/t/func_group.test: Added a test case for bug #8893. mysql-test/r/func_group.result: Added a test case for bug #8893. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
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)