summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-06-06 14:03:33 +0300
committerunknown <monty@mysql.com>2005-06-06 14:03:33 +0300
commitcdb905ead54b502d50bd86246939156c64556971 (patch)
treedeee57d7dfdc5e4fe96ecf429fde646229cd96e3 /sql/opt_sum.cc
parent4eb26350cbba8a636427d875304e9bfe0caac632 (diff)
downloadmariadb-git-cdb905ead54b502d50bd86246939156c64556971.tar.gz
Fixed wrong key length when using MIN() optimization (non fatal, but caused InnoDB to write warnings to the log file)
This fixed bug #11039: InnoDB: Warning: using a partial-field key prefix in search mysql-test/r/innodb.result: Added extra test for bug #11039: InnoDB: Warning: using a partial-field key prefix in search mysql-test/t/innodb.test: Added extra test for bug #11039: InnoDB: Warning: using a partial-field key prefix in search sql/opt_sum.cc: Fixed wrong key length when using MIN() optimization
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 ddeeb44c82b..33c8eadc065 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -677,7 +677,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
}