List:Commits« Previous MessageNext Message »
From:Ignacio Galarza Date:November 30 2006 2:43pm
Subject:bk commit into 5.1 tree (iggy:1.2350)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of iggy. When iggy 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-11-30 09:43:52-05:00, iggy@stripped +4 -0
  Merge rolltop.ignatz42.dyndns.org:/mnt/storeage/bug20836/my50-bug20836
  into  rolltop.ignatz42.dyndns.org:/mnt/storeage/bug20836/my51-bug20836
  MERGE: 1.1810.1698.173

  mysql-test/r/distinct.result@stripped, 2006-11-30 09:38:37-05:00, iggy@stripped +0 -0
    Auto merged
    MERGE: 1.46.1.2

  mysql-test/t/disabled.def@stripped, 2006-11-30 09:43:49-05:00, iggy@stripped +0 -0
    SCCS merged
    MERGE: 1.2.4.15

  sql/sql_class.cc@stripped, 2006-11-30 09:38:38-05:00, iggy@stripped +0 -0
    Auto merged
    MERGE: 1.223.1.32

  sql/sql_class.h@stripped, 2006-11-30 09:38:38-05:00, iggy@stripped +0 -0
    Auto merged
    MERGE: 1.230.1.79

# 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:	iggy
# Host:	rolltop.ignatz42.dyndns.org
# Root:	/mnt/storeage/bug20836/my51-bug20836/RESYNC

--- 1.295/sql/sql_class.cc	2006-11-30 09:43:58 -05:00
+++ 1.296/sql/sql_class.cc	2006-11-30 09:43:58 -05:00
@@ -1613,53 +1613,21 @@ bool select_exists_subselect::send_data(
 
 int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
 {
-  List_iterator_fast<Item> li(list);
-  List_iterator_fast<my_var> gl(var_list);
-  Item *item;
-
-  local_vars.empty();				// Clear list if SP
   unit= u;
-  row_count= 0;
-
+  
   if (var_list.elements != list.elements)
   {
     my_message(ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT,
                ER(ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT), MYF(0));
     return 1;
-  }
-  while ((item=li++))
-  {
-    my_var *mv= gl++;
-    if (mv->local)
-    {
-      Item_splocal *var= new Item_splocal(mv->s, mv->offset, mv->type);
-      (void)local_vars.push_back(var);
-#ifndef DBUG_OFF
-      var->m_sp= mv->sp;
-#endif
-    }
-    else
-    {
-      Item_func_set_user_var *var= new Item_func_set_user_var(mv->s, item);
-      /*
-        Item_func_set_user_var can't substitute something else on its place =>
-        0 can be passed as last argument (reference on item)
-        Item_func_set_user_var can't be fixed after creation, so we do not
-        check var->fixed
-      */
-      var->fix_fields(thd, 0);
-      var->fix_length_and_dec();
-      vars.push_back(var);
-    }
-  }
+  }               
   return 0;
 }
 
 
 void select_dumpvar::cleanup()
 {
-  vars.empty();
-  row_count=0;
+  row_count= 0;
 }
 
 
@@ -1968,13 +1936,10 @@ Statement_map::~Statement_map()
 
 bool select_dumpvar::send_data(List<Item> &items)
 {
-  List_iterator_fast<Item_func_set_user_var> li(vars);
-  List_iterator_fast<Item_splocal> var_li(local_vars);
-  List_iterator_fast<my_var> my_li(var_list);
+  List_iterator_fast<my_var> var_li(var_list);
   List_iterator<Item> it(items);
-  Item_func_set_user_var *xx;
-  Item_splocal *yy;
-  my_var *zz;
+  Item *item;
+  my_var *mv;
   DBUG_ENTER("select_dumpvar::send_data");
 
   if (unit->offset_limit_cnt)
@@ -1987,24 +1952,27 @@ bool select_dumpvar::send_data(List<Item
     my_message(ER_TOO_MANY_ROWS, ER(ER_TOO_MANY_ROWS), MYF(0));
     DBUG_RETURN(1);
   }
-  while ((zz=my_li++) && (it++))
+  while ((mv= var_li++) && (item= it++))
   {
-    if (zz->local)
+    if (mv->local)
     {
-      if ((yy=var_li++)) 
-      {
-	if (thd->spcont->set_variable(current_thd, yy->get_var_idx(),
-                                      it.ref()))
-	  DBUG_RETURN(1);
-      }
+      if (thd->spcont->set_variable(thd, mv->offset, &item))
+	    DBUG_RETURN(1);
     }
     else
     {
-      if ((xx=li++))
-      {
-        xx->check(0);
-	xx->update();
-      }
+      Item_func_set_user_var *suv= new Item_func_set_user_var(mv->s, item);
+
+      /*
+        Item_func_set_user_var can't substitute something else on its
+        place => NULL may be passed as last argument (reference on
+        item) Item_func_set_user_var can't be fixed after creation, so
+        we do not check var->fixed
+      */
+
+      suv->fix_fields(thd, 0);
+      suv->check(0);
+      suv->update();
     }
   }
   DBUG_RETURN(0);

--- 1.326/sql/sql_class.h	2006-11-30 09:43:58 -05:00
+++ 1.327/sql/sql_class.h	2006-11-30 09:43:58 -05:00
@@ -2170,9 +2170,7 @@ class select_dumpvar :public select_resu
   ha_rows row_count;
 public:
   List<my_var> var_list;
-  List<Item_func_set_user_var> vars;
-  List<Item_splocal> local_vars;
-  select_dumpvar(void)  { var_list.empty(); local_vars.empty(); vars.empty(); row_count=0;}
+  select_dumpvar()  { var_list.empty(); row_count= 0;}
   ~select_dumpvar() {}
   int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
   bool send_data(List<Item> &items);

--- 1.210/mysql-test/t/disabled.def	2006-11-30 09:43:58 -05:00
+++ 1.211/mysql-test/t/disabled.def	2006-11-30 09:43:58 -05:00
@@ -10,7 +10,7 @@
 #
 ##############################################################################
 user_limits     : Bug#23921 random failure of user_limits.test
-
+distinct        : Bug#16861
 im_options                : Bug#20294 2006-07-24 stewart   Instance manager test im_options fails randomly
 concurrent_innodb        : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
 ndb_autodiscover         : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog

--- 1.48/mysql-test/r/distinct.result	2006-11-30 09:43:58 -05:00
+++ 1.49/mysql-test/r/distinct.result	2006-11-30 09:43:58 -05:00
@@ -607,3 +607,62 @@ id	select_type	table	type	possible_keys	
 SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a;
 a	a
 DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (id INT NOT NULL, fruit_id INT NOT NULL, fruit_name varchar(20)
+default NULL);
+INSERT INTO t1 VALUES (1,1,'ORANGE');
+INSERT INTO t1 VALUES (2,2,'APPLE');
+INSERT INTO t1 VALUES (3,2,'APPLE');
+INSERT INTO t1 VALUES (4,3,'PEAR');
+SELECT DISTINCT fruit_id, fruit_name INTO @v1, @v2 FROM t1 WHERE fruit_name = 
+'APPLE';
+SELECT @v1, @v2;
+@v1	@v2
+2	APPLE
+SELECT DISTINCT fruit_id, fruit_name INTO @v3, @v4 FROM t1 GROUP BY fruit_id, 
+fruit_name HAVING fruit_name = 'APPLE';
+SELECT @v3, @v4;
+@v3	@v4
+2	APPLE
+SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE 
+fruit_name = 'APPLE';
+SELECT @v5, @v6, @v7, @v8;
+@v5	@v6	@v7	@v8
+2	APPLE	2	APPLE
+SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1 
+WHERE fruit_name = 'APPLE';
+SELECT @v5, @v6, @v7, @v8, @v9, @v10;
+@v5	@v6	@v7	@v8	@v9	@v10
+2	APPLE	2	APPLE	4	APPLEAPPLE
+SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO 
+@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE';
+SELECT @v11, @v12, @v13, @v14;
+@v11	@v12	@v13	@v14
+4	APPLEAPPLE	4	APPLEAPPLE
+SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
+SELECT @v15, @v16;
+@v15	@v16
+4	APPLEAPPLE
+SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name = 
+'APPLE';
+SELECT @v17, @v18;
+@v17	@v18
+4	Bob
+DROP TABLE IF EXISTS t2;
+CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
+default NULL);
+SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE 
+'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
+LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2;
+SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE 
+'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
+LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2;
+SELECT @v19, @v20;
+@v19	@v20
+2	APPLE
+SELECT * FROM t2;
+fruit_id	fruit_name
+2	APPLE
+2	APPLE
+DROP TABLE t1;
+DROP TABLE t2;
Thread
bk commit into 5.1 tree (iggy:1.2350)Ignacio Galarza30 Nov