From 6d7862aeafa2376910c28dc27fc998b9675b5d16 Mon Sep 17 00:00:00 2001 From: "igor@linux.local" <> Date: Fri, 4 Mar 2005 20:24:13 -0800 Subject: 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/opt_sum.cc') 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) -- cgit v1.2.1