Commit 692da273 authored by igor@rurik.mysql.com's avatar igor@rurik.mysql.com

Post merge fix

parent 7b0373a5
...@@ -616,7 +616,7 @@ insert into t1 values (1,repeat('a',255)),(2,repeat('b',255)); ...@@ -616,7 +616,7 @@ insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
select f2,group_concat(f1) from t1 group by f2; select f2,group_concat(f1) from t1 group by f2;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 f2 f2 253 255 255 Y 0 0 8 def test t1 t1 f2 f2 253 255 255 Y 0 0 8
def group_concat(f1) 252 400 1 Y 128 0 63 def group_concat(f1) 253 400 1 Y 128 0 63
f2 group_concat(f1) f2 group_concat(f1)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2
......
...@@ -380,10 +380,7 @@ Field *Item_func::tmp_table_field(TABLE *t_arg) ...@@ -380,10 +380,7 @@ Field *Item_func::tmp_table_field(TABLE *t_arg)
res= new Field_double(max_length, maybe_null, name, t_arg, decimals); res= new Field_double(max_length, maybe_null, name, t_arg, decimals);
break; break;
case STRING_RESULT: case STRING_RESULT:
if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB) res= make_string_field(t_arg);
res= new Field_blob(max_length, maybe_null, name, t_arg, collation.collation);
else
res= new Field_string(max_length, maybe_null, name, t_arg, collation.collation);
break; break;
case DECIMAL_RESULT: case DECIMAL_RESULT:
res= new Field_new_decimal(my_decimal_precision_to_length(decimal_precision(), res= new Field_new_decimal(my_decimal_precision_to_length(decimal_precision(),
......
...@@ -377,12 +377,12 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table, ...@@ -377,12 +377,12 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table,
case INT_RESULT: case INT_RESULT:
return new Field_longlong(max_length,maybe_null,name,table,unsigned_flag); return new Field_longlong(max_length,maybe_null,name,table,unsigned_flag);
case STRING_RESULT: case STRING_RESULT:
if (max_length > 255 && convert_blob_length) if (max_length/collation.collation->mbmaxlen > 255 && convert_blob_length)
return new Field_varstring(convert_blob_length, maybe_null, return new Field_varstring(convert_blob_length, maybe_null,
name, table, name, table,
collation.collation); collation.collation);
return make_string_field(table); return make_string_field(table);
case DECIMAL_RESULT: case DECIMAL_RESULT:
return new Field_new_decimal(max_length, maybe_null, name, table, return new Field_new_decimal(max_length, maybe_null, name, table,
decimals, unsigned_flag); decimals, unsigned_flag);
case ROW_RESULT: case ROW_RESULT:
......
...@@ -1121,10 +1121,10 @@ class Item_func_group_concat : public Item_sum ...@@ -1121,10 +1121,10 @@ class Item_func_group_concat : public Item_sum
virtual Item_result result_type () const { return STRING_RESULT; } virtual Item_result result_type () const { return STRING_RESULT; }
enum_field_types field_type() const enum_field_types field_type() const
{ {
if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB) if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB )
return FIELD_TYPE_BLOB; return FIELD_TYPE_BLOB;
else else
return MYSQL_TYPE_VAR_STRING; return MYSQL_TYPE_VARCHAR;
} }
void clear(); void clear();
bool add(); bool add();
......
...@@ -8245,20 +8245,13 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, ...@@ -8245,20 +8245,13 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
if ((type= item->field_type()) == MYSQL_TYPE_DATETIME || if ((type= item->field_type()) == MYSQL_TYPE_DATETIME ||
type == MYSQL_TYPE_TIME || type == MYSQL_TYPE_DATE) type == MYSQL_TYPE_TIME || type == MYSQL_TYPE_DATE)
new_field= item->tmp_table_field_from_field_type(table); new_field= item->tmp_table_field_from_field_type(table);
else if (item->max_length/item->collation.collation->mbmaxlen > else if (item->max_length/item->collation.collation->mbmaxlen > 255 &&
CONVERT_IF_BIGGER_TO_BLOB) convert_blob_length)
{ new_field= new Field_varstring(convert_blob_length, maybe_null,
if (convert_blob_length) item->name, table,
new_field= new Field_varstring(convert_blob_length, maybe_null, item->collation.collation);
item->name, table,
item->collation.collation);
else
new_field= new Field_blob(item->max_length, maybe_null, item->name,
table, item->collation.collation);
}
else else
new_field= new Field_string(item->max_length, maybe_null, item->name, new_field= item->make_string_field(table);
table, item->collation.collation);
break; break;
case DECIMAL_RESULT: case DECIMAL_RESULT:
new_field= new Field_new_decimal(item->max_length, maybe_null, item->name, new_field= new Field_new_decimal(item->max_length, maybe_null, item->name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment