List:Commits« Previous MessageNext Message »
From:tomas Date:March 1 2006 8:57am
Subject:bk commit into 5.1 tree (tomas:1.2211)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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.2211 06/03/01 09:57:36 tomas@stripped +2 -0
  Merge tulin@stripped:/home/bk/mysql-5.1-new
  into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new

  sql/sql_partition.cc
    1.44 06/03/01 09:57:27 tomas@stripped +0 -0
    Auto merged

  mysql-test/t/disabled.def
    1.88 06/03/01 09:57:27 tomas@stripped +0 -0
    Auto merged

# 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:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-new/RESYNC

--- 1.87/mysql-test/t/disabled.def	2006-02-28 17:51:20 +01:00
+++ 1.88/mysql-test/t/disabled.def	2006-03-01 09:57:27 +01:00
@@ -20,7 +20,7 @@
 ndb_load                : Bug#17233
 partition_03ndb         : Bug#16385
 ps_7ndb                 : dbug assert in RBR mode when executing test suite
-rpl_bit_npk             : Bug#13418
+#rpl_bit_npk             : Bug#13418
 rpl_ddl                 : Bug#15963 SBR does not show "Definer" correctly
 rpl_ndb_2innodb         : Bugs#17400: delete & update of rows in table without pk fails
 rpl_ndb_2myisam         : Bugs#17400: delete & update of rows in table without pk fails

--- 1.43/sql/sql_partition.cc	2006-02-28 17:51:20 +01:00
+++ 1.44/sql/sql_partition.cc	2006-03-01 09:57:27 +01:00
@@ -2343,6 +2343,29 @@
 
 
 /*
+  A function to handle correct handling of NULL values in partition
+  functions.
+  SYNOPSIS
+    part_val_int()
+    item_expr                 The item expression to evaluate
+  RETURN VALUES
+    The value of the partition function, LONGLONG_MIN if any null value
+    in function
+*/
+
+static
+inline
+longlong
+part_val_int(Item *item_expr)
+{
+  longlong value= item_expr->val_int();
+  if (item_expr->null_value)
+    value= LONGLONG_MIN;
+  return value;
+}
+
+
+/*
   The next set of functions are used to calculate the partition identity.
   A handler sets up a variable that corresponds to one of these functions
   to be able to quickly call it whenever the partition id needs to calculated
@@ -2438,7 +2461,7 @@
                                longlong *func_value)
 {
   DBUG_ENTER("get_part_id_hash");
-  *func_value= part_expr->val_int();
+  *func_value= part_val_int(part_expr);
   longlong int_hash_id= *func_value % no_parts;
   DBUG_RETURN(int_hash_id < 0 ? -int_hash_id : int_hash_id);
 }
@@ -2467,7 +2490,7 @@
 {
   DBUG_ENTER("get_part_id_linear_hash");
 
-  *func_value= part_expr->val_int();
+  *func_value= part_val_int(part_expr);
   DBUG_RETURN(get_part_id_from_linear_hash(*func_value,
                                            part_info->linear_hash_mask,
                                            no_parts));
@@ -2605,7 +2628,7 @@
   longlong list_value;
   int min_list_index= 0;
   int max_list_index= part_info->no_list_values - 1;
-  longlong part_func_value= part_info->part_expr->val_int();
+  longlong part_func_value= part_val_int(part_info->part_expr);
   DBUG_ENTER("get_partition_id_list");
 
   *func_value= part_func_value;
@@ -2681,7 +2704,7 @@
   longlong list_value;
   uint min_list_index= 0, max_list_index= part_info->no_list_values - 1;
   /* Get the partitioning function value for the endpoint */
-  longlong part_func_value= part_info->part_expr->val_int();
+  longlong part_func_value= part_val_int(part_info->part_expr);
   while (max_list_index >= min_list_index)
   {
     list_index= (max_list_index + min_list_index) >> 1;
@@ -2715,7 +2738,7 @@
   uint min_part_id= 0;
   uint max_part_id= max_partition;
   uint loc_part_id;
-  longlong part_func_value= part_info->part_expr->val_int();
+  longlong part_func_value= part_val_int(part_info->part_expr);
   DBUG_ENTER("get_partition_id_int_range");
 
   while (max_part_id > min_part_id)
@@ -2790,7 +2813,7 @@
   uint max_partition= part_info->no_parts - 1;
   uint min_part_id= 0, max_part_id= max_partition, loc_part_id;
   /* Get the partitioning function value for the endpoint */
-  longlong part_func_value= part_info->part_expr->val_int();
+  longlong part_func_value= part_val_int(part_info->part_expr);
   while (max_part_id > min_part_id)
   {
     loc_part_id= (max_part_id + min_part_id + 1) >> 1;
Thread
bk commit into 5.1 tree (tomas:1.2211)tomas1 Mar