List:Commits« Previous MessageNext Message »
From:holyfoot Date:March 11 2007 1:46pm
Subject:bk commit into 5.1 tree (holyfoot:1.2477) BUG#26063
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of hf. When hf 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@stripped, 2007-03-11 17:46:15+04:00, holyfoot@stripped +3 -0
  Bug #26063 LIST partition not found for values which do not exist
  Failure appeared in get_part_id_charset_func_part() function
  (that was set as a part_info->get_patition_id) as it turns
  normal field values into some binary strings that supposed
  to be used for comparisons only. So that functions upon it
  (ASCII in this case) will behave inpredictable.
  set_up_partition_func_pointers() function fixed to set proper
  functions for LIST_PARTITION

  mysql-test/r/partition.result@stripped, 2007-03-11 17:46:13+04:00, holyfoot@stripped +19 -0
    result fixed

  mysql-test/t/partition.test@stripped, 2007-03-11 17:46:13+04:00, holyfoot@stripped +27 -0
    testcase

  sql/sql_partition.cc@stripped, 2007-03-11 17:46:13+04:00, holyfoot@stripped +2 -1
    we don't want these for LIST_PARTITION

# 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:	holyfoot
# Host:	hfmain.(none)
# Root:	/home/hf/work/26063/my51-26063

--- 1.58/mysql-test/r/partition.result	2007-03-11 17:46:20 +04:00
+++ 1.59/mysql-test/r/partition.result	2007-03-11 17:46:20 +04:00
@@ -1219,4 +1219,23 @@ SELECT t2.id FROM t2 WHERE t2.id IN (SEL
 id
 22589
 drop table t1, t2;
+create table t2 (country_name varchar(100), code2 char(2), code3 char(3), num int);
+insert into t2 values ('BRITISH INDIAN OCEAN TERRITORY','IO', 'IOT', 86);
+CREATE TABLE t1 (
+`country_code` CHAR( 2 ) NOT NULL ,
+`country_name` VARCHAR( 60 ) NULL ,
+`population` INT NULL ,
+PRIMARY KEY (`country_code`)
+) ENGINE = MYISAM CHARACTER SET latin1 COLLATE latin1_general_ci
+PARTITION BY LIST(ASCII(`country_code`)) (
+PARTITION p0    VALUES IN (NULL, 0, 72, 104, 74, 106, 79, 111, 81, 113, 87, 119),
+PARTITION p1    VALUES IN (65, 86, 118, 89, 121),
+/* ASCII codes.. */
+PARTITION p6    VALUES IN (69, 101, 70, 102), /* E and F */
+/* ASCII codes.. */
+PARTITION p17   VALUES IN (85, 117), /* USA */
+PARTITION p18   VALUES IN (90, 122, 73, 66, 75)
+);
+INSERT INTO t1 SELECT code2, country_name, 0 FROM t2;
+DROP TABLE t1, t2;
 End of 5.1 tests

--- 1.52/mysql-test/t/partition.test	2007-03-11 17:46:20 +04:00
+++ 1.53/mysql-test/t/partition.test	2007-03-11 17:46:20 +04:00
@@ -1463,4 +1463,31 @@ SELECT t2.id FROM t2 WHERE t2.id IN (SEL
 
 drop table t1, t2;
 
+#
+# Bug #26063 LIST partition not found for values which do not exist
+#
+
+create table t2 (country_name varchar(100), code2 char(2), code3 char(3), num int);
+insert into t2 values ('BRITISH INDIAN OCEAN TERRITORY','IO', 'IOT', 86);
+
+CREATE TABLE t1 (
+        `country_code` CHAR( 2 ) NOT NULL ,
+        `country_name` VARCHAR( 60 ) NULL ,
+        `population` INT NULL ,
+        PRIMARY KEY (`country_code`)
+) ENGINE = MYISAM CHARACTER SET latin1 COLLATE latin1_general_ci
+PARTITION BY LIST(ASCII(`country_code`)) (
+        PARTITION p0    VALUES IN (NULL, 0, 72, 104, 74, 106, 79, 111, 81, 113, 87, 119),
+        PARTITION p1    VALUES IN (65, 86, 118, 89, 121),
+        /* ASCII codes.. */
+        PARTITION p6    VALUES IN (69, 101, 70, 102), /* E and F */
+        /* ASCII codes.. */
+        PARTITION p17   VALUES IN (85, 117), /* USA */
+        PARTITION p18   VALUES IN (90, 122, 73, 66, 75)
+);
+
+INSERT INTO t1 SELECT code2, country_name, 0 FROM t2;
+
+DROP TABLE t1, t2;
+
 --echo End of 5.1 tests

--- 1.100/sql/sql_partition.cc	2007-03-11 17:46:20 +04:00
+++ 1.101/sql/sql_partition.cc	2007-03-11 17:46:20 +04:00
@@ -1344,7 +1344,8 @@ static void set_up_partition_func_pointe
       }
     }
   }
-  if (part_info->full_part_charset_field_array)
+  if ((part_info->full_part_charset_field_array) &&
+      (part_info->part_type != LIST_PARTITION))
   {
     DBUG_ASSERT(part_info->get_partition_id);
     part_info->get_partition_id_charset= part_info->get_partition_id;
Thread
bk commit into 5.1 tree (holyfoot:1.2477) BUG#26063holyfoot11 Mar