diff options
author | unknown <istruewing@chilla.local> | 2006-09-20 08:33:46 +0200 |
---|---|---|
committer | unknown <istruewing@chilla.local> | 2006-09-20 08:33:46 +0200 |
commit | f6951675f9246c7da71bb64c7058c494821ac01f (patch) | |
tree | c5d55ac909d923b7567a72723ef59e8f30caa83c /sql/sql_select.cc | |
parent | 186573b3d6301532b5d5fa9b470335e19f49769c (diff) | |
parent | 82a72ee17e74db84b2c7a5ecfccf8a459c642acc (diff) | |
download | mariadb-git-f6951675f9246c7da71bb64c7058c494821ac01f.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-4.1-engines
into chilla.local:/home/mydev/mysql-4.1-bug14400-monty
BitKeeper/etc/ignore:
auto-union
mysql-test/r/myisam.result:
Auto merged
mysql-test/t/myisam.test:
Auto merged
sql/sql_select.cc:
Auto merged
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5154bff78dd..02ec7ae08ed 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -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 || |