summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <istruewing@chilla.local>2006-09-19 10:17:25 +0200
committerunknown <istruewing@chilla.local>2006-09-19 10:17:25 +0200
commit82a72ee17e74db84b2c7a5ecfccf8a459c642acc (patch)
tree397628c9d94447f43c72762c69080ac4098584d7 /sql/sql_select.cc
parentab7d1d70a4db399ed69b73c523b14483fa786bdf (diff)
parentdcb665900136fb4015589680c612add8abf1deca (diff)
downloadmariadb-git-82a72ee17e74db84b2c7a5ecfccf8a459c642acc.tar.gz
Merge bk-internal:/home/bk/mysql-4.0
into chilla.local:/home/mydev/mysql-4.1-bug14400-monty BitKeeper/etc/ignore: auto-union include/my_global.h: Auto merged myisam/mi_rkey.c: Manual null merge as a better fix is already present. mysql-test/r/myisam.result: Manual null merge as a better fix is already present. mysql-test/t/myisam.test: Manual null merge as a better fix is already present. sql/sql_select.cc: Manual merge of purify improvements.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index ecb9b5b7fe8..39abef97bb4 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -9083,6 +9083,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;
@@ -9111,14 +9113,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 ||