summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorevgen@moonbone.local <>2005-09-19 04:39:49 +0400
committerevgen@moonbone.local <>2005-09-19 04:39:49 +0400
commitafa8187fb77f72fbc767ae112bc8050c51afc398 (patch)
tree99cb88180f99dd6a11a0234bd5077c86e91eb3ad /sql/opt_sum.cc
parent15bf8f6adadd31ea09f879e0656e37809eea3ca3 (diff)
downloadmariadb-git-afa8187fb77f72fbc767ae112bc8050c51afc398.tar.gz
Fix bug #13218: InnoDB: using a partial-field key prefix in search
This is backport from 5.0 of fix for bug #11039
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 4ab506cc4e1..cb8e3c2d273 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -661,7 +661,8 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
If key_part2 may be NULL, then we want to find the first row
that is not null
*/
- ref->key_buff[ref->key_length++]= 1;
+ ref->key_buff[ref->key_length]= 1;
+ ref->key_length+= part->store_length;
*range_fl&= ~NO_MIN_RANGE;
*range_fl|= NEAR_MIN; // > NULL
}