List:Commits« Previous MessageNext Message »
From:reggie Date:March 10 2006 2:07pm
Subject:bk commit into 5.1 tree (reggie:1.2169) BUG#17894
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of . When  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.2169 06/03/10 08:07:11 reggie@big_geek. +5 -0
  bug #17173 - 
  bug #17894 - 
  These bugs are related to less than operator.  The issue is that the
  function store_key_image_to_rec is called twice for a query such as
  field < n.  The first call is for null and this works.  the second is
  for the constant n.  It properly stores the value into the rec buffer
  but fails to clear the null bit on the field.

  sql/opt_range.cc
    1.206 06/03/10 07:55:55 reggie@big_geek. +1 -0
    set the field to non-null if the field could be null but is not

  mysql-test/t/partition_range.test
    1.5 06/03/10 07:55:54 reggie@big_geek. +26 -0
    test block for bug #17894

  mysql-test/t/partition_list.test
    1.4 06/03/10 07:55:53 reggie@big_geek. +13 -0
    test block for bug #17173

  mysql-test/r/partition_range.result
    1.7 06/03/10 07:55:52 reggie@big_geek. +26 -0
    result block for bug #17894

  mysql-test/r/partition_list.result
    1.4 06/03/10 07:55:51 reggie@big_geek. +11 -0
    result block for bug #17173

# 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:	reggie
# Host:	big_geek.
# Root:	C:/Work/mysql/mysql-5.1-bug17173

--- 1.205/sql/opt_range.cc	2006-02-25 12:35:08 -06:00
+++ 1.206/sql/opt_range.cc	2006-03-10 07:55:55 -06:00
@@ -2430,6 +2430,7 @@
       field->set_null();
       return;
     }
+    field->set_notnull();
     ptr++;
   }    
   field->set_key_image(ptr, len); 

--- 1.3/mysql-test/r/partition_list.result	2005-12-15 10:56:08 -06:00
+++ 1.4/mysql-test/r/partition_list.result	2006-03-10 07:55:51 -06:00
@@ -180,3 +180,14 @@
 partition by list (a)
 (partition x1 values in (1,2,9,4) tablespace ts1);
 drop table t1;
+CREATE TABLE t1 (s1 int) PARTITION BY LIST (s1) 
+(PARTITION p1 VALUES IN (1),
+PARTITION p2 VALUES IN (2),
+PARTITION p3 VALUES IN (3),
+PARTITION p4 VALUES IN (4),
+PARTITION p5 VALUES IN (5));
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+SELECT COUNT(*) FROM t1 WHERE s1 < 3;
+COUNT(*)
+2
+DROP TABLE t1;

--- 1.6/mysql-test/r/partition_range.result	2006-02-22 03:09:50 -06:00
+++ 1.7/mysql-test/r/partition_range.result	2006-03-10 07:55:52 -06:00
@@ -337,3 +337,29 @@
 1	1	1
 4	1	1
 drop table t1;
+CREATE TABLE t1 (c1 int default NULL, c2 varchar(30) default NULL, 
+c3 date default NULL) engine=myisam
+PARTITION BY RANGE (year(c3)) (PARTITION p0 VALUES LESS THAN (1995),
+PARTITION p1 VALUES LESS THAN (1996) , PARTITION p2 VALUES LESS THAN (1997) ,
+PARTITION p3 VALUES LESS THAN (1998) , PARTITION p4 VALUES LESS THAN (1999) ,
+PARTITION p5 VALUES LESS THAN (2000) , PARTITION p6 VALUES LESS THAN (2001) ,
+PARTITION p7 VALUES LESS THAN (2002) , PARTITION p8 VALUES LESS THAN (2003) ,
+PARTITION p9 VALUES LESS THAN (2004) , PARTITION p10 VALUES LESS THAN (2010),
+PARTITION p11 VALUES LESS THAN MAXVALUE );
+INSERT INTO t1 VALUES (1, 'testing partitions', '1995-07-17'),
+(3, 'testing partitions','1995-07-31'),
+(5, 'testing partitions','1995-08-13'),
+(7, 'testing partitions','1995-08-26'),
+(9, 'testing partitions','1995-09-09'),
+(0, 'testing partitions','2000-07-10'),
+(2, 'testing partitions','2000-07-23'),
+(4, 'testing partitions','2000-08-05'),
+(6, 'testing partitions','2000-08-19'),
+(8, 'testing partitions','2000-09-01');
+SELECT COUNT(*) FROM t1 WHERE c3 BETWEEN '1996-12-31' AND '2000-12-31';
+COUNT(*)
+5
+SELECT COUNT(*) FROM t1 WHERE c3 < '2000-12-31';
+COUNT(*)
+10
+DROP TABLE t1;

--- 1.3/mysql-test/t/partition_list.test	2005-12-15 10:56:08 -06:00
+++ 1.4/mysql-test/t/partition_list.test	2006-03-10 07:55:53 -06:00
@@ -110,3 +110,16 @@
 (partition x1 values in (1,2,9,4) tablespace ts1);
 
 drop table t1;
+
+#
+#Bug #17173 Partitions: less-than search fails 
+#
+CREATE TABLE t1 (s1 int) PARTITION BY LIST (s1) 
+(PARTITION p1 VALUES IN (1),
+PARTITION p2 VALUES IN (2),
+PARTITION p3 VALUES IN (3),
+PARTITION p4 VALUES IN (4),
+PARTITION p5 VALUES IN (5));
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+SELECT COUNT(*) FROM t1 WHERE s1 < 3;
+DROP TABLE t1;

--- 1.4/mysql-test/t/partition_range.test	2005-12-15 10:56:08 -06:00
+++ 1.5/mysql-test/t/partition_range.test	2006-03-10 07:55:54 -06:00
@@ -361,3 +361,29 @@
 SELECT * from t1;
 
 drop table t1;
+
+#
+# Bug #17894 Comparison with "less than" operator fails with Range partition 
+#
+CREATE TABLE t1 (c1 int default NULL, c2 varchar(30) default NULL, 
+c3 date default NULL) engine=myisam
+PARTITION BY RANGE (year(c3)) (PARTITION p0 VALUES LESS THAN (1995),
+PARTITION p1 VALUES LESS THAN (1996) , PARTITION p2 VALUES LESS THAN (1997) ,
+PARTITION p3 VALUES LESS THAN (1998) , PARTITION p4 VALUES LESS THAN (1999) ,
+PARTITION p5 VALUES LESS THAN (2000) , PARTITION p6 VALUES LESS THAN (2001) ,
+PARTITION p7 VALUES LESS THAN (2002) , PARTITION p8 VALUES LESS THAN (2003) ,
+PARTITION p9 VALUES LESS THAN (2004) , PARTITION p10 VALUES LESS THAN (2010),
+PARTITION p11 VALUES LESS THAN MAXVALUE );
+INSERT INTO t1 VALUES (1, 'testing partitions', '1995-07-17'),
+(3, 'testing partitions','1995-07-31'),
+(5, 'testing partitions','1995-08-13'),
+(7, 'testing partitions','1995-08-26'),
+(9, 'testing partitions','1995-09-09'),
+(0, 'testing partitions','2000-07-10'),
+(2, 'testing partitions','2000-07-23'),
+(4, 'testing partitions','2000-08-05'),
+(6, 'testing partitions','2000-08-19'),
+(8, 'testing partitions','2000-09-01');
+SELECT COUNT(*) FROM t1 WHERE c3 BETWEEN '1996-12-31' AND '2000-12-31';
+SELECT COUNT(*) FROM t1 WHERE c3 < '2000-12-31';
+DROP TABLE t1;

Thread
bk commit into 5.1 tree (reggie:1.2169) BUG#17894reggie10 Mar