List:Internals« Previous MessageNext Message »
From:sinisa Date:December 9 2004 10:17pm
Subject:bk commit into 4.1 tree (Sinisa:1.2144)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of Sinisa. When Sinisa 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://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.2144 04/12/10 00:17:43 Sinisa@stripped +4 -0
  A fix for a crashing bug #7101, which occures when the 
  expression involving LEFT() function is used in GROUP BY
  field.

  sql/item_strfunc.h
    1.88 04/12/10 00:17:35 Sinisa@stripped +1 -0
    A fix for a crashing bug #7101, which occures when the 
    expression involving LEFT() function is used in GROUP BY
    field.

  sql/item_strfunc.cc
    1.200 04/12/10 00:17:35 Sinisa@stripped +3 -2
    A fix for a crashing bug #7101, which occures when the 
    expression involving LEFT() function is used in GROUP BY
    field.

  mysql-test/t/func_str.test
    1.61 04/12/10 00:17:35 Sinisa@stripped +8 -0
    Test case for bug #7101

  mysql-test/r/func_str.result
    1.76 04/12/10 00:17:35 Sinisa@stripped +6 -0
    A result for bug #7101 test case

# 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:	Sinisa
# Host:	sinisa.nasamreza.org
# Root:	/mnt/work/mysql-4.1

--- 1.199/sql/item_strfunc.cc	Mon Dec  6 18:33:12 2004
+++ 1.200/sql/item_strfunc.cc	Fri Dec 10 00:17:35 2004
@@ -955,8 +955,9 @@
   if (res->length() <= (uint) length ||
       res->length() <= (char_pos= res->charpos(length)))
     return res;
-  str_value.set(*res, 0, char_pos);
-  return &str_value;
+
+  tmp_value.set(*res, 0, char_pos);
+  return &tmp_value;
 }
 
 

--- 1.87/sql/item_strfunc.h	Thu Oct 28 09:43:24 2004
+++ 1.88/sql/item_strfunc.h	Fri Dec 10 00:17:35 2004
@@ -162,6 +162,7 @@
 
 class Item_func_left :public Item_str_func
 {
+  String tmp_value;
 public:
   Item_func_left(Item *a,Item *b) :Item_str_func(a,b) {}
   String *val_str(String *);

--- 1.75/mysql-test/r/func_str.result	Fri Nov 19 17:28:58 2004
+++ 1.76/mysql-test/r/func_str.result	Fri Dec 10 00:17:35 2004
@@ -685,3 +685,9 @@
 select left(1234, 3) + 0;
 left(1234, 3) + 0
 123
+create table t1 (a int not null primary key, b varchar(40), c datetime);
+insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now());
+select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12;
+total	reg
+10	2004-12-10
+drop table t1;

--- 1.60/mysql-test/t/func_str.test	Fri Nov 12 20:38:55 2004
+++ 1.61/mysql-test/t/func_str.test	Fri Dec 10 00:17:35 2004
@@ -421,3 +421,11 @@
 #
 
 select left(1234, 3) + 0;
+
+#
+# Bug #7101: bug with LEFT() when used as a field in GROUP BY aggregation
+#
+create table t1 (a int not null primary key, b varchar(40), c datetime);
+insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now()); 
+select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12;
+drop table t1;
Thread
bk commit into 4.1 tree (Sinisa:1.2144)sinisa9 Dec