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
This commit is contained in:
unknown 2005-06-06 14:03:33 +03:00
commit cdb905ead5
3 changed files with 21 additions and 1 deletions

View file

@ -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
}