List:Commits« Previous MessageNext Message »
From:eugene Date:July 25 2006 8:37pm
Subject:bk commit into 5.0 tree (evgen:1.2217)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen 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, 2006-07-26 00:37:35+04:00, evgen@stripped +2 -0
  Merge epotemkin@stripped:/home/bk/mysql-5.0-opt
  into  moonbone.local:/work/19862-bug-5.0-opt-mysql
  MERGE: 1.2207.2.1

  sql/item_func.h@stripped, 2006-07-26 00:37:32+04:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.141.1.1

  sql/sql_select.cc@stripped, 2006-07-26 00:37:32+04:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.434.2.1

# 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:	evgen
# Host:	moonbone.local
# Root:	/work/19862-bug-5.0-opt-mysql/RESYNC

--- 1.142/sql/item_func.h	2006-07-26 00:37:39 +04:00
+++ 1.143/sql/item_func.h	2006-07-26 00:37:39 +04:00
@@ -55,7 +55,7 @@
                   NOT_FUNC, NOT_ALL_FUNC,
                   NOW_FUNC, TRIG_COND_FUNC,
                   GUSERVAR_FUNC, COLLATE_FUNC,
-                  EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP };
+                  EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP, UDF_FUNC };
   enum optimize_type { OPTIMIZE_NONE,OPTIMIZE_KEY,OPTIMIZE_OP, OPTIMIZE_NULL,
                        OPTIMIZE_EQUAL };
   enum Type type() const { return FUNC_ITEM; }
@@ -189,6 +189,7 @@
   Item *transform(Item_transformer transformer, byte *arg);
   void traverse_cond(Cond_traverser traverser,
                      void * arg, traverse_order order);
+  bool func_type_checker_processor(byte *arg);
 };
 
 
@@ -933,6 +934,7 @@
   Item_udf_func(udf_func *udf_arg, List<Item> &list)
     :Item_func(list), udf(udf_arg) {}
   const char *func_name() const { return udf.name(); }
+  enum Functype functype() const   { return UDF_FUNC; }
   bool fix_fields(THD *thd, Item **ref)
   {
     DBUG_ASSERT(fixed == 0);

--- 1.437/sql/sql_select.cc	2006-07-26 00:37:39 +04:00
+++ 1.438/sql/sql_select.cc	2006-07-26 00:37:39 +04:00
@@ -1064,6 +1064,26 @@
     {
       need_tmp=1; simple_order=simple_group=0;	// Force tmp table without sort
     }
+    if (order)
+    {
+      /*
+        Force using of tmp table if sorting by a SP or UDF function due to
+        their expensive and probably non-deterministic nature.
+      */
+      for (ORDER *tmp_order= order; tmp_order ; tmp_order=tmp_order->next)
+      {
+        Item *item= *tmp_order->item;
+        Item_func::Functype type=Item_func::FUNC_SP;
+        Item_func::Functype type1=Item_func::UDF_FUNC;
+        if (item->walk(&Item::func_type_checker_processor,(byte*)&type) ||
+            item->walk(&Item::func_type_checker_processor,(byte*)&type1))
+        {
+          /* Force tmp table without sort */
+          need_tmp=1; simple_order=simple_group=0;
+          break;
+        }
+      }
+    }
   }
 
   tmp_having= having;
Thread
bk commit into 5.0 tree (evgen:1.2217)eugene25 Jul