Loading sql/item_sum.cc +0 −3 Original line number Diff line number Diff line Loading @@ -159,10 +159,7 @@ Item *Item_sum::get_tmp_table_item(THD *thd) if (!arg->const_item()) { if (arg->type() == Item::FIELD_ITEM) { arg->maybe_null= result_field_tmp->maybe_null(); ((Item_field*) arg)->field= result_field_tmp++; } else sum_item->args[i]= new Item_field(result_field_tmp++); } Loading sql/sql_select.cc +14 −9 Original line number Diff line number Diff line Loading @@ -5003,16 +5003,21 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, tmp_from_field++; *(reg_field++)= new_field; reclength+=new_field->pack_length(); if (!(new_field->flags & NOT_NULL_FLAG)) null_count++; if (new_field->flags & BLOB_FLAG) { *blob_field++= new_field; blob_count++; } ((Item_sum*) item)->args[i]= new Item_field(new_field); if (((Item_sum*) item)->arg_count == 1) ((Item_sum*) item)->result_field= new_field; if (!(new_field->flags & NOT_NULL_FLAG)) { null_count++; /* new_field->maybe_null() is still false, it will be changed below. But we have to setup Item_field correctly */ ((Item_sum*) item)->args[i]->maybe_null=1; } } } } Loading Loading
sql/item_sum.cc +0 −3 Original line number Diff line number Diff line Loading @@ -159,10 +159,7 @@ Item *Item_sum::get_tmp_table_item(THD *thd) if (!arg->const_item()) { if (arg->type() == Item::FIELD_ITEM) { arg->maybe_null= result_field_tmp->maybe_null(); ((Item_field*) arg)->field= result_field_tmp++; } else sum_item->args[i]= new Item_field(result_field_tmp++); } Loading
sql/sql_select.cc +14 −9 Original line number Diff line number Diff line Loading @@ -5003,16 +5003,21 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, tmp_from_field++; *(reg_field++)= new_field; reclength+=new_field->pack_length(); if (!(new_field->flags & NOT_NULL_FLAG)) null_count++; if (new_field->flags & BLOB_FLAG) { *blob_field++= new_field; blob_count++; } ((Item_sum*) item)->args[i]= new Item_field(new_field); if (((Item_sum*) item)->arg_count == 1) ((Item_sum*) item)->result_field= new_field; if (!(new_field->flags & NOT_NULL_FLAG)) { null_count++; /* new_field->maybe_null() is still false, it will be changed below. But we have to setup Item_field correctly */ ((Item_sum*) item)->args[i]->maybe_null=1; } } } } Loading