[Commits] Rev 4050: MDEV-5840: group_concat( column_json(dynamic_column )) return empty result in file:///home/bell/maria/bzr/work-maria-10.0-MDEV-5840/

sanja at montyprogram.com sanja at montyprogram.com
Thu Mar 13 10:38:43 EET 2014


At file:///home/bell/maria/bzr/work-maria-10.0-MDEV-5840/

------------------------------------------------------------
revno: 4050
revision-id: sanja at montyprogram.com-20140313083841-09f90flne2syadzb
parent: sergii at pisem.net-20140312113447-l92ytjpq6x952rlv
committer: sanja at montyprogram.com
branch nick: work-maria-10.0-MDEV-5840
timestamp: Thu 2014-03-13 10:38:41 +0200
message:
  MDEV-5840: group_concat( column_json(dynamic_column )) return empty result
  
  Fixed max_length of dynamic columns json/create/add functions.
-------------- next part --------------
=== modified file 'mysql-test/r/dyncol.result'
--- a/mysql-test/r/dyncol.result	2014-03-06 20:21:25 +0000
+++ b/mysql-test/r/dyncol.result	2014-03-13 08:38:41 +0000
@@ -1755,3 +1755,16 @@ Warning	1265	Data truncated for column '
 SELECT COLUMN_ADD( COLUMN_ADD( dyncol, 1, REPEAT('b',130) ), 3, 'y' ) FROM t1;
 ERROR HY000: Encountered illegal format of dynamic column string
 DROP TABLE t1;
+#
+#MDEV-5840: group_concat( column_json(dynamic_column )) return empty
+#result
+#
+create table t1 (dyn blob);
+insert into t1 values (column_create('name1','value1','name2','value2'));
+select group_concat(cast(column_json(dyn) as char)) from t1;
+group_concat(cast(column_json(dyn) as char))
+{"name1":"value1","name2":"value2"}
+drop table t1;
+#
+# end of 10.0 tests
+#

=== modified file 'mysql-test/t/dyncol.test'
--- a/mysql-test/t/dyncol.test	2014-03-06 20:21:25 +0000
+++ b/mysql-test/t/dyncol.test	2014-03-13 08:38:41 +0000
@@ -820,3 +820,17 @@ INSERT INTO t1 SET dyncol = COLUMN_CREAT
 SELECT COLUMN_ADD( COLUMN_ADD( dyncol, 1, REPEAT('b',130) ), 3, 'y' ) FROM t1;
 
 DROP TABLE t1;
+
+--echo #
+--echo #MDEV-5840: group_concat( column_json(dynamic_column )) return empty
+--echo #result
+--echo #
+create table t1 (dyn blob);
+insert into t1 values (column_create('name1','value1','name2','value2'));
+select group_concat(cast(column_json(dyn) as char)) from t1;
+
+drop table t1;
+
+--echo #
+--echo # end of 10.0 tests
+--echo #

=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc	2014-02-26 14:28:07 +0000
+++ b/sql/item_strfunc.cc	2014-03-13 08:38:41 +0000
@@ -4279,6 +4279,7 @@ bool Item_func_dyncol_create::fix_fields
 
 void Item_func_dyncol_create::fix_length_and_dec()
 {
+  max_length= MAX_BLOB_WIDTH;
   maybe_null= TRUE;
   collation.set(&my_charset_bin);
   decimals= 0;

=== modified file 'sql/item_strfunc.h'
--- a/sql/item_strfunc.h	2014-02-03 14:27:03 +0000
+++ b/sql/item_strfunc.h	2014-03-13 08:38:41 +0000
@@ -1174,6 +1174,7 @@ public:
   String *val_str(String *);
   void fix_length_and_dec()
   {
+    max_length= MAX_BLOB_WIDTH;
     maybe_null= 1;
     collation.set(&my_charset_bin);
     decimals= 0;



More information about the commits mailing list