summaryrefslogtreecommitdiff
path: root/sql/item_sum.h
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2006-02-28 19:30:30 +0300
committerunknown <evgen@moonbone.local>2006-02-28 19:30:30 +0300
commitddbf62ca89aeafefe958de28799d60522118ebe4 (patch)
treede6efffa2b75301bbbd339fd5851f4a16f382d17 /sql/item_sum.h
parent387ae4abcf2d484aebe9eae6edcab81c8c9556f9 (diff)
downloadmariadb-git-ddbf62ca89aeafefe958de28799d60522118ebe4.tar.gz
Fixed bug#14169: type of group_concat() result changed to blob if tmp_table was
used In a simple queries a result of the GROUP_CONCAT() function was always of varchar type. But if length of GROUP_CONCAT() result is greater than 512 chars and temporary table is used during select then the result is converted to blob, due to policy to not to store fields longer than 512 chars in tmp table as varchar fields. In order to provide consistent behaviour, result of GROUP_CONCAT() now will always be converted to blob if it is longer than 512 chars. Item_func_group_concat::field_type() is modified accordingly. sql/item_sum.h: Fixed bug#14169: type of group_concat() result changed to blob if tmp_table was used The Item_func_group_concat::field_type() now returns FIELD_TYPE_BLOB if the result is longer than 512 chars. tests/mysql_client_test.c: Added test case for bug#14169: type of group_concat() result changed to blob if tmp_table was used
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r--sql/item_sum.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h
index a8242d76287..a38530a502c 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -1116,6 +1116,13 @@ public:
enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;}
const char *func_name() const { return "group_concat"; }
virtual Item_result result_type () const { return STRING_RESULT; }
+ enum_field_types field_type() const
+ {
+ if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB)
+ return FIELD_TYPE_BLOB;
+ else
+ return MYSQL_TYPE_VARCHAR;
+ }
void clear();
bool add();
void reset_field() { DBUG_ASSERT(0); } // not used