List:Commits« Previous MessageNext Message »
From:Sergey Petrunia Date:January 25 2006 3:02am
Subject:bk commit into 5.1 tree (sergefp:1.2077)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of psergey. When psergey 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.2077 06/01/25 06:01:54 sergefp@stripped +2 -0
  Compile failure fix for gcc 2.95x: Don't use unnamed union of unnamed 
  structs in PARTITION_ITERATOR

  sql/sql_partition.cc
    1.26 06/01/25 06:01:48 sergefp@stripped +18 -18
    Compile failure fix for gcc 2.95x: Don't use unnamed union of unnamed 
    structs in PARTITION_ITERATOR

  sql/handler.h
    1.181 06/01/25 06:01:48 sergefp@stripped +20 -14
    Compile failure fix for gcc 2.95x: Don't use unnamed union of unnamed 
    structs in PARTITION_ITERATOR

# 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:	sergefp
# Host:	pylon.mylan
# Root:	/home/psergey/mysql-5.1-wl2985-postfixes

--- 1.180/sql/handler.h	2006-01-20 19:38:06 +03:00
+++ 1.181/sql/handler.h	2006-01-25 06:01:48 +03:00
@@ -737,17 +737,23 @@
 typedef struct st_partition_iter
 {
   partition_iter_func get_next;
+  
+  struct st_part_num_range
+  {
+    uint32 start;
+    uint32 end;
+  };
 
-  union {
-    struct {
-      uint32 start_part_num;
-      uint32 end_part_num;
-    };
-    struct {
-      longlong start_val;
-      longlong end_val;
-    };
-    bool null_returned;
+  struct st_field_value_range
+  {
+    longlong start;
+    longlong end;
+  };
+
+  union
+  {
+    struct st_part_num_range     part_nums;
+    struct st_field_value_range  field_vals;
   };
   partition_info *part_info;
 } PARTITION_ITERATOR;
@@ -1004,8 +1010,8 @@
 inline void init_single_partition_iterator(uint32 part_id,
                                            PARTITION_ITERATOR *part_iter)
 {
-  part_iter->start_part_num= part_id;
-  part_iter->end_part_num= part_id+1;
+  part_iter->part_nums.start= part_id;
+  part_iter->part_nums.end= part_id+1;
   part_iter->get_next= get_next_partition_id_range;
 }
 
@@ -1013,8 +1019,8 @@
 void init_all_partitions_iterator(partition_info *part_info,
                                   PARTITION_ITERATOR *part_iter)
 {
-  part_iter->start_part_num= 0;
-  part_iter->end_part_num= part_info->no_parts;
+  part_iter->part_nums.start= 0;
+  part_iter->part_nums.end= part_info->no_parts;
   part_iter->get_next= get_next_partition_id_range;
 }
 

--- 1.25/sql/sql_partition.cc	2006-01-19 16:37:45 +03:00
+++ 1.26/sql/sql_partition.cc	2006-01-25 06:01:48 +03:00
@@ -5751,7 +5751,7 @@
 
   /* Find minimum */
   if (flags & NO_MIN_RANGE)
-    part_iter->start_part_num= 0;
+    part_iter->part_nums.start= 0;
   else
   {
     /*
@@ -5763,21 +5763,21 @@
     store_key_image_to_rec(field, min_value, field_len);
     bool include_endp= part_info->range_analysis_include_bounds ||
                        !test(flags & NEAR_MIN);
-    part_iter->start_part_num= get_endpoint(part_info, 1, include_endp);
-    if (part_iter->start_part_num == max_endpoint_val)
+    part_iter->part_nums.start= get_endpoint(part_info, 1, include_endp);
+    if (part_iter->part_nums.start == max_endpoint_val)
       return 0; /* No partitions */
   }
 
   /* Find maximum, do the same as above but for right interval bound */
   if (flags & NO_MAX_RANGE)
-    part_iter->end_part_num= max_endpoint_val;
+    part_iter->part_nums.end= max_endpoint_val;
   else
   {
     store_key_image_to_rec(field, max_value, field_len);
     bool include_endp= part_info->range_analysis_include_bounds ||
                        !test(flags & NEAR_MAX);
-    part_iter->end_part_num= get_endpoint(part_info, 0, include_endp);
-    if (part_iter->start_part_num == part_iter->end_part_num)
+    part_iter->part_nums.end= get_endpoint(part_info, 0, include_endp);
+    if (part_iter->part_nums.start== part_iter->part_nums.end)
       return 0; /* No partitions */
   }
   return 1; /* Ok, iterator initialized */
@@ -5907,8 +5907,8 @@
   if (n_values > total_parts || n_values > MAX_RANGE_TO_WALK)
     return -1;
 
-  part_iter->start_val= a;
-  part_iter->end_val=   b;
+  part_iter->field_vals.start= a;
+  part_iter->field_vals.end=   b;
   part_iter->part_info= part_info;
   part_iter->get_next=  get_next_func;
   return 1;
@@ -5933,10 +5933,10 @@
 
 uint32 get_next_partition_id_range(PARTITION_ITERATOR* part_iter)
 {
-  if (part_iter->start_part_num == part_iter->end_part_num)
+  if (part_iter->part_nums.start== part_iter->part_nums.end)
     return NOT_A_PARTITION_ID;
   else
-    return part_iter->start_part_num++;
+    return part_iter->part_nums.start++;
 }
 
 
@@ -5959,11 +5959,11 @@
 
 uint32 get_next_partition_id_list(PARTITION_ITERATOR *part_iter)
 {
-  if (part_iter->start_part_num == part_iter->end_part_num)
+  if (part_iter->part_nums.start == part_iter->part_nums.end)
     return NOT_A_PARTITION_ID;
   else
     return part_iter->part_info->list_array[part_iter->
-                                            start_part_num++].partition_id;
+                                            part_nums.start++].partition_id;
 }
 
 
@@ -5988,10 +5988,10 @@
 {
   uint32 part_id;
   Field *field= part_iter->part_info->part_field_array[0];
-  while (part_iter->start_val != part_iter->end_val)
+  while (part_iter->field_vals.start != part_iter->field_vals.end)
   {
-    field->store(part_iter->start_val, FALSE);
-    part_iter->start_val++;
+    field->store(part_iter->field_vals.start, FALSE);
+    part_iter->field_vals.start++;
     longlong dummy;
     if (!part_iter->part_info->get_partition_id(part_iter->part_info, 
                                                 &part_id, &dummy))
@@ -6007,10 +6007,10 @@
 {
   uint32 part_id;
   Field *field= part_iter->part_info->subpart_field_array[0];
-  if (part_iter->start_val == part_iter->end_val)
+  if (part_iter->field_vals.start == part_iter->field_vals.end)
     return NOT_A_PARTITION_ID;
-  field->store(part_iter->start_val, FALSE);
-  part_iter->start_val++;
+  field->store(part_iter->field_vals.start, FALSE);
+  part_iter->field_vals.start++;
   return part_iter->part_info->get_subpartition_id(part_iter->part_info);
 }
 #endif
Thread
bk commit into 5.1 tree (sergefp:1.2077)Sergey Petrunia25 Jan