1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Remove dflt_field from field structure as this was only needed when createing temporary table and I found another soultion that doesn't increase the size of the field structure for all table instances. (Better fix for bug #19089)

Fixed compiler warnings
Fixed valgrind warning in Item_date_add_intervall::eq. (Recoding of bugfix #19490)


sql/field.cc:
  remove dflt_field from field structure (not needed)
  Simple cleanup of code that been copied elsewhere
sql/field.h:
  remove dflt_field from field structure (not needed)
sql/item.h:
  Removed compiler warnings
sql/item_timefunc.cc:
  Fixed Item_date_add_intervall::eq
  The problem was that when we call 'eq' 'this' is not fixed, which means we can't call const_item() or a value function.
  I fixed this so that we check eq for all arguments and that the sign and type are identical.
  (The original code gave a 'accessing uninitialized data' in valgrind.
sql/mysql_priv.h:
  Added default fields to create_tmp_field
sql/sql_insert.cc:
  New default_field parameter to create_tmp_field()
sql/sql_select.cc:
  New default_field parameter to create_tmp_field()
  Use this in create_tmp_table() to set right default value for a field
This commit is contained in:
unknown
2006-05-24 11:56:59 +03:00
parent fc2e96ee7b
commit 12a0f4ff14
7 changed files with 51 additions and 72 deletions

View File

@ -2500,12 +2500,13 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
while ((item=it++))
{
create_field *cr_field;
Field *field;
Field *field, *def_field;
if (item->type() == Item::FUNC_ITEM)
field=item->tmp_table_field(&tmp_table);
field= item->tmp_table_field(&tmp_table);
else
field=create_tmp_field(thd, &tmp_table, item, item->type(),
(Item ***) 0, &tmp_field, 0, 0, 0, 0, 0);
field= create_tmp_field(thd, &tmp_table, item, item->type(),
(Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0,
0);
if (!field ||
!(cr_field=new create_field(field,(item->type() == Item::FIELD_ITEM ?
((Item_field *)item)->field :