mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge of the fix for bug #9681 4.1->5.0
This commit is contained in:
@ -7772,7 +7772,7 @@ Field* create_tmp_field_from_field(THD *thd, Field* org_field,
|
||||
item->result_field= new_field;
|
||||
else
|
||||
new_field->field_name= name;
|
||||
if (org_field->maybe_null())
|
||||
if (org_field->maybe_null() || (item && item->maybe_null))
|
||||
new_field->flags&= ~NOT_NULL_FLAG; // Because of outer join
|
||||
if (org_field->type() == MYSQL_TYPE_VAR_STRING ||
|
||||
org_field->type() == MYSQL_TYPE_VARCHAR)
|
||||
@ -12753,7 +12753,19 @@ bool JOIN::rollup_init()
|
||||
for (j=0 ; j < fields_list.elements ; j++)
|
||||
rollup.fields[i].push_back(rollup.null_items[i]);
|
||||
}
|
||||
List_iterator_fast<Item> it(fields_list);
|
||||
Item *item;
|
||||
while ((item= it++))
|
||||
{
|
||||
ORDER *group_tmp;
|
||||
for (group_tmp= group_list; group_tmp; group_tmp= group_tmp->next)
|
||||
{
|
||||
if (*group_tmp->item == item)
|
||||
item->maybe_null= 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user