List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:April 18 2012 11:00am
Subject:bzr push into mysql-trunk branch (sergey.glukhov:3896 to 3897) WL#6098
View as plain text  
 3897 Sergey Glukhov	2012-04-18
      WL#6098 Eliminate GROUP_CONCAT intermediate result limitation.
     @ mysql-test/r/func_gconcat.result
        test case
     @ mysql-test/r/subquery_sj_all.result
        result fix
     @ mysql-test/r/subquery_sj_all_bka.result
        result fix
     @ mysql-test/r/subquery_sj_all_bka_nixbnl.result
        result fix
     @ mysql-test/r/subquery_sj_all_bkaunique.result
        result fix
     @ mysql-test/r/subquery_sj_dupsweed.result
        result fix
     @ mysql-test/r/subquery_sj_dupsweed_bka.result
        result fix
     @ mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result
        result fix
     @ mysql-test/r/subquery_sj_dupsweed_bkaunique.result
        result fix
     @ mysql-test/r/subquery_sj_firstmatch.result
        result fix
     @ mysql-test/r/subquery_sj_firstmatch_bka.result
        result fix
     @ mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result
        result fix
     @ mysql-test/r/subquery_sj_firstmatch_bkaunique.result
        result fix
     @ mysql-test/r/subquery_sj_loosescan.result
        result fix
     @ mysql-test/r/subquery_sj_loosescan_bka.result
        result fix
     @ mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result
        result fix
     @ mysql-test/r/subquery_sj_loosescan_bkaunique.result
        result fix
     @ mysql-test/r/subquery_sj_mat.result
        result fix
     @ mysql-test/r/subquery_sj_mat_bka.result
        result fix
     @ mysql-test/r/subquery_sj_mat_bka_nixbnl.result
        result fix
     @ mysql-test/r/subquery_sj_mat_bkaunique.result
        result fix
     @ mysql-test/r/subquery_sj_mat_nosj.result
        result fix
     @ mysql-test/r/subquery_sj_none.result
        result fix
     @ mysql-test/r/subquery_sj_none_bka.result
        result fix
     @ mysql-test/r/subquery_sj_none_bka_nixbnl.result
        result fix
     @ mysql-test/r/subquery_sj_none_bkaunique.result
        result fix
     @ mysql-test/t/func_gconcat.test
        test case
     @ sql/field.cc
        Modified Field_blob::store:
        If TABLE::blob_storage is initialized then the value is stored
        into TABLE::blob_storage memory otherwise it works as usual.
     @ sql/field_conv.cc
        removed obsolete comment
     @ sql/item_sum.cc
        -Initialized TABLE::blob_storage for appropriate
         temporary table if GROUP_CONCAT is used with ORDER BY | DISTINCT
         and BLOB field count > 0.
        -Added TABLE::blob_storage memory release.
        -Print warning if blob_storage has truncated values
        -Removed TMP_TABLE_PARAM::convert_blob_length as unnecessary.
     @ sql/item_sum.h
        -Added new member into Item_func_group_concat class: MEM_ROOT blob_storage.
        -Removed TMP_TABLE_PARAM::convert_blob_length as unnecessary.
     @ sql/sql_class.h
        Removed TMP_TABLE_PARAM::convert_blob_length as unnecessary.
     @ sql/sql_insert.cc
        Removed TMP_TABLE_PARAM::convert_blob_length as unnecessary.
     @ sql/sql_tmp_table.cc
        Removed TMP_TABLE_PARAM::convert_blob_length as unnecessary.
     @ sql/sql_tmp_table.h
        Removed TMP_TABLE_PARAM::convert_blob_length as unnecessary.
     @ sql/table.h
        -Added new class MEM_STORAGE which is used as a 
         BLOB field value storage for intermediate
         GROUP_CONCAT results. Used only for
         GROUP_CONCAT with  DISTINCT or ORDER BY options.
        -Added new member into TABLE structure: MEM_ROOT *blob_storage.

    modified:
      mysql-test/r/func_gconcat.result
      mysql-test/r/subquery_sj_all.result
      mysql-test/r/subquery_sj_all_bka.result
      mysql-test/r/subquery_sj_all_bka_nixbnl.result
      mysql-test/r/subquery_sj_all_bkaunique.result
      mysql-test/r/subquery_sj_dupsweed.result
      mysql-test/r/subquery_sj_dupsweed_bka.result
      mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result
      mysql-test/r/subquery_sj_dupsweed_bkaunique.result
      mysql-test/r/subquery_sj_firstmatch.result
      mysql-test/r/subquery_sj_firstmatch_bka.result
      mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result
      mysql-test/r/subquery_sj_firstmatch_bkaunique.result
      mysql-test/r/subquery_sj_loosescan.result
      mysql-test/r/subquery_sj_loosescan_bka.result
      mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result
      mysql-test/r/subquery_sj_loosescan_bkaunique.result
      mysql-test/r/subquery_sj_mat.result
      mysql-test/r/subquery_sj_mat_bka.result
      mysql-test/r/subquery_sj_mat_bka_nixbnl.result
      mysql-test/r/subquery_sj_mat_bkaunique.result
      mysql-test/r/subquery_sj_mat_nosj.result
      mysql-test/r/subquery_sj_none.result
      mysql-test/r/subquery_sj_none_bka.result
      mysql-test/r/subquery_sj_none_bka_nixbnl.result
      mysql-test/r/subquery_sj_none_bkaunique.result
      mysql-test/t/func_gconcat.test
      sql/field.cc
      sql/field_conv.cc
      sql/item_sum.cc
      sql/item_sum.h
      sql/sql_class.h
      sql/sql_insert.cc
      sql/sql_tmp_table.cc
      sql/sql_tmp_table.h
      sql/table.h
 3896 Annamalai Gurusami	2012-04-18 [merge]
      Null merge from mysql-5.5 to mysql-trunk. 

=== modified file 'mysql-test/r/func_gconcat.result'
--- a/mysql-test/r/func_gconcat.result	2012-02-29 11:17:52 +0000
+++ b/mysql-test/r/func_gconcat.result	2012-04-18 10:58:30 +0000
@@ -1086,3 +1086,85 @@ ERROR HY000: Row 3 was cut by GROUP_CONC
 SET group_concat_max_len = DEFAULT;
 SET @@sql_mode = @old_sql_mode;
 DROP TABLE t1, t2;
+#
+#  WL#6098 Eliminate GROUP_CONCAT intermediate result limitation.
+#  Bug#13387020 GROUP_CONCAT WITH ORDER BY RESULTS ARE TRUNCATED.
+#
+SET group_concat_max_len= 9999999;
+CREATE TABLE t1 (f1 LONGTEXT , f2  INTEGER);
+INSERT INTO t1 VALUES (REPEAT('a', 500000), 0), (REPEAT('b', 500000), 1), (REPEAT('c', 500000), 2);
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+1500002
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC)) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC))
+1500002
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC), 1, 5) FROM t1;
+SUBSTRING(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC), 1, 5)
+ccccc
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1)) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT f1))
+1500002
+SELECT LENGTH(GROUP_CONCAT(UPPER(f1) ORDER BY f2)) FROM t1;
+LENGTH(GROUP_CONCAT(UPPER(f1) ORDER BY f2))
+1500002
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1)) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1))
+1500002
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1), 1, 5) FROM t1;
+SUBSTRING(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1), 1, 5)
+AAAAA
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1))) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1)))
+1500002
+CREATE TABLE t2 SELECT GROUP_CONCAT(f1 order by f2) FROM t1;
+SHOW CREATE TABLE t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `GROUP_CONCAT(f1 order by f2)` mediumtext
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 SELECT GROUP_CONCAT(UPPER(f1) ORDER BY f2) FROM t1;
+SHOW CREATE TABLE t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `GROUP_CONCAT(UPPER(f1) ORDER BY f2)` mediumtext
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+SET group_concat_max_len= DEFAULT;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+1024
+Warnings:
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+SET group_concat_max_len= 499999;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 WHERE f2 = 0;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+499999
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+499999
+499999
+499999
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+INSERT INTO t1 VALUES (REPEAT('a', 499999), 3), (REPEAT('b', 500000), 4);
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+499999
+499999
+499999
+499999
+499999
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+DROP TABLE t1;
+SET group_concat_max_len= DEFAULT;
+End of 5.6 tests

=== modified file 'mysql-test/r/subquery_sj_all.result'
--- a/mysql-test/r/subquery_sj_all.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_all.result	2012-04-18 10:58:30 +0000
@@ -3748,6 +3748,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3761,6 +3765,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3841,6 +3849,10 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3921,6 +3933,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3934,6 +3950,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4014,6 +4034,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4027,6 +4051,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_all_bka.result'
--- a/mysql-test/r/subquery_sj_all_bka.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_all_bka.result	2012-04-18 10:58:30 +0000
@@ -3751,6 +3751,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3764,6 +3768,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3844,6 +3852,10 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3924,6 +3936,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3937,6 +3953,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4017,6 +4037,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4030,6 +4054,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_all_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_all_bka_nixbnl.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_all_bka_nixbnl.result	2012-04-18 10:58:30 +0000
@@ -3751,6 +3751,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3764,6 +3768,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3844,6 +3852,10 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3924,6 +3936,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3937,6 +3953,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4017,6 +4037,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4030,6 +4054,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_all_bkaunique.result'
--- a/mysql-test/r/subquery_sj_all_bkaunique.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_all_bkaunique.result	2012-04-18 10:58:30 +0000
@@ -3752,6 +3752,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3765,6 +3769,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3845,6 +3853,10 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3925,6 +3937,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3938,6 +3954,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4018,6 +4038,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4031,6 +4055,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_dupsweed.result'
--- a/mysql-test/r/subquery_sj_dupsweed.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_dupsweed.result	2012-04-18 10:58:30 +0000
@@ -3738,6 +3738,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3751,6 +3761,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3831,6 +3851,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3911,6 +3941,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3924,6 +3964,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4004,6 +4054,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4017,6 +4077,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_dupsweed_bka.result'
--- a/mysql-test/r/subquery_sj_dupsweed_bka.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_dupsweed_bka.result	2012-04-18 10:58:30 +0000
@@ -3739,6 +3739,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3752,6 +3762,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3832,6 +3852,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3912,6 +3942,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3925,6 +3965,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4005,6 +4055,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4018,6 +4078,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result	2012-04-18 10:58:30 +0000
@@ -3746,6 +3746,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3759,6 +3769,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3839,6 +3859,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3919,6 +3949,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3932,6 +3972,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4012,6 +4062,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4025,6 +4085,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_dupsweed_bkaunique.result'
--- a/mysql-test/r/subquery_sj_dupsweed_bkaunique.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_dupsweed_bkaunique.result	2012-04-18 10:58:30 +0000
@@ -3740,6 +3740,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3753,6 +3763,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3833,6 +3853,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3913,6 +3943,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3926,6 +3966,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4006,6 +4056,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4019,6 +4079,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_firstmatch.result'
--- a/mysql-test/r/subquery_sj_firstmatch.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_firstmatch.result	2012-04-18 10:58:30 +0000
@@ -3737,6 +3737,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3750,6 +3760,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3830,6 +3850,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3910,6 +3940,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3923,6 +3963,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4003,6 +4053,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4016,6 +4076,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_firstmatch_bka.result'
--- a/mysql-test/r/subquery_sj_firstmatch_bka.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_firstmatch_bka.result	2012-04-18 10:58:30 +0000
@@ -3738,6 +3738,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3751,6 +3761,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3831,6 +3851,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3911,6 +3941,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3924,6 +3964,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4004,6 +4054,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4017,6 +4077,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result	2012-04-18 10:58:30 +0000
@@ -3747,6 +3747,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3760,6 +3770,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3840,6 +3860,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3920,6 +3950,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3933,6 +3973,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4013,6 +4063,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4026,6 +4086,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_firstmatch_bkaunique.result'
--- a/mysql-test/r/subquery_sj_firstmatch_bkaunique.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_firstmatch_bkaunique.result	2012-04-18 10:58:30 +0000
@@ -3739,6 +3739,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3752,6 +3762,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3832,6 +3852,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3912,6 +3942,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3925,6 +3965,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4005,6 +4055,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4018,6 +4078,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_loosescan.result'
--- a/mysql-test/r/subquery_sj_loosescan.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_loosescan.result	2012-04-18 10:58:30 +0000
@@ -3739,6 +3739,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3752,6 +3762,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3832,6 +3852,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3912,6 +3942,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3925,6 +3965,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4005,6 +4055,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4018,6 +4078,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_loosescan_bka.result'
--- a/mysql-test/r/subquery_sj_loosescan_bka.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_loosescan_bka.result	2012-04-18 10:58:30 +0000
@@ -3740,6 +3740,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3753,6 +3763,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3833,6 +3853,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3913,6 +3943,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3926,6 +3966,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4006,6 +4056,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4019,6 +4079,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result	2012-04-18 10:58:30 +0000
@@ -3747,6 +3747,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3760,6 +3770,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3840,6 +3860,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3920,6 +3950,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3933,6 +3973,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4013,6 +4063,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4026,6 +4086,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_loosescan_bkaunique.result'
--- a/mysql-test/r/subquery_sj_loosescan_bkaunique.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_loosescan_bkaunique.result	2012-04-18 10:58:30 +0000
@@ -3741,6 +3741,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3754,6 +3764,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3834,6 +3854,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3914,6 +3944,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3927,6 +3967,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4007,6 +4057,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4020,6 +4080,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_mat.result'
--- a/mysql-test/r/subquery_sj_mat.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_mat.result	2012-04-18 10:58:30 +0000
@@ -3748,6 +3748,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3761,6 +3765,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3841,6 +3849,10 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3921,6 +3933,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3934,6 +3950,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4014,6 +4034,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4027,6 +4051,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_mat_bka.result'
--- a/mysql-test/r/subquery_sj_mat_bka.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_mat_bka.result	2012-04-18 10:58:30 +0000
@@ -3749,6 +3749,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3762,6 +3766,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3842,6 +3850,10 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3922,6 +3934,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3935,6 +3951,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4015,6 +4035,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4028,6 +4052,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_mat_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_mat_bka_nixbnl.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_mat_bka_nixbnl.result	2012-04-18 10:58:30 +0000
@@ -3749,6 +3749,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3762,6 +3766,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3842,6 +3850,10 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3922,6 +3934,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3935,6 +3951,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4015,6 +4035,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4028,6 +4052,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_mat_bkaunique.result'
--- a/mysql-test/r/subquery_sj_mat_bkaunique.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_mat_bkaunique.result	2012-04-18 10:58:30 +0000
@@ -3750,6 +3750,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3763,6 +3767,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3843,6 +3851,10 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3923,6 +3935,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3936,6 +3952,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4016,6 +4036,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4029,6 +4053,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_mat_nosj.result'
--- a/mysql-test/r/subquery_sj_mat_nosj.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_mat_nosj.result	2012-04-18 10:58:30 +0000
@@ -3817,6 +3817,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3830,6 +3834,10 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3910,6 +3918,10 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3990,6 +4002,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -4003,6 +4019,10 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4083,6 +4103,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4096,6 +4120,10 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_none.result'
--- a/mysql-test/r/subquery_sj_none.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_none.result	2012-04-18 10:58:30 +0000
@@ -3744,6 +3744,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3757,6 +3767,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3837,6 +3857,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3917,6 +3947,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3930,6 +3970,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4010,6 +4060,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4023,6 +4083,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_none_bka.result'
--- a/mysql-test/r/subquery_sj_none_bka.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_none_bka.result	2012-04-18 10:58:30 +0000
@@ -3745,6 +3745,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3758,6 +3768,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3838,6 +3858,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3918,6 +3948,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3931,6 +3971,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4011,6 +4061,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4024,6 +4084,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_none_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_none_bka_nixbnl.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_none_bka_nixbnl.result	2012-04-18 10:58:30 +0000
@@ -3744,6 +3744,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3757,6 +3767,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3837,6 +3857,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3917,6 +3947,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3930,6 +3970,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4010,6 +4060,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4023,6 +4083,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/r/subquery_sj_none_bkaunique.result'
--- a/mysql-test/r/subquery_sj_none_bkaunique.result	2012-03-26 10:29:07 +0000
+++ b/mysql-test/r/subquery_sj_none_bkaunique.result	2012-04-18 10:58:30 +0000
@@ -3746,6 +3746,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_512
@@ -3759,6 +3769,16 @@ select left(a1,7), left(a2,7)
 from t1_512
 where a1 in (select group_concat(b1) from t2_512 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_512, t2_512, t3_512;
 set @blob_len = 513;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3839,6 +3859,16 @@ select left(a1,7), left(a2,7)
 from t1_513
 where a1 in (select group_concat(b1) from t2_513 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_513, t2_513, t3_513;
 set @blob_len = 1024;
 set @suffix_len = @blob_len - @prefix_len;
@@ -3919,6 +3949,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1024
@@ -3932,6 +3972,16 @@ select left(a1,7), left(a2,7)
 from t1_1024
 where a1 in (select group_concat(b1) from t2_1024 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1024, t2_1024, t3_1024;
 set @blob_len = 1025;
 set @suffix_len = @blob_len - @prefix_len;
@@ -4012,6 +4062,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 set @@group_concat_max_len = 256;
 explain extended select left(a1,7), left(a2,7)
 from t1_1025
@@ -4025,6 +4085,16 @@ select left(a1,7), left(a2,7)
 from t1_1025
 where a1 in (select group_concat(b1) from t2_1025 group by b2);
 left(a1,7)	left(a2,7)
+Warnings:
+Warning	1260	Row 1 was cut by GROUP_CONCAT()
+Warning	1260	Row 2 was cut by GROUP_CONCAT()
+Warning	1260	Row 3 was cut by GROUP_CONCAT()
+Warning	1260	Row 4 was cut by GROUP_CONCAT()
+Warning	1260	Row 5 was cut by GROUP_CONCAT()
+Warning	1260	Row 6 was cut by GROUP_CONCAT()
+Warning	1260	Row 7 was cut by GROUP_CONCAT()
+Warning	1260	Row 8 was cut by GROUP_CONCAT()
+Warning	1260	Row 9 was cut by GROUP_CONCAT()
 drop table t1_1025, t2_1025, t3_1025;
 #
 # Bug#48868: Left outer join in subquery causes segmentation fault in

=== modified file 'mysql-test/t/func_gconcat.test'
--- a/mysql-test/t/func_gconcat.test	2011-03-08 19:14:42 +0000
+++ b/mysql-test/t/func_gconcat.test	2012-04-18 10:58:30 +0000
@@ -795,3 +795,46 @@ INSERT INTO t2 SELECT GROUP_CONCAT(a), b
 SET group_concat_max_len = DEFAULT;
 SET @@sql_mode = @old_sql_mode;
 DROP TABLE t1, t2;
+
+--echo #
+--echo #  WL#6098 Eliminate GROUP_CONCAT intermediate result limitation.
+--echo #  Bug#13387020 GROUP_CONCAT WITH ORDER BY RESULTS ARE TRUNCATED.
+--echo #
+
+
+SET group_concat_max_len= 9999999;
+CREATE TABLE t1 (f1 LONGTEXT , f2  INTEGER);
+INSERT INTO t1 VALUES (REPEAT('a', 500000), 0), (REPEAT('b', 500000), 1), (REPEAT('c', 500000), 2);
+
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC)) FROM t1;
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC), 1, 5) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1)) FROM t1;
+
+SELECT LENGTH(GROUP_CONCAT(UPPER(f1) ORDER BY f2)) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1)) FROM t1;
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1), 1, 5) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1))) FROM t1;
+
+CREATE TABLE t2 SELECT GROUP_CONCAT(f1 order by f2) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 SELECT GROUP_CONCAT(UPPER(f1) ORDER BY f2) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+SET group_concat_max_len= DEFAULT;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+
+SET group_concat_max_len= 499999;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 WHERE f2 = 0;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+
+INSERT INTO t1 VALUES (REPEAT('a', 499999), 3), (REPEAT('b', 500000), 4);
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+
+DROP TABLE t1;
+SET group_concat_max_len= DEFAULT;
+
+--echo End of 5.6 tests

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2012-04-12 14:29:14 +0000
+++ b/sql/field.cc	2012-04-18 10:58:30 +0000
@@ -7587,8 +7587,8 @@ int Field_blob::store(const char *from,u
   uint copy_length, new_length;
   const char *well_formed_error_pos;
   const char *cannot_convert_error_pos;
-  const char *from_end_pos, *tmp;
-  char buff[STRING_BUFFER_USUAL_SIZE];
+  const char *from_end_pos;
+  char buff[STRING_BUFFER_USUAL_SIZE], *tmp;
   String tmpstr(buff,sizeof(buff), &my_charset_bin);
 
   if (!length)
@@ -7597,6 +7597,29 @@ int Field_blob::store(const char *from,u
     return 0;
   }
 
+  if (table->blob_storage)    // GROUP_CONCAT with ORDER BY | DISTINCT
+  {
+    DBUG_ASSERT(!f_is_hex_escape(flags));
+    DBUG_ASSERT(field_charset == cs);
+    DBUG_ASSERT(length <= max_data_length());
+    
+    new_length= length;
+    copy_length= table->in_use->variables.group_concat_max_len;
+    if (new_length > copy_length)
+    {
+      int well_formed_error;
+      new_length= cs->cset->well_formed_len(cs, from, from + copy_length,
+                                            new_length, &well_formed_error);
+      table->blob_storage->set_truncated_value(true);
+    }
+    if (!(tmp= table->blob_storage->store(from, new_length)))
+      goto oom_error;
+
+    Field_blob::store_length(new_length);
+    bmove(ptr + packlength, (uchar*) &tmp, sizeof(char*));
+    return 0;
+  }
+
   /*
     If the 'from' address is in the range of the temporary 'value'-
     object we need to copy the content to a different location or it will be
@@ -7624,15 +7647,14 @@ int Field_blob::store(const char *from,u
   new_length= min(max_data_length(), field_charset->mbmaxlen * length);
   if (value.alloc(new_length))
     goto oom_error;
-
+  tmp= const_cast<char*>(value.ptr());
 
   if (f_is_hex_escape(flags))
   {
     copy_length= my_copy_with_hex_escaping(field_charset,
-                                           (char*) value.ptr(), new_length,
-                                            from, length);
+                                           tmp, new_length,
+                                           from, length);
     Field_blob::store_length(copy_length);
-    tmp= value.ptr();
     bmove(ptr + packlength, (uchar*) &tmp, sizeof(char*));
     return 0;
   }
@@ -7642,7 +7664,7 @@ int Field_blob::store(const char *from,u
     is done with the new_length value.
   */
   copy_length= well_formed_copy_nchars(field_charset,
-                                       (char*) value.ptr(), new_length,
+                                       tmp, new_length,
                                        cs, from, length,
                                        length,
                                        &well_formed_error_pos,
@@ -7650,7 +7672,6 @@ int Field_blob::store(const char *from,u
                                        &from_end_pos);
 
   Field_blob::store_length(copy_length);
-  tmp= value.ptr();
   bmove(ptr+packlength,(uchar*) &tmp,sizeof(char*));
 
   if (check_string_copy_error(this, well_formed_error_pos,

=== modified file 'sql/field_conv.cc'
--- a/sql/field_conv.cc	2012-04-12 14:29:14 +0000
+++ b/sql/field_conv.cc	2012-04-18 10:58:30 +0000
@@ -577,9 +577,6 @@ void Copy_field::set(uchar *to,Field *fr
     Field_blob::store. Is this in order to trigger the call to 
     well_formed_copy_nchars, by changing the pointer copy->tmp.ptr()?
     That call will take place anyway in all known cases.
-
-  - The above causes a truncation to MAX_FIELD_WIDTH. Is this the intended 
-    effect? Truncation is handled by well_formed_copy_nchars anyway.
  */
 void Copy_field::set(Field *to,Field *from,bool save)
 {

=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc	2012-03-30 15:38:01 +0000
+++ b/sql/item_sum.cc	2012-04-18 10:58:30 +0000
@@ -496,8 +496,7 @@ bool Item_sum::walk (Item_processor proc
 }
 
 
-Field *Item_sum::create_tmp_field(bool group, TABLE *table,
-                                  uint convert_blob_length)
+Field *Item_sum::create_tmp_field(bool group, TABLE *table)
 {
   Field *field;
   switch (result_type()) {
@@ -508,13 +507,7 @@ Field *Item_sum::create_tmp_field(bool g
     field= new Field_longlong(max_length, maybe_null, item_name.ptr(), unsigned_flag);
     break;
   case STRING_RESULT:
-    if (max_length/collation.collation->mbmaxlen <= 255 ||
-        convert_blob_length > Field_varstring::MAX_SIZE ||
-        !convert_blob_length)
-      return make_string_field(table);
-    field= new Field_varstring(convert_blob_length, maybe_null,
-                               item_name.ptr(), table->s, collation.collation);
-    break;
+    return make_string_field(table);
   case DECIMAL_RESULT:
     field= Field_new_decimal::create_from_item(this);
     break;
@@ -1209,16 +1202,15 @@ void Item_sum_hybrid::setup_hybrid(Item 
 }
 
 
-Field *Item_sum_hybrid::create_tmp_field(bool group, TABLE *table,
-					 uint convert_blob_length)
+Field *Item_sum_hybrid::create_tmp_field(bool group, TABLE *table)
 {
   Field *field;
   if (args[0]->type() == Item::FIELD_ITEM)
   {
     field= ((Item_field*) args[0])->field;
     
-    if ((field= create_tmp_field_from_field(current_thd, field, item_name.ptr(), table,
-					    NULL, convert_blob_length)))
+    if ((field= create_tmp_field_from_field(current_thd, field, item_name.ptr(),
+                                            table, NULL)))
       field->flags&= ~NOT_NULL_FLAG;
     return field;
   }
@@ -1239,7 +1231,7 @@ Field *Item_sum_hybrid::create_tmp_field
     field= new Field_datetimef(maybe_null, item_name.ptr(), decimals);
     break;
   default:
-    return Item_sum::create_tmp_field(group, table, convert_blob_length);
+    return Item_sum::create_tmp_field(group, table);
   }
   if (field)
     field->init(table);
@@ -1553,8 +1545,7 @@ Item *Item_sum_avg::copy_or_same(THD* th
 }
 
 
-Field *Item_sum_avg::create_tmp_field(bool group, TABLE *table,
-                                      uint convert_blob_len)
+Field *Item_sum_avg::create_tmp_field(bool group, TABLE *table)
 {
   Field *field;
   if (group)
@@ -1771,8 +1762,7 @@ Item *Item_sum_variance::copy_or_same(TH
   If we're grouping, then we need some space to serialize variables into, to
   pass around.
 */
-Field *Item_sum_variance::create_tmp_field(bool group, TABLE *table,
-                                           uint convert_blob_len)
+Field *Item_sum_variance::create_tmp_field(bool group, TABLE *table)
 {
   Field *field;
   if (group)
@@ -3059,6 +3049,11 @@ int dump_leaf_key(void* key_arg, element
                         ER_CUT_VALUE_GROUP_CONCAT, ER(ER_CUT_VALUE_GROUP_CONCAT),
                         item->row_count);
 
+    /**
+       To avoid duplicated warnings in Item_func_group_concat::val_str()
+    */
+    if (table && table->blob_storage)
+      table->blob_storage->set_truncated_value(false);
     return 1;
   }
   return 0;
@@ -3192,6 +3187,8 @@ void Item_func_group_concat::cleanup()
     if (table)
     {
       THD *thd= table->in_use;
+      if (table->blob_storage)
+        delete table->blob_storage;
       free_tmp_table(thd, table);
       table= 0;
       if (tree)
@@ -3253,6 +3250,8 @@ void Item_func_group_concat::clear()
     reset_tree(tree);
   if (unique_filter)
     unique_filter->reset();
+  if (table && table->blob_storage)
+    table->blob_storage->reset();
   /* No need to reset the table as we never call write_row */
 }
 
@@ -3376,6 +3375,7 @@ bool Item_func_group_concat::setup(THD *
 {
   List<Item> list;
   SELECT_LEX *select_lex= thd->lex->current_select;
+  const bool order_or_distinct= test(arg_count_order > 0 || distinct);
   DBUG_ENTER("Item_func_group_concat::setup");
 
   /*
@@ -3388,9 +3388,6 @@ bool Item_func_group_concat::setup(THD *
   if (!(tmp_table_param= new TMP_TABLE_PARAM))
     DBUG_RETURN(TRUE);
 
-  /* We'll convert all blobs to varchar fields in the temporary table */
-  tmp_table_param->convert_blob_length= max_length *
-                                        collation.collation->mbmaxlen;
   /* Push all not constant fields to the list and create a temp table */
   always_null= 0;
   for (uint i= 0; i < arg_count_field; i++)
@@ -3423,18 +3420,9 @@ bool Item_func_group_concat::setup(THD *
   count_field_types(select_lex, tmp_table_param, all_fields, 0);
   tmp_table_param->force_copy_fields= force_copy_fields;
   DBUG_ASSERT(table == 0);
-  if (arg_count_order > 0 || distinct)
+  if (order_or_distinct)
   {
     /*
-      Currently we have to force conversion of BLOB values to VARCHAR's
-      if we are to store them in TREE objects used for ORDER BY and
-      DISTINCT. This leads to truncation if the BLOB's size exceeds
-      Field_varstring::MAX_SIZE.
-    */
-    set_if_smaller(tmp_table_param->convert_blob_length, 
-                   Field_varstring::MAX_SIZE);
-
-    /*
       Force the create_tmp_table() to convert BIT columns to INT
       as we cannot compare two table records containg BIT fields
       stored in the the tree used for distinct/order by.
@@ -3466,6 +3454,13 @@ bool Item_func_group_concat::setup(THD *
   table->file->extra(HA_EXTRA_NO_ROWS);
   table->no_rows= 1;
 
+  /**
+    Initialize blob_storage if GROUP_CONCAT is used
+    with ORDER BY | DISTINCT and BLOB field count > 0.    
+  */
+  if (order_or_distinct && table->s->blob_fields)
+    table->blob_storage= new Blob_mem_storage();
+
   /*
      Need sorting or uniqueness: init tree and choose a function to sort.
      Don't reserve space for NULLs: if any of gconcat arguments is NULL,
@@ -3517,6 +3512,16 @@ String* Item_func_group_concat::val_str(
   if (no_appended && tree)
     /* Tree is used for sorting as in ORDER BY */
     tree_walk(tree, &dump_leaf_key, this, left_root_right);
+
+  if (table && table->blob_storage && 
+      table->blob_storage->is_truncated_value())
+  {
+    warning_for_row= true;
+    push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
+                        ER_CUT_VALUE_GROUP_CONCAT, ER(ER_CUT_VALUE_GROUP_CONCAT),
+                        row_count);
+  }
+
   return &result;
 }
 

=== modified file 'sql/item_sum.h'
--- a/sql/item_sum.h	2012-03-06 14:29:42 +0000
+++ b/sql/item_sum.h	2012-04-18 10:58:30 +0000
@@ -464,8 +464,7 @@ public:  
   }
   virtual void make_unique() { force_copy_fields= TRUE; }
   Item *get_tmp_table_item(THD *thd);
-  virtual Field *create_tmp_field(bool group, TABLE *table,
-                                  uint convert_blob_length);
+  virtual Field *create_tmp_field(bool group, TABLE *table);
   bool walk(Item_processor processor, bool walk_subquery, uchar *argument);
   bool init_sum_func_check(THD *thd);
   bool check_sum_func(THD *thd, Item **ref);
@@ -884,7 +883,7 @@ public:
     return has_with_distinct() ? "avg(distinct " : "avg("; 
   }
   Item *copy_or_same(THD* thd);
-  Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length);
+  Field *create_tmp_field(bool group, TABLE *table);
   void cleanup()
   {
     count= 0;
@@ -967,7 +966,7 @@ public:
   const char *func_name() const
     { return sample ? "var_samp(" : "variance("; }
   Item *copy_or_same(THD* thd);
-  Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length);
+  Field *create_tmp_field(bool group, TABLE *table);
   enum Item_result result_type () const { return REAL_RESULT; }
   void cleanup()
   {
@@ -1060,8 +1059,7 @@ protected:
   void cleanup();
   bool any_value() { return was_values; }
   void no_rows_in_result();
-  Field *create_tmp_field(bool group, TABLE *table,
-			  uint convert_blob_length);
+  Field *create_tmp_field(bool group, TABLE *table);
 };
 
 

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2012-04-13 12:00:39 +0000
+++ b/sql/sql_class.h	2012-04-18 10:58:30 +0000
@@ -4396,8 +4396,6 @@ public:
   uint	group_parts,group_length,group_null_parts;
   uint	quick_group;
   bool  using_indirect_summary_function;
-  /* If >0 convert all blob fields to varchar(convert_blob_length) */
-  uint  convert_blob_length; 
   CHARSET_INFO *table_charset; 
   bool schema_table;
   /*
@@ -4424,9 +4422,9 @@ public:
 
   TMP_TABLE_PARAM()
     :copy_field(0), group_parts(0),
-     group_length(0), group_null_parts(0), convert_blob_length(0),
-     schema_table(0), precomputed_group_by(0), force_copy_fields(0),
-     skip_create_table(FALSE), bit_fields_as_long(0)
+     group_length(0), group_null_parts(0), schema_table(0),
+     precomputed_group_by(0), force_copy_fields(0), skip_create_table(FALSE),
+     bit_fields_as_long(0)
   {}
   ~TMP_TABLE_PARAM()
   {

=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2012-04-13 12:00:39 +0000
+++ b/sql/sql_insert.cc	2012-04-18 10:58:30 +0000
@@ -3823,8 +3823,7 @@ static TABLE *create_table_from_items(TH
         field= item->tmp_table_field_from_field_type(&tmp_table, 0);
     else
       field= create_tmp_field(thd, &tmp_table, item, item->type(),
-                              (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0,
-                              0);
+                              (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0);
     if (!field ||
 	!(cr_field=new Create_field(field,(item->type() == Item::FIELD_ITEM ?
 					   ((Item_field *)item)->field :

=== modified file 'sql/sql_tmp_table.cc'
--- a/sql/sql_tmp_table.cc	2012-03-30 10:23:18 +0000
+++ b/sql/sql_tmp_table.cc	2012-04-18 10:58:30 +0000
@@ -43,8 +43,6 @@ using std::min;
                       the record in the original table.
                       If item == NULL then fill_record() will update
                       the temporary table
-  @param convert_blob_length   If >0 create a varstring(convert_blob_length)
-                               field instead of blob.
 
   @retval
     NULL		on error
@@ -54,23 +52,12 @@ using std::min;
 
 Field *create_tmp_field_from_field(THD *thd, Field *org_field,
                                    const char *name, TABLE *table,
-                                   Item_field *item, uint convert_blob_length)
+                                   Item_field *item)
 {
   Field *new_field;
 
-  /* 
-    Make sure that the blob fits into a Field_varstring which has 
-    2-byte lenght. 
-  */
-  if (convert_blob_length && convert_blob_length <= Field_varstring::MAX_SIZE &&
-      (org_field->flags & BLOB_FLAG))
-    new_field= new Field_varstring(convert_blob_length,
-                                   org_field->maybe_null(),
-                                   org_field->field_name, table->s,
-                                   org_field->charset());
-  else
-    new_field= org_field->new_field(thd->mem_root, table,
-                                    table == org_field->table);
+  new_field= org_field->new_field(thd->mem_root, table,
+                                  table == org_field->table);
   if (new_field)
   {
     new_field->init(table);
@@ -106,8 +93,6 @@ Field *create_tmp_field_from_field(THD *
                                update the record in the original table.
                                If modify_item is 0 then fill_record() will
                                update the temporary table
-  @param convert_blob_length   If >0 create a varstring(convert_blob_length)
-                               field instead of blob.
 
   @retval
     0  on error
@@ -116,8 +101,7 @@ Field *create_tmp_field_from_field(THD *
 */
 
 static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
-                                         Item ***copy_func, bool modify_item,
-                                         uint convert_blob_length)
+                                         Item ***copy_func, bool modify_item)
 {
   bool maybe_null= item->maybe_null;
   Field *new_field;
@@ -151,16 +135,6 @@ static Field *create_tmp_field_from_item
     */
     if (item->is_temporal() || item->field_type() == MYSQL_TYPE_GEOMETRY)
       new_field= item->tmp_table_field_from_field_type(table, 1);
-    /* 
-      Make sure that the blob fits into a Field_varstring which has 
-      2-byte lenght. 
-    */
-    else if (item->max_length/item->collation.collation->mbmaxlen > 255 &&
-             convert_blob_length <= Field_varstring::MAX_SIZE && 
-             convert_blob_length)
-      new_field= new Field_varstring(convert_blob_length, maybe_null,
-                                     item->item_name.ptr(), table->s,
-                                     item->collation.collation);
     else
       new_field= item->make_string_field(table);
     new_field->set_derivation(item->collation.derivation);
@@ -244,8 +218,6 @@ static Field *create_tmp_field_for_schem
                        the record in the original table.
                        If modify_item is 0 then fill_record() will update
                        the temporary table
-  @param convert_blob_length If >0 create a varstring(convert_blob_length)
-                             field instead of blob.
 
   @retval
     0			on error
@@ -258,8 +230,7 @@ Field *create_tmp_field(THD *thd, TABLE 
                         Field **default_field,
                         bool group, bool modify_item,
                         bool table_cant_handle_bit_fields,
-                        bool make_copy_field,
-                        uint convert_blob_length)
+                        bool make_copy_field)
 {
   Field *result;
   Item::Type orig_type= type;
@@ -277,7 +248,7 @@ Field *create_tmp_field(THD *thd, TABLE 
   case Item::SUM_FUNC_ITEM:
   {
     Item_sum *item_sum=(Item_sum*) item;
-    result= item_sum->create_tmp_field(group, table, convert_blob_length);
+    result= item_sum->create_tmp_field(group, table);
     if (!result)
       my_error(ER_OUT_OF_RESOURCES, MYF(ME_FATALERROR));
     return result;
@@ -296,7 +267,7 @@ Field *create_tmp_field(THD *thd, TABLE 
     if (field->maybe_null && !field->field->maybe_null())
     {
       result= create_tmp_field_from_item(thd, item, table, NULL,
-                                         modify_item, convert_blob_length);
+                                         modify_item);
       *from_field= field->field;
       if (result && modify_item)
         field->result_field= result;
@@ -306,7 +277,7 @@ Field *create_tmp_field(THD *thd, TABLE 
     {
       *from_field= field->field;
       result= create_tmp_field_from_item(thd, item, table, copy_func,
-                                        modify_item, convert_blob_length);
+                                         modify_item);
       if (result && modify_item)
         field->result_field= result;
     }
@@ -316,8 +287,7 @@ Field *create_tmp_field(THD *thd, TABLE 
                                           item->item_name.ptr(),
                                           table,
                                           modify_item ? field :
-                                          NULL,
-                                          convert_blob_length);
+                                          NULL);
     if (orig_type == Item::REF_ITEM && orig_modify)
       ((Item_ref*)orig_item)->set_result_field(result);
     /*
@@ -351,8 +321,7 @@ Field *create_tmp_field(THD *thd, TABLE 
                                     sp_result_field,
                                     item_func_sp->item_name.ptr(),
                                     table,
-                                    NULL,
-                                    convert_blob_length);
+                                    NULL);
 
       if (modify_item)
         item->set_result_field(result_field);
@@ -381,7 +350,7 @@ Field *create_tmp_field(THD *thd, TABLE 
     }
     return create_tmp_field_from_item(thd, item, table,
                                       (make_copy_field ? 0 : copy_func),
-                                       modify_item, convert_blob_length);
+                                       modify_item);
   case Item::TYPE_HOLDER:  
     result= ((Item_type_holder *)item)->make_field_by_type(table);
     result->set_derivation(item->collation.derivation);
@@ -668,8 +637,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
             create_tmp_field(thd, table, arg, arg->type(), &copy_func,
                              tmp_from_field, &default_field[fieldnr],
                              group != 0,not_all_columns,
-                             distinct, 0,
-                             param->convert_blob_length);
+                             distinct, false);
 	  if (!new_field)
 	    goto err;					// Should be OOM
 	  tmp_from_field++;
@@ -731,8 +699,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
                            usable in this case too.
                          */
                          item->marker == 4 || param->bit_fields_as_long,
-                         force_copy_fields,
-                         param->convert_blob_length);
+                         force_copy_fields);
 
       if (!new_field)
       {

=== modified file 'sql/sql_tmp_table.h'
--- a/sql/sql_tmp_table.h	2011-12-15 09:00:42 +0000
+++ b/sql/sql_tmp_table.h	2012-04-18 10:58:30 +0000
@@ -70,11 +70,10 @@ Field *create_tmp_field(THD *thd, TABLE 
                         Field **default_field,
                         bool group, bool modify_item,
                         bool table_cant_handle_bit_fields,
-                        bool make_copy_field,
-                        uint convert_blob_length);
+                        bool make_copy_field);
 Field* create_tmp_field_from_field(THD *thd, Field* org_field,
                                    const char *name, TABLE *table,
-                                   Item_field *item, uint convert_blob_length);
+                                   Item_field *item);
 
 
 #endif /* SQL_TMP_TABLE_INCLUDED */

=== modified file 'sql/table.h'
--- a/sql/table.h	2012-04-03 11:53:52 +0000
+++ b/sql/table.h	2012-04-18 10:58:30 +0000
@@ -886,6 +886,57 @@ struct TABLE_SHARE
 };
 
 
+/**
+   Class is used as a BLOB field value storage for
+   intermediate GROUP_CONCAT results. Used only for
+   GROUP_CONCAT with  DISTINCT or ORDER BY options.
+ */
+
+class Blob_mem_storage: public Sql_alloc
+{
+private:
+  MEM_ROOT storage;
+  /**
+    Sign that some values were cut
+    during saving into the storage.
+  */
+  bool truncated_value;
+public:
+  Blob_mem_storage() :truncated_value(false)
+  {
+    init_alloc_root(&storage, MAX_FIELD_VARCHARLENGTH, 0);
+  }
+  ~ Blob_mem_storage()
+  {
+    free_root(&storage, MYF(0));
+  }
+  void reset()
+  {
+    free_root(&storage, MYF(MY_MARK_BLOCKS_FREE));
+    truncated_value= false;
+  }
+  /**
+     Fuction creates duplicate of 'from'
+     string in 'storage' MEM_ROOT.
+
+     @param from           string to copy
+     @param length         string length
+
+     @retval Pointer to the copied string.
+     @retval 0 if an error occured.
+  */
+  char *store(const char *from, uint length)
+  {
+    return (char*) memdup_root(&storage, from, length);
+  }
+  void set_truncated_value(bool is_truncated_value)
+  {
+    truncated_value= is_truncated_value;
+  }
+  bool is_truncated_value() { return truncated_value; }
+};
+
+
 /* Information for one open table */
 enum index_hint_type
 {
@@ -1088,6 +1139,12 @@ public:
      reference to a TABLE object.
    */
   MEM_ROOT mem_root;
+  /**
+     Initialized in Item_func_group_concat::setup for appropriate
+     temporary table if GROUP_CONCAT is used with ORDER BY | DISTINCT
+     and BLOB field count > 0.
+   */
+  Blob_mem_storage *blob_storage;
   GRANT_INFO grant;
   Filesort_info sort;
 #ifdef WITH_PARTITION_STORAGE_ENGINE

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (sergey.glukhov:3896 to 3897) WL#6098Sergey Glukhov20 Apr