List:Internals« Previous MessageNext Message »
From:monty Date:June 6 2005 1:03pm
Subject:bk commit into 5.0 tree (monty:1.1917) BUG#11039
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of monty. When monty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1917 05/06/06 14:03:33 monty@stripped +3 -0
  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

  sql/opt_sum.cc
    1.44 05/06/06 14:03:28 monty@stripped +2 -1
    Fixed wrong key length when using MIN() optimization

  mysql-test/t/innodb.test
    1.89 05/06/06 14:03:28 monty@stripped +10 -0
    Added extra test for bug #11039: InnoDB: Warning: using a partial-field key prefix in
search

  mysql-test/r/innodb.result
    1.112 05/06/06 14:03:28 monty@stripped +9 -0
    Added extra test for bug #11039: InnoDB: Warning: using a partial-field key prefix in
search

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	monty
# Host:	narttu.mysql.com
# Root:	/home/my/mysql-5.0

--- 1.43/sql/opt_sum.cc	2005-05-06 11:39:16 +03:00
+++ 1.44/sql/opt_sum.cc	2005-06-06 14:03:28 +03:00
@@ -677,7 +677,8 @@
               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
           }

--- 1.111/mysql-test/r/innodb.result	2005-05-14 18:19:31 +03:00
+++ 1.112/mysql-test/r/innodb.result	2005-06-06 14:03:28 +03:00
@@ -2401,3 +2401,12 @@
 SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
 ERROR HY000: The used table type doesn't support FULLTEXT indexes
 DROP TABLE t1;
+create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
+insert into t1 values ('8', '6'), ('4', '7');
+select min(a) from t1;
+min(a)
+4
+select min(b) from t1 where a='8';
+min(b)
+6
+drop table t1;

--- 1.88/mysql-test/t/innodb.test	2005-05-14 18:19:54 +03:00
+++ 1.89/mysql-test/t/innodb.test	2005-06-06 14:03:28 +03:00
@@ -1319,3 +1319,13 @@
 --error 1214;
 SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
 DROP TABLE t1;
+
+#
+# BUG#11039 Wrong key length in min()
+#
+
+create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
+insert into t1 values ('8', '6'), ('4', '7');
+select min(a) from t1;
+select min(b) from t1 where a='8';
+drop table t1;
Thread
bk commit into 5.0 tree (monty:1.1917) BUG#11039monty6 Jun