mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merge chilla.local:/home/mydev/mysql-5.0-bug14400-monty
into chilla.local:/home/mydev/mysql-5.1-bug14400-monty BitKeeper/etc/ignore: auto-union include/my_global.h: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/t/myisam.test: Auto merged sql/handler.cc: Auto merged sql/opt_range.cc: Auto merged sql/sql_select.cc: Auto merged storage/myisam/mi_rkey.c: Auto merged storage/myisam/mi_test_all.res: Auto merged storage/myisam/mi_test_all.sh: Merge from 5.0.
This commit is contained in:
@@ -13313,6 +13313,8 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
|
||||
param->copy_funcs.empty();
|
||||
for (i= 0; (pos= li++); i++)
|
||||
{
|
||||
Field *field;
|
||||
char *tmp;
|
||||
Item *real_pos= pos->real_item();
|
||||
if (real_pos->type() == Item::FIELD_ITEM)
|
||||
{
|
||||
@@ -13343,17 +13345,25 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
|
||||
set up save buffer and change result_field to point at
|
||||
saved value
|
||||
*/
|
||||
Field *field= item->field;
|
||||
field= item->field;
|
||||
item->result_field=field->new_field(thd->mem_root,field->table, 1);
|
||||
char *tmp=(char*) sql_alloc(field->pack_length()+1);
|
||||
/*
|
||||
We need to allocate one extra byte for null handling and
|
||||
another extra byte to not get warnings from purify in
|
||||
Field_string::val_int
|
||||
*/
|
||||
tmp= (char*) sql_alloc(field->pack_length()+2);
|
||||
if (!tmp)
|
||||
goto err;
|
||||
if (copy)
|
||||
{
|
||||
copy->set(tmp, item->result_field);
|
||||
item->result_field->move_field(copy->to_ptr,copy->to_null_ptr,1);
|
||||
copy++;
|
||||
}
|
||||
if (copy)
|
||||
{
|
||||
copy->set(tmp, item->result_field);
|
||||
item->result_field->move_field(copy->to_ptr,copy->to_null_ptr,1);
|
||||
#ifdef HAVE_purify
|
||||
copy->to_ptr[copy->from_length]= 0;
|
||||
#endif
|
||||
copy++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((real_pos->type() == Item::FUNC_ITEM ||
|
||||
|
||||
Reference in New Issue
Block a user