1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge bk-internal.mysql.com:/home/bk/mysql-4.1-engines

into  chilla.local:/home/mydev/mysql-4.1-bug14400-monty
This commit is contained in:
istruewing@chilla.local
2006-09-20 08:33:46 +02:00
5 changed files with 57 additions and 43 deletions

View File

@ -9103,6 +9103,8 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
param->copy_funcs.empty();
for (i= 0; (pos= li++); i++)
{
Field *field;
char *tmp;
if (pos->type() == Item::FIELD_ITEM)
{
Item_field *item;
@ -9131,14 +9133,22 @@ 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);
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;
copy->set(tmp, item->result_field);
item->result_field->move_field(copy->to_ptr,copy->to_null_ptr,1);
copy++;
#ifdef HAVE_purify
copy->to_ptr[copy->from_length]= 0;
#endif
copy++;
}
}
else if ((pos->type() == Item::FUNC_ITEM ||