MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:eugene Date:November 1 2005 2:27pm
Subject:bk commit into 5.0 tree (evgen:1.1962) BUG#14466
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
  1.1962 05/11/01 17:27:10 evgen@stripped +3 -0
  Fix bug #14466 lost sort order in GROUP_CONCAT() in a view
  
  Item_func_group_concat::print() wasn't printing sort order thus creating wrong
  view. This results in reported error.

  mysql-test/t/view.test
    1.118 05/11/01 17:24:55 evgen@stripped +11 -1
    Test case for bug #14466 lost sort order in GROUP_CONCAT() in a view

  mysql-test/r/view.result
    1.127 05/11/01 17:24:32 evgen@stripped +12 -0
    Test case for bug #14466 lost sort order in GROUP_CONCAT() in a view

  sql/item_sum.cc
    1.167 05/11/01 17:21:43 evgen@stripped +4 -0
    Fix bug #14466 lost sort order in GROUP_CONCAT() in a view
    Now Item_func_group_concat::print() prints sort order.

# 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/14466-bug-5.0-mysql

--- 1.166/sql/item_sum.cc	2005-09-30 13:36:13 +04:00
+++ 1.167/sql/item_sum.cc	2005-11-01 17:21:43 +03:00
@@ -3173,6 +3173,10 @@
       if (i)
         str->append(',');
       (*order[i]->item)->print(str);
+      if (order[i]->asc)
+        str->append(" ASC");
+      else
+        str->append(" DESC");
     }
   }
   str->append(" separator \'", 12);

--- 1.126/mysql-test/r/view.result	2005-10-28 16:50:29 +04:00
+++ 1.127/mysql-test/r/view.result	2005-11-01 17:24:32 +03:00
@@ -2323,3 +2323,15 @@
 1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	3	Using where
 DROP VIEW v1,v2;
 DROP TABLE t1,t2,t3;
+create table t1 (f1 int, f2 int);
+insert into t1 values(1,1),(1,2),(1,3);
+create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1;
+create view v2 as select f1 ,group_concat(f2 order by f2 desc) from t1 group by f1;
+select * from v1;
+f1	group_concat(f2 order by f2 asc)
+1	1,2,3
+select * from v2;
+f1	group_concat(f2 order by f2 desc)
+1	3,2,1
+drop view v1,v2;
+drop table t1;

--- 1.117/mysql-test/t/view.test	2005-10-28 14:11:24 +04:00
+++ 1.118/mysql-test/t/view.test	2005-11-01 17:24:55 +03:00
@@ -2189,4 +2189,14 @@
 DROP VIEW v1,v2;
 DROP TABLE t1,t2,t3;
 
-
+#
+# Bug #14466 lost sort order in GROUP_CONCAT() in a view
+#
+create table t1 (f1 int, f2 int);
+insert into t1 values(1,1),(1,2),(1,3);
+create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1;
+create view v2 as select f1 ,group_concat(f2 order by f2 desc) from t1 group by f1;
+select * from v1;
+select * from v2;
+drop view v1,v2;
+drop table t1;
Thread
bk commit into 5.0 tree (evgen:1.1962) BUG#14466eugene1 Nov