List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:October 12 2011 2:05pm
Subject:bzr push into mysql-5.5 branch (sergey.glukhov:3576)
View as plain text  
 3576 Sergey Glukhov	2011-10-12 [merge]
      automerge

    modified:
      storage/innobase/btr/btr0cur.c
      storage/innobase/btr/btr0sea.c
      storage/innobase/buf/buf0buf.c
      storage/innobase/buf/buf0lru.c
      storage/innobase/ha/ha0ha.c
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/ibuf/ibuf0ibuf.c
      storage/innobase/include/btr0sea.h
      storage/innobase/include/btr0types.h
      storage/innobase/include/buf0buf.h
      storage/innobase/include/ha0ha.h
      storage/innobase/include/ha0ha.ic
      storage/innobase/include/row0upd.ic
      storage/innobase/include/sync0sync.h
      storage/innobase/page/page0page.c
      storage/innobase/sync/sync0sync.c
=== modified file 'mysql-test/r/ctype_utf16.result'
--- a/mysql-test/r/ctype_utf16.result	2011-04-28 07:03:56 +0000
+++ b/mysql-test/r/ctype_utf16.result	2011-10-12 13:41:25 +0000
@@ -1126,5 +1126,19 @@ NULL
 Warnings:
 Warning	1301	Result of repeat() was larger than max_allowed_packet (1048576) - truncated
 #
+# Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT
+#
+SET NAMES utf8, @@character_set_connection=utf16;
+SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
+FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
+UNION ALL
+SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1
+GROUP BY id
+ORDER BY l DESC;
+id	l
+a	512
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+#
 # End of 5.5 tests
 #

=== modified file 'mysql-test/r/ctype_utf32.result'
--- a/mysql-test/r/ctype_utf32.result	2011-03-01 12:09:37 +0000
+++ b/mysql-test/r/ctype_utf32.result	2011-10-12 13:41:25 +0000
@@ -1167,5 +1167,19 @@ CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END
 b
 DROP TABLE t1;
 #
+# Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT
+#
+SET NAMES utf8, @@character_set_connection=utf32;
+SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
+FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
+UNION ALL
+SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1
+GROUP BY id
+ORDER BY l DESC;
+id	l
+a	256
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+#
 # End of 5.5 tests
 #

=== modified file 'mysql-test/r/ctype_utf8.result'
--- a/mysql-test/r/ctype_utf8.result	2011-05-11 11:11:57 +0000
+++ b/mysql-test/r/ctype_utf8.result	2011-10-12 13:41:25 +0000
@@ -2788,7 +2788,7 @@ create table t1 as select group_concat(1
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `c1` varchar(342) CHARACTER SET utf8 DEFAULT NULL
+  `c1` text CHARACTER SET utf8
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
 create table t1 as select 1 as c1 union select 'a';
@@ -5010,5 +5010,19 @@ id	select_type	table	type	possible_keys	
 Warnings:
 Note	1003	select 'abcdÁÂÃÄÅ' AS `abcdÁÂÃ' AS `abcdÁÂÃÄÅ`,_utf8'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÁÂÃÄÅ`
 #
+# Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT
+#
+SET NAMES utf8;
+SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
+FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
+UNION ALL
+SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1
+GROUP BY id
+ORDER BY l DESC;
+id	l
+a	1024
+Warnings:
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+#
 # End of 5.5 tests
 #

=== modified file 'mysql-test/t/ctype_utf16.test'
--- a/mysql-test/t/ctype_utf16.test	2011-04-28 07:03:56 +0000
+++ b/mysql-test/t/ctype_utf16.test	2011-10-12 13:41:25 +0000
@@ -762,6 +762,20 @@ DROP TABLE t1;
 
 SELECT space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second)); 
 
+
+--echo #
+--echo # Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT
+--echo #
+
+SET NAMES utf8, @@character_set_connection=utf16;
+SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
+FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
+UNION ALL
+SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1
+GROUP BY id
+ORDER BY l DESC;
+
+
 #
 ## TODO: add tests for all engines
 #

=== modified file 'mysql-test/t/ctype_utf32.test'
--- a/mysql-test/t/ctype_utf32.test	2011-03-01 12:09:37 +0000
+++ b/mysql-test/t/ctype_utf32.test	2011-10-12 13:41:25 +0000
@@ -841,5 +841,18 @@ SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c
 DROP TABLE t1;
 
 --echo #
+--echo # Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT
+--echo #
+
+SET NAMES utf8, @@character_set_connection=utf32;
+SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
+FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
+UNION ALL
+SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1
+GROUP BY id
+ORDER BY l DESC;
+
+
+--echo #
 --echo # End of 5.5 tests
 --echo #

=== modified file 'mysql-test/t/ctype_utf8.test'
--- a/mysql-test/t/ctype_utf8.test	2011-03-04 15:43:28 +0000
+++ b/mysql-test/t/ctype_utf8.test	2011-10-12 13:41:25 +0000
@@ -1562,5 +1562,17 @@ SET NAMES utf8;
 EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ';
 
 --echo #
+--echo # Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT
+--echo #
+
+SET NAMES utf8;
+SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
+FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
+UNION ALL
+SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1
+GROUP BY id
+ORDER BY l DESC;
+
+--echo #
 --echo # End of 5.5 tests
 --echo #

=== modified file 'sql/item.h'
--- a/sql/item.h	2011-07-03 23:48:19 +0000
+++ b/sql/item.h	2011-10-12 13:41:25 +0000
@@ -592,7 +592,7 @@ public:
   void init_make_field(Send_field *tmp_field,enum enum_field_types type);
   virtual void cleanup();
   virtual void make_field(Send_field *field);
-  Field *make_string_field(TABLE *table);
+  virtual Field *make_string_field(TABLE *table);
   virtual bool fix_fields(THD *, Item **);
   /*
     should be used in case where we are sure that we do not need

=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc	2011-07-07 09:42:14 +0000
+++ b/sql/item_sum.cc	2011-10-12 13:41:25 +0000
@@ -3128,6 +3128,31 @@ void Item_func_group_concat::cleanup()
 }
 
 
+Field *Item_func_group_concat::make_string_field(TABLE *table)
+{
+  Field *field;
+  DBUG_ASSERT(collation.collation);
+  /*
+    max_characters is maximum number of characters
+    what can fit into max_length size. It's necessary
+    to use field size what allows to store group_concat
+    result without truncation. For this purpose we use
+    max_characters * CS->mbmaxlen.
+  */
+  const uint32 max_characters= max_length / collation.collation->mbminlen;
+  if (max_characters > CONVERT_IF_BIGGER_TO_BLOB)
+    field= new Field_blob(max_characters * collation.collation->mbmaxlen,
+                          maybe_null, name, collation.collation, TRUE);
+  else
+    field= new Field_varstring(max_characters * collation.collation->mbmaxlen,
+                               maybe_null, name, table->s, collation.collation);
+
+  if (field)
+    field->init(table);
+  return field;
+}
+
+
 Item *Item_func_group_concat::copy_or_same(THD* thd)
 {
   return new (thd->mem_root) Item_func_group_concat(thd, this);

=== modified file 'sql/item_sum.h'
--- a/sql/item_sum.h	2011-06-30 15:46:53 +0000
+++ b/sql/item_sum.h	2011-10-12 13:41:25 +0000
@@ -1411,6 +1411,7 @@ public:
   enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;}
   const char *func_name() const { return "group_concat"; }
   virtual Item_result result_type () const { return STRING_RESULT; }
+  virtual Field *make_string_field(TABLE *table);
   enum_field_types field_type() const
   {
     if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB )

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5 branch (sergey.glukhov:3576) Sergey Glukhov13 Oct