List:Internals« Previous MessageNext Message »
From:sanja Date:July 1 2005 5:13pm
Subject:bk commit into 4.1 tree (bell:1.2329)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of bell. When bell 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.2329 05/07/01 20:13:07 bell@stripped +1 -0
  fixed create_distinct_group() to make references via ref_pointer_array

  sql/sql_select.cc
    1.417 05/07/01 20:12:32 bell@stripped +14 -5
    fixed create_distinct_group() to make references via ref_pointer_array

# 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:	bell
# Host:	sanja.is.com.ua
# Root:	/home/bell/mysql/bk/work-bug5-4.1

--- 1.416/sql/sql_select.cc	Tue Jun 28 13:23:59 2005
+++ 1.417/sql/sql_select.cc	Fri Jul  1 20:12:32 2005
@@ -134,8 +134,8 @@
 static bool cmp_buffer_with_ref(JOIN_TAB *tab);
 static bool setup_new_fields(THD *thd,TABLE_LIST *tables,List<Item> &fields,
 			     List<Item> &all_fields,ORDER *new_order);
-static ORDER *create_distinct_group(THD *thd, ORDER *order,
-				    List<Item> &fields,
+static ORDER *create_distinct_group(THD *thd, Item **ref_pointer_array,
+                                    ORDER *order, List<Item> &fields,
 				    bool *all_order_by_fields_used);
 static bool test_if_subpart(ORDER *a,ORDER *b);
 static TABLE *get_sort_by_table(ORDER *a,ORDER *b,TABLE_LIST *tables);
@@ -642,7 +642,8 @@
     bool all_order_fields_used;
     if (order)
       skip_sort_order= test_if_skip_sort_order(tab, order, select_limit, 1);
-    if ((group_list=create_distinct_group(thd, order, fields_list,
+    if ((group_list=create_distinct_group(thd, select_lex->ref_pointer_array,
+                                          order, fields_list,
 				          &all_order_fields_used)))
     {
       bool skip_group= (skip_sort_order &&
@@ -8440,12 +8441,14 @@
 */
 
 static ORDER *
-create_distinct_group(THD *thd, ORDER *order_list, List<Item> &fields, 
+create_distinct_group(THD *thd, Item **ref_pointer_array,
+                      ORDER *order_list, List<Item> &fields, 
 		      bool *all_order_by_fields_used)
 {
   List_iterator<Item> li(fields);
   Item *item;
   ORDER *order,*group,**prev;
+  uint index= 0;
 
   *all_order_by_fields_used= 1;
   while ((item=li++))
@@ -8477,11 +8480,17 @@
       ORDER *ord=(ORDER*) thd->calloc(sizeof(ORDER));
       if (!ord)
 	return 0;
-      ord->item=li.ref();
+      /*
+        We have here only field_list (not all_field_list), so we can use
+        simple indexing of ref_pointer_array (order in the array and in the
+        list are same)
+      */
+      ord->item= ref_pointer_array + index;
       ord->asc=1;
       *prev=ord;
       prev= &ord->next;
     }
+    index++;
   }
   *prev=0;
   return group;
Thread
bk commit into 4.1 tree (bell:1.2329)sanja1 Jul