1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

fixed bug #910 (right type of ifnull function)

mysql-test/r/create.result:
  added test for bug #910 (right type of ifnull function)
mysql-test/t/create.test:
  added test for bug #910 (right type of ifnull function)
sql/field.h:
  added new constructors of Field_decimal, Field_tiny, Field_short, Field_float,
  Field_null, Field_year
  for using in Item::tmp_table_field_from_field_type
sql/item.cc:
  added Item::tmp_table_field_from_field_type
sql/item.h:
  added Item::tmp_table_field_from_field_type
This commit is contained in:
unknown
2003-08-27 19:11:54 -04:00
parent 6496a0dd14
commit a73058a77c
7 changed files with 202 additions and 0 deletions

View File

@ -687,8 +687,21 @@ Item_func_ifnull::fix_length_and_dec()
agg_arg_collations(collation, args, arg_count);
else if (cached_result_type != REAL_RESULT)
decimals= 0;
cached_field_type= args[0]->field_type();
if (cached_field_type != args[1]->field_type())
cached_field_type= Item_func::field_type();
}
enum_field_types Item_func_ifnull::field_type() const
{
return cached_field_type;
}
Field *Item_func_ifnull::tmp_table_field(TABLE *table)
{
return tmp_table_field_from_field_type(table);
}
double
Item_func_ifnull::val()