List:Commits« Previous MessageNext Message »
From:mhansson Date:May 8 2007 11:29am
Subject:bk commit into 5.0 tree (mhansson:1.2479) BUG#28273
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of martin. When martin 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, 2007-05-08 14:29:03+03:00, mhansson@stripped +4 -0
  bug#28273: GROUP_CONCAT and ORDER BY: No warning when result gets truncated.
  
  When using GROUP_CONCAT with order by, a tree is used for the sorting,
  instead of normal nested loops join. But the code that outputs the warning was
  before the call to traverse the tree. Hence, there's no warning if the output 
  gets trimmed to GROUP_CONCAT_MAX_LEN in this case.

  BitKeeper/etc/ignore@stripped, 2007-05-08 14:28:58+03:00, mhansson@stripped +8 -0
    Added cscope.files cscope.in.out cscope.out cscope.po.out debian/control debian/defs.mk include/abi_check mysql-test/t1 to the ignore list

  mysql-test/r/func_gconcat.result@stripped, 2007-05-08 14:28:57+03:00, mhansson@stripped +24 -0
    bug#28273: correct result

  mysql-test/t/func_gconcat.test@stripped, 2007-05-08 14:28:57+03:00, mhansson@stripped +12 -0
    bug#28273: test case

  sql/item_sum.cc@stripped, 2007-05-08 14:28:57+03:00, mhansson@stripped +4 -5
    bug#28273: the fix
    
    Moved the code that outputs a warning to after temporary table (tree) is traversed. 

# 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:	mhansson
# Host:	linux-st28.site
# Root:	/home/martin/mysql/src/5.0o-5.0o-bug28273

--- 1.206/sql/item_sum.cc	2007-04-26 11:15:58 +03:00
+++ 1.207/sql/item_sum.cc	2007-05-08 14:28:57 +03:00
@@ -3339,6 +3339,10 @@ String* Item_func_group_concat::val_str(
   DBUG_ASSERT(fixed == 1);
   if (null_value)
     return 0;
+  if (!result.length() && tree)
+    /* Tree is used for sorting as in ORDER BY */
+    tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this,
+              left_root_right);
   if (count_cut_values && !warning)
   {
     /*
@@ -3350,11 +3354,6 @@ String* Item_func_group_concat::val_str(
                           ER_CUT_VALUE_GROUP_CONCAT,
                           ER(ER_CUT_VALUE_GROUP_CONCAT));
   }
-  if (result.length())
-    return &result;
-  if (tree)
-    tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this,
-              left_root_right);
   return &result;
 }
 

--- 1.247/BitKeeper/etc/ignore	2007-04-23 22:41:22 +03:00
+++ 1.248/BitKeeper/etc/ignore	2007-05-08 14:28:58 +03:00
@@ -1342,3 +1342,11 @@ win/vs71cache.txt
 win/vs8cache.txt
 zlib/*.ds?
 zlib/*.vcproj
+cscope.files
+cscope.in.out
+cscope.out
+cscope.po.out
+debian/control
+debian/defs.mk
+include/abi_check
+mysql-test/t1

--- 1.68/mysql-test/r/func_gconcat.result	2007-03-29 19:20:02 +03:00
+++ 1.69/mysql-test/r/func_gconcat.result	2007-05-08 14:28:57 +03:00
@@ -737,4 +737,28 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(b)) F
 GROUP_CONCAT(DISTINCT UCASE(b))
 ONE.1,TWO.2,ONE.3
 DROP TABLE t1;
+CREATE TABLE t1( a VARCHAR( 10 ), b INT );
+INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1), 
+( repeat( 'b', 10 ), 2);
+SET GROUP_CONCAT_MAX_LEN = 20;
+SELECT GROUP_CONCAT( a ) FROM t1;
+GROUP_CONCAT( a )
+aaaaaaaaaa,bbbbbbbbb
+Warnings:
+Warning	1260	1 line(s) were cut by GROUP_CONCAT()
+SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;
+GROUP_CONCAT( DISTINCT a )
+aaaaaaaaaa,bbbbbbbbb
+Warnings:
+Warning	1260	1 line(s) were cut by GROUP_CONCAT()
+SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
+GROUP_CONCAT( a ORDER BY b )
+aaaaaaaaaa,bbbbbbbbb
+Warnings:
+Warning	1260	1 line(s) were cut by GROUP_CONCAT()
+SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
+GROUP_CONCAT( DISTINCT a ORDER BY b )
+aaaaaaaaaa,bbbbbbbbb
+Warnings:
+Warning	1260	1 line(s) were cut by GROUP_CONCAT()
 End of 5.0 tests

--- 1.55/mysql-test/t/func_gconcat.test	2007-03-29 19:20:02 +03:00
+++ 1.56/mysql-test/t/func_gconcat.test	2007-05-08 14:28:57 +03:00
@@ -507,4 +507,16 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(a)) F
 SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1;
 DROP TABLE t1;
 
+#
+# Bug #28273: GROUP_CONCAT and ORDER BY: No warning when result gets truncated.
+#
+CREATE TABLE t1( a VARCHAR( 10 ), b INT );
+INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1), 
+                      ( repeat( 'b', 10 ), 2);
+SET GROUP_CONCAT_MAX_LEN = 20;
+SELECT GROUP_CONCAT( a ) FROM t1;
+SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;  
+SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;          
+SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1; 
+
 --echo End of 5.0 tests
Thread
bk commit into 5.0 tree (mhansson:1.2479) BUG#28273mhansson8 May