List:Commits« Previous MessageNext Message »
From:Jorgen Loland Date:April 11 2012 12:47pm
Subject:bzr push into mysql-trunk branch (jorgen.loland:3826 to 3828)
View as plain text  
 3828 Jorgen Loland	2012-04-11
      Refactoring: change return type of Field::store() and friends
      from poorly defined int to enum.
            
      Rename type_covert_status to type_conversion_status
      Rename decimal_error_to_type_convert_status()
          to decimal_err_to_type_conv_status()

    modified:
      sql/field.cc
      sql/field.h
      sql/field_conv.cc
      sql/item.cc
      sql/item.h
      sql/item_func.cc
      sql/item_func.h
      sql/item_strfunc.h
      sql/item_timefunc.cc
      sql/item_timefunc.h
      sql/opt_range.cc
      sql/sql_select.h
      sql/unireg.cc
      unittest/gunit/field-t.cc
      unittest/gunit/item-t.cc
 3827 Jorgen Loland	2012-04-11
      Refactoring: change return type of Field::store() and friends
      from poorly defined int to enum.
      
      Review comments from Martin

    modified:
      sql-common/my_time.c
      sql/field.cc
      sql/field.h
      sql/field_conv.cc
      sql/item.cc
      sql/opt_range.cc
      sql/sql_base.cc
      sql/sql_select.h
      sql/unireg.cc
      unittest/gunit/field-t.cc
 3826 Jorgen Loland	2012-03-30
      Refactoring: change return type of Field::store() and friends
      from poorly defined int to enum.
      
      store/convert return value mapping (old int vs new enum)
      --------------------------------------------------------
      // Return value "No problem"
      TYPE_OK: No problems when converting/storing the
      value. (Previously 0)
      
      // Return values "Some conversion difficulty happened, 
      //                but MySQL could handle it."
      TYPE_WARN_OUT_OF_RANGE: The value is higher or lower than the
      valid range. The max/min value is used instead. (Previously 1)
      
      TYPE_NOTE_TIME_TRUNCATED: A datetime=>time or datetime=>date
      conversion took place. Conversion went fine, but date or time
      information was lost during conversion. (Previously 3)
      
      TYPE_NOTE_TRUNCATED: Some garbage was cut, some precision was
      lost or similar, but apart from that conversion went fine. The
      truncated value is used. (The usage of return value after
      truncation was not consistent. Could be 1 or 2)
      
      // Return values "Conversion/storage could not be done - 
      //                the value was not usable"
      TYPE_ERR_NULL_VIOLATION: Trying to convert/store a NULL, but NULL
      was not an acceptable value. (Previously -1)
      
      TYPE_ERR_BAD_VALUE: A value that cannot be converted/stored was
      provided. (Previously 2)
      
      TYPE_ERR_OOM: Out of memory error. (Previously 2)
     @ sql-common/my_time.c
        check_date now returns int instead of bool
     @ sql/field.cc
        Use type_status as return type for all Field::store functions
     @ sql/field.h
        Add enum type_status
        Use type_status as return type for all Field::store functions
     @ sql/field_conv.cc
        Use type_status as return type for all Field::store functions
     @ sql/item.cc
        Use type_status as return type for all Item::save_in_field 
        functions
     @ sql/item.h
        Use type_status as return type for all Item::save_in_field 
        functions
     @ sql/item_cmpfunc.cc
        Use type_status as return type for all Item::save_in_field 
        functions
     @ sql/item_func.cc
        Use type_status as return type for all Item::save_in_field 
        functions
     @ sql/item_func.h
        Use type_status as return type for all Item::save_in_field 
        functions
     @ sql/item_strfunc.h
        Use type_status as return type for all Item::save_in_field 
        functions
     @ sql/item_timefunc.cc
        Use type_status as return type for all Item::save_in_field 
        functions
     @ sql/item_timefunc.h
        Use type_status as return type for all Item::save_in_field 
        functions
     @ sql/opt_range.cc
        Item::save_in_field_no_warnings() now returns type_status,
        making it possible to distinguish between different kinds
        of conversion errors when setting up the ranges in get_mm_leaf()
     @ sql/sql_select.h
        Item::save_in_field now returns type_status instead of int
     @ sql/unireg.cc
        Item::save_in_field now returns type_status instead of int
     @ unittest/gunit/field-t.cc
        Add unit tests for saving various values in Field_long, 
        Field_date and Field_datetime.
     @ unittest/gunit/item-t.cc
        Field::store() now returns type_status

    modified:
      mysql-test/r/ctype_ucs.result
      mysql-test/r/type_bit.result
      mysql-test/t/ctype_ucs.test
      mysql-test/t/type_bit.test
      sql-common/my_time.c
      sql/field.cc
      sql/field.h
      sql/field_conv.cc
      sql/item.cc
      sql/item.h
      sql/item_cmpfunc.cc
      sql/item_func.cc
      sql/item_func.h
      sql/item_strfunc.h
      sql/item_timefunc.cc
      sql/item_timefunc.h
      sql/opt_range.cc
      sql/sql_base.cc
      sql/sql_select.h
      sql/unireg.cc
      unittest/gunit/field-t.cc
      unittest/gunit/item-t.cc
=== modified file 'sql-common/my_time.c'
--- a/sql-common/my_time.c	2012-03-30 13:55:22 +0000
+++ b/sql-common/my_time.c	2012-04-11 12:11:35 +0000
@@ -825,13 +825,13 @@ fractional:
 
 
 /**
-  Convert numer to TIME
+  Convert number to TIME
   @param nr            Number to convert.
   @param OUT ltime     Variable to convert to.
   @param OUT warnings  Warning vector.
 
-  @retval FALSE: OK
-  @retval TRUE:  nr is out of range
+  @retval false OK
+  @retval true No. is out of range
 */
 my_bool
 number_to_time(longlong nr, MYSQL_TIME *ltime, int *warnings)

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2012-03-30 13:55:22 +0000
+++ b/sql/field.cc	2012-04-11 12:47:00 +0000
@@ -1192,7 +1192,7 @@ void Field_num::prepend_zeros(String *va
   @return TYPE_OK, TYPE_ERR_BAD_VALUE or TYPE_NOTE_TRUNCATED
 */
 
-type_convert_status
+type_conversion_status
 Field_num::check_int(const CHARSET_INFO *cs, const char *str, int length,
                      const char *int_end, int error)
 {
@@ -1240,7 +1240,7 @@ Field_num::check_int(const CHARSET_INFO 
           TYPE_NOTE_TRUNCATED
 */
 
-type_convert_status
+type_conversion_status
 Field_num::get_int(const CHARSET_INFO *cs, const char *from, uint len,
                    longlong *rnd, ulonglong unsigned_max,
                    longlong signed_min, longlong signed_max)
@@ -1271,7 +1271,7 @@ Field_num::get_int(const CHARSET_INFO *c
       goto out_of_range;
     }
   }
-  if (table->in_use->count_cuted_fields)
+  if (table->in_use->count_cuted_fields != 0)
     return check_int(cs, from, len, end, error);
 
   return TYPE_OK;
@@ -1290,7 +1290,7 @@ out_of_range:
   Field_real (common parent for Field_decimal, Field_float, Field_double),
   Field_new_decimal, Field_year.
 */
-type_convert_status
+type_conversion_status
 Field_num::store_time(MYSQL_TIME *ltime,
                       uint8 dec_arg __attribute__((unused)))
 {
@@ -1459,13 +1459,13 @@ bool Field::compatible_field_size(uint f
 }
 
 
-type_convert_status
+type_conversion_status
 Field::store(const char *to, uint length, const CHARSET_INFO *cs,
              enum_check_fields check_level)
 {
   enum_check_fields old_check_level= table->in_use->count_cuted_fields;
   table->in_use->count_cuted_fields= check_level;
-  const type_convert_status res= store(to, length, cs);
+  const type_conversion_status res= store(to, length, cs);
   table->in_use->count_cuted_fields= old_check_level;
   return res;
 }
@@ -1626,7 +1626,7 @@ void Field::make_field(Send_field *field
   Conversion from decimal to longlong. Checks overflow and returns
   correct value (min/max) in case of overflow.
 
-  @param val             value which have to be converted
+  @param val             value to be converted
   @param unsigned_flag   type of integer to which we convert val
   @param has_overflow    true if there is overflow
 
@@ -1671,17 +1671,16 @@ longlong Field::convert_decimal2longlong
   @note
     This method is used by all integer fields, real/decimal redefine it
 
-  @retval
-    0     OK
-  @retval
-    !=0  error
+  @retval TYPE_OK   Storing of value went fine without warnings or errors
+  @retval !TYPE_OK  Warning/error as indicated by type_conversion_status enum
+                    value
 */
-type_convert_status Field_num::store_decimal(const my_decimal *val)
+type_conversion_status Field_num::store_decimal(const my_decimal *val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   bool has_overflow= false;
   longlong i= convert_decimal2longlong(val, unsigned_flag, &has_overflow);
-  const type_convert_status res= store(i, unsigned_flag);
+  const type_conversion_status res= store(i, unsigned_flag);
   return has_overflow ? TYPE_WARN_OUT_OF_RANGE : res;
 }
 
@@ -1764,16 +1763,16 @@ void Field_str::make_field(Send_field *f
     !=0  error
 */
 
-type_convert_status Field_str::store_decimal(const my_decimal *d)
+type_conversion_status Field_str::store_decimal(const my_decimal *d)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   double val;
   /* TODO: use decimal2string? */
   int err= my_decimal2double(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW, d, &val);
   warn_if_overflow(err);
-  const type_convert_status res= store(val);
+  const type_conversion_status res= store(val);
 
-  return (err != E_DEC_OK) ? decimal_error_to_type_convert_status(err) : res;
+  return (err != E_DEC_OK) ? decimal_err_to_type_conv_status(err) : res;
 }
 
 
@@ -1844,7 +1843,7 @@ bool Field::get_timestamp(struct timeval
     Needs to be changed if/when we want to support different time formats.
 */
 
-type_convert_status Field::store_time(MYSQL_TIME *ltime, uint8 dec_arg)
+type_conversion_status Field::store_time(MYSQL_TIME *ltime, uint8 dec_arg)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   char buff[MAX_DATE_STRING_REP_LENGTH];
@@ -1930,7 +1929,7 @@ void Field_null::sql_type(String &res) c
   This is an number stored as a pre-space (or pre-zero) string
 ****************************************************************************/
 
-type_convert_status Field_decimal::reset(void)
+type_conversion_status Field_decimal::reset(void)
 {
   Field_decimal::store(STRING_WITH_LEN("0"),&my_charset_bin);
   return TYPE_OK;
@@ -1975,8 +1974,8 @@ void Field_decimal::overflow(bool negati
 }
 
 
-type_convert_status Field_decimal::store(const char *from_arg, uint len,
-                                         const CHARSET_INFO *cs)
+type_conversion_status Field_decimal::store(const char *from_arg, uint len,
+                                            const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   char buff[STRING_BUFFER_USUAL_SIZE];
@@ -2342,7 +2341,7 @@ type_convert_status Field_decimal::store
 }
 
 
-type_convert_status Field_decimal::store(double nr)
+type_conversion_status Field_decimal::store(double nr)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   if (unsigned_flag && nr < 0)
@@ -2381,7 +2380,7 @@ type_convert_status Field_decimal::store
 }
 
 
-type_convert_status Field_decimal::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_decimal::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   char buff[22];
@@ -2616,7 +2615,7 @@ Field *Field_new_decimal::create_from_it
 }
 
 
-type_convert_status Field_new_decimal::reset(void)
+type_conversion_status Field_new_decimal::reset(void)
 {
   store_value(&decimal_zero);
   return TYPE_OK;
@@ -2660,11 +2659,11 @@ void Field_new_decimal::set_value_on_ove
   @retval
     1 error
 */
-type_convert_status
+type_conversion_status
 Field_new_decimal::store_value(const my_decimal *decimal_value)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   DBUG_ENTER("Field_new_decimal::store_value");
 #ifndef DBUG_OFF
   {
@@ -2701,12 +2700,12 @@ Field_new_decimal::store_value(const my_
   }
   DBUG_EXECUTE("info", print_decimal_buff(decimal_value, (uchar *) ptr,
                                           bin_size););
-  DBUG_RETURN((err != E_DEC_OK) ? decimal_error_to_type_convert_status(err)
+  DBUG_RETURN((err != E_DEC_OK) ? decimal_err_to_type_conv_status(err)
                                 : error);
 }
 
 
-type_convert_status
+type_conversion_status
 Field_new_decimal::store(const char *from, uint length,
                          const CHARSET_INFO *charset_arg)
 {
@@ -2728,7 +2727,7 @@ Field_new_decimal::store(const char *fro
                         ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
                         "decimal", errmsg.ptr(), field_name,
                         static_cast<ulong>(da->current_row_for_warning()));
-    DBUG_RETURN(decimal_error_to_type_convert_status(err));
+    DBUG_RETURN(decimal_err_to_type_conv_status(err));
   }
 
   if (err != 0)
@@ -2742,14 +2741,15 @@ Field_new_decimal::store(const char *fro
   store_value(&decimal_value);
 
 
-  DBUG_RETURN(decimal_error_to_type_convert_status(err));
+  DBUG_RETURN(decimal_err_to_type_conv_status(err));
 }
 
 
-type_convert_status store_internal_with_error_check(Field_new_decimal *field,
-                                                    int err, my_decimal *value)
+type_conversion_status
+store_internal_with_error_check(Field_new_decimal *field,
+                                int err, my_decimal *value)
 {
-  type_convert_status stat= TYPE_OK;
+  type_conversion_status stat= TYPE_OK;
   if (err != 0)
   {
     if (field->check_overflow(err))
@@ -2762,7 +2762,7 @@ type_convert_status store_internal_with_
     /* Only issue a warning if store_value doesn't issue an warning */
     field->table->in_use->got_warning= 0;
   }
-  type_convert_status store_stat= field->store_value(value);
+  type_conversion_status store_stat= field->store_value(value);
   if (store_stat != TYPE_OK)
     return store_stat;
   else if (err != 0 && !field->table->in_use->got_warning)
@@ -2776,7 +2776,7 @@ type_convert_status store_internal_with_
   will return E_DEC_TRUNCATED always correctly
 */
 
-type_convert_status Field_new_decimal::store(double nr)
+type_conversion_status Field_new_decimal::store(double nr)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   DBUG_ENTER("Field_new_decimal::store(double)");
@@ -2787,7 +2787,7 @@ type_convert_status Field_new_decimal::s
   DBUG_RETURN(store_internal_with_error_check(this, conv_err, &decimal_value));
 }
 
-type_convert_status
+type_conversion_status
 Field_new_decimal::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
@@ -2799,7 +2799,7 @@ Field_new_decimal::store(longlong nr, bo
 }
 
 
-type_convert_status
+type_conversion_status
 Field_new_decimal::store_decimal(const my_decimal *decimal_value)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
@@ -2807,7 +2807,7 @@ Field_new_decimal::store_decimal(const m
 }
 
 
-type_convert_status
+type_conversion_status
 Field_new_decimal::store_time(MYSQL_TIME *ltime,
                                   uint8 dec_arg __attribute__((unused)))
 {
@@ -3045,23 +3045,23 @@ Field_new_decimal::unpack(uchar* to,
 ** tiny int
 ****************************************************************************/
 
-type_convert_status
+type_conversion_status
 Field_tiny::store(const char *from,uint len, const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   longlong rnd;
   
-  const type_convert_status error= get_int(cs, from, len, &rnd,
+  const type_conversion_status error= get_int(cs, from, len, &rnd,
                                            255, -128, 127);
   ptr[0]= unsigned_flag ? (char) (ulonglong) rnd : (char) rnd;
   return error;
 }
 
 
-type_convert_status Field_tiny::store(double nr)
+type_conversion_status Field_tiny::store(double nr)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   nr=rint(nr);
   if (unsigned_flag)
   {
@@ -3101,10 +3101,10 @@ type_convert_status Field_tiny::store(do
 }
 
 
-type_convert_status Field_tiny::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_tiny::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
 
   if (unsigned_flag)
   {
@@ -3222,14 +3222,14 @@ void Field_tiny::sql_type(String &res) c
  Field type short int (2 byte)
 ****************************************************************************/
 
-type_convert_status
+type_conversion_status
 Field_short::store(const char *from,uint len, const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   int store_tmp;
   longlong rnd;
   
-  const type_convert_status error=
+  const type_conversion_status error=
     get_int(cs, from, len, &rnd, UINT_MAX16, INT_MIN16, INT_MAX16);
   store_tmp= unsigned_flag ? (int) (ulonglong) rnd : (int) rnd;
 #ifdef WORDS_BIGENDIAN
@@ -3244,10 +3244,10 @@ Field_short::store(const char *from,uint
 }
 
 
-type_convert_status Field_short::store(double nr)
+type_conversion_status Field_short::store(double nr)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   int16 res;
   nr=rint(nr);
   if (unsigned_flag)
@@ -3296,10 +3296,10 @@ type_convert_status Field_short::store(d
 }
 
 
-type_convert_status Field_short::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_short::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   int16 res;
 
   if (unsigned_flag)
@@ -3471,14 +3471,14 @@ void Field_short::sql_type(String &res) 
   Field type medium int (3 byte)
 ****************************************************************************/
 
-type_convert_status Field_medium::store(const char *from,uint len,
-                                const CHARSET_INFO *cs)
+type_conversion_status Field_medium::store(const char *from,uint len,
+                                           const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   int store_tmp;
   longlong rnd;
   
-  const type_convert_status error=
+  const type_conversion_status error=
     get_int(cs, from, len, &rnd, UINT_MAX24, INT_MIN24, INT_MAX24);
   store_tmp= unsigned_flag ? (int) (ulonglong) rnd : (int) rnd;
   int3store(ptr, store_tmp);
@@ -3486,10 +3486,10 @@ type_convert_status Field_medium::store(
 }
 
 
-type_convert_status Field_medium::store(double nr)
+type_conversion_status Field_medium::store(double nr)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   nr=rint(nr);
   if (unsigned_flag)
   {
@@ -3532,10 +3532,10 @@ type_convert_status Field_medium::store(
 }
 
 
-type_convert_status Field_medium::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_medium::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
 
   if (unsigned_flag)
   {
@@ -3663,14 +3663,14 @@ void Field_medium::sql_type(String &res)
 ** long int
 ****************************************************************************/
 
-type_convert_status Field_long::store(const char *from,uint len,
-                              const CHARSET_INFO *cs)
+type_conversion_status Field_long::store(const char *from,uint len,
+                                         const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   long store_tmp;
   longlong rnd;
   
-  const type_convert_status error=
+  const type_conversion_status error=
     get_int(cs, from, len, &rnd, UINT_MAX32, INT_MIN32, INT_MAX32);
   store_tmp= unsigned_flag ? (long) (ulonglong) rnd : (long) rnd;
 #ifdef WORDS_BIGENDIAN
@@ -3685,10 +3685,10 @@ type_convert_status Field_long::store(co
 }
 
 
-type_convert_status Field_long::store(double nr)
+type_conversion_status Field_long::store(double nr)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   int32 res;
   nr=rint(nr);
   if (unsigned_flag)
@@ -3737,10 +3737,10 @@ type_convert_status Field_long::store(do
 }
 
 
-type_convert_status Field_long::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_long::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   int32 res;
 
   if (unsigned_flag)
@@ -3912,12 +3912,12 @@ void Field_long::sql_type(String &res) c
  Field type longlong int (8 bytes)
 ****************************************************************************/
 
-type_convert_status
+type_conversion_status
 Field_longlong::store(const char *from,uint len, const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   int conv_err= 0;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   char *end;
   ulonglong tmp;
 
@@ -3945,10 +3945,10 @@ Field_longlong::store(const char *from,u
 }
 
 
-type_convert_status Field_longlong::store(double nr)
+type_conversion_status Field_longlong::store(double nr)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   longlong res;
 
   nr= rint(nr);
@@ -3999,10 +3999,10 @@ type_convert_status Field_longlong::stor
 }
 
 
-type_convert_status Field_longlong::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_longlong::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
 
   if (nr < 0)                                   // Only possible error
   {
@@ -4206,7 +4206,7 @@ Field_real::unpack(uchar *to, const ucha
 }
 
 
-type_convert_status
+type_conversion_status
 Field_real::store_time(MYSQL_TIME *ltime,
                        uint8 dec_arg __attribute__((unused)))
 {
@@ -4219,11 +4219,11 @@ Field_real::store_time(MYSQL_TIME *ltime
   single precision float
 ****************************************************************************/
 
-type_convert_status
+type_conversion_status
 Field_float::store(const char *from,uint len, const CHARSET_INFO *cs)
 {
   int conv_error;
-  type_convert_status err= TYPE_OK;
+  type_conversion_status err= TYPE_OK;
   char *end;
   double nr= my_strntod(cs,(char*) from,len,&end,&conv_error);
   if (conv_error || (!len || ((uint) (end-from) != len &&
@@ -4240,10 +4240,10 @@ Field_float::store(const char *from,uint
 }
 
 
-type_convert_status Field_float::store(double nr)
+type_conversion_status Field_float::store(double nr)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  const type_convert_status error=
+  const type_conversion_status error=
     truncate(&nr, FLT_MAX) ? TYPE_WARN_OUT_OF_RANGE : TYPE_OK;
 
   float j= (float)nr;
@@ -4260,7 +4260,7 @@ type_convert_status Field_float::store(d
 }
 
 
-type_convert_status Field_float::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_float::store(longlong nr, bool unsigned_val)
 {
   return Field_float::store(unsigned_val ? ulonglong2double((ulonglong) nr) :
                             (double) nr);
@@ -4447,11 +4447,11 @@ void Field_float::sql_type(String &res) 
   double precision floating point numbers
 ****************************************************************************/
 
-type_convert_status
+type_conversion_status
 Field_double::store(const char *from,uint len, const CHARSET_INFO *cs)
 {
   int conv_error;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   char *end;
   double nr= my_strntod(cs,(char*) from, len, &end, &conv_error);
   if ((conv_error != 0) || (!len || ((uint) (end-from) != len &&
@@ -4468,10 +4468,10 @@ Field_double::store(const char *from,uin
 }
 
 
-type_convert_status Field_double::store(double nr)
+type_conversion_status Field_double::store(double nr)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  const type_convert_status error=
+  const type_conversion_status error=
     truncate(&nr, DBL_MAX) ? TYPE_WARN_OUT_OF_RANGE : TYPE_OK;
 
 #ifdef WORDS_BIGENDIAN
@@ -4486,7 +4486,7 @@ type_convert_status Field_double::store(
 }
 
 
-type_convert_status Field_double::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_double::store(longlong nr, bool unsigned_val)
 {
   return Field_double::store(unsigned_val ? ulonglong2double((ulonglong) nr) :
                              (double) nr);
@@ -4549,7 +4549,7 @@ bool Field_real::truncate(double *nr, do
 }
 
 
-type_convert_status Field_real::store_decimal(const my_decimal *dm)
+type_conversion_status Field_real::store_decimal(const my_decimal *dm)
 {
   double dbl;
   my_decimal2double(E_DEC_FATAL_ERROR, dm, &dbl);
@@ -4808,13 +4808,13 @@ Field_temporal::set_warnings(ErrConvStri
 }
 
 
-type_convert_status Field_temporal::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_temporal::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   int warnings= 0;
   MYSQL_TIME ltime;
-  type_convert_status error= convert_number_to_TIME(nr, unsigned_val, 0,
-                                            &ltime, &warnings);
+  type_conversion_status error= convert_number_to_TIME(nr, unsigned_val, 0,
+                                                       &ltime, &warnings);
   if (error == TYPE_OK)
     error= store_internal(&ltime, &warnings);
   else
@@ -4832,11 +4832,11 @@ type_convert_status Field_temporal::stor
 }
 
 
-type_convert_status
+type_conversion_status
 Field_temporal::store_lldiv_t(const lldiv_t *lld, int *warnings)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error;
+  type_conversion_status error;
   MYSQL_TIME ltime;
   error= convert_number_to_TIME(lld->quot, 0, lld->rem, &ltime, warnings);
   if (error == TYPE_OK)
@@ -4844,8 +4844,8 @@ Field_temporal::store_lldiv_t(const lldi
   else if (!*warnings)
   {
     DBUG_ASSERT(warnings != 0); // Must be set by convert_number_to_TIME
-    if ((*warnings & (MYSQL_TIME_WARN_ZERO_DATE |
-                     MYSQL_TIME_WARN_ZERO_IN_DATE)) &&
+    if (((*warnings & MYSQL_TIME_WARN_ZERO_DATE) != 0 ||
+         (*warnings & MYSQL_TIME_WARN_ZERO_IN_DATE) != 0) &&
         !current_thd->is_strict_mode())
       error= TYPE_NOTE_TIME_TRUNCATED;
   }
@@ -4854,27 +4854,27 @@ Field_temporal::store_lldiv_t(const lldi
 }
 
 
-type_convert_status Field_temporal::store_decimal(const my_decimal *decimal)
+type_conversion_status Field_temporal::store_decimal(const my_decimal *decimal)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   lldiv_t lld;
   int warnings= 0;
   /* Pass 0 in the first argument, not to produce warnings automatically */
   my_decimal2lldiv_t(0, decimal, &lld);
-  const type_convert_status error= store_lldiv_t(&lld, &warnings);
+  const type_conversion_status error= store_lldiv_t(&lld, &warnings);
   if (warnings)
     set_warnings(ErrConvString(decimal), warnings);
   return error;
 }
 
 
-type_convert_status Field_temporal::store(double nr)
+type_conversion_status Field_temporal::store(double nr)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   int warnings= 0;
   lldiv_t lld;
   double2lldiv_t(nr, &lld);
-  const type_convert_status error= store_lldiv_t(&lld, &warnings);
+  const type_conversion_status error= store_lldiv_t(&lld, &warnings);
   if (warnings)
     set_warnings(ErrConvString(nr), warnings);
    return error;
@@ -4888,19 +4888,15 @@ type_convert_status Field_temporal::stor
   @param  len     Length of the string
   @param  cs      Character set of the string
 
-  @retval  0  ok
-  @retval  1  Value was cut during conversion
-  @retval  2  Wrong date/time string
-  @retval  3  Date/time value that was cut (warning level NOTE)
-              This is used by opt_range.cc:get_mm_leaf().
-
-              Only Field_newdate can return TYPE_NOTE_TIME_TRUNCATED.
+  @retval TYPE_OK   Storing of value went fine without warnings or errors
+  @retval !TYPE_OK  Warning/error as indicated by type_conversion_status enum
+                    value
 */
-type_convert_status
+type_conversion_status
 Field_temporal::store(const char *str, uint len, const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   MYSQL_TIME ltime;
   MYSQL_TIME_STATUS status;
   if (convert_str_to_TIME(str, len, cs, &ltime, &status))
@@ -4915,11 +4911,11 @@ Field_temporal::store(const char *str, u
   }
   else
   {
-    error= time_warning_to_type_convert_status(status.warnings);
+    error= time_warning_to_type_conversion_status(status.warnings);
 
-    const type_convert_status tmp_error= store_internal_with_round(&ltime,
+    const type_conversion_status tmp_error= store_internal_with_round(&ltime,
                                                            &status.warnings);
-    // @see type_convert_status
+    // @see type_conversion_status
     if (tmp_error > error)
       error= tmp_error;
   }
@@ -5054,7 +5050,7 @@ String *Field_temporal_with_date::val_st
 }
 
 
-type_convert_status
+type_conversion_status
 Field_temporal_with_date::convert_number_to_TIME(longlong nr,
                                                  bool unsigned_val,
                                                  int nanoseconds,
@@ -5087,12 +5083,12 @@ Field_temporal_with_date::convert_number
 }
 
 
-type_convert_status
+type_conversion_status
 Field_temporal_with_date::store_time(MYSQL_TIME *ltime,
                                      uint8 dec_arg __attribute__((unused)))
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error;
+  type_conversion_status error;
   int warnings= 0;
 
   switch (ltime->time_type) // TS-TODO: split into separate methods?
@@ -5103,9 +5099,10 @@ Field_temporal_with_date::store_time(MYS
     {
       DBUG_ASSERT(warnings &
                   (MYSQL_TIME_WARN_OUT_OF_RANGE |
-                   MYSQL_TIME_WARN_ZERO_DATE | MYSQL_TIME_WARN_ZERO_IN_DATE));
+                   MYSQL_TIME_WARN_ZERO_DATE |
+                   MYSQL_TIME_WARN_ZERO_IN_DATE));
 
-      error= time_warning_to_type_convert_status(warnings);
+      error= time_warning_to_type_conversion_status(warnings);
       reset();
     }
     else
@@ -5157,14 +5154,14 @@ bool Field_temporal_with_date::send_bina
 }
 
 
-type_convert_status
+type_conversion_status
 Field_temporal_with_date::store_internal_with_round(MYSQL_TIME *ltime,
                                                     int *warnings)
 {
   if (my_datetime_round(ltime, dec, warnings))
   {
     reset();
-    return time_warning_to_type_convert_status(*warnings);
+    return time_warning_to_type_conversion_status(*warnings);
   }
   else
     return store_internal(ltime, warnings);
@@ -5333,14 +5330,14 @@ ulonglong Field_timestamp::date_flags(co
 }
 
 
-type_convert_status
+type_conversion_status
 Field_timestamp::store_internal(const MYSQL_TIME *ltime, int *warnings)
 {
   THD *thd= table ? table->in_use : current_thd;
   struct timeval tm;
   convert_TIME_to_timestamp(thd, ltime, &tm, warnings);
-  const type_convert_status error=
-    time_warning_to_type_convert_status(*warnings);
+  const type_conversion_status error=
+    time_warning_to_type_conversion_status(*warnings);
   store_timestamp_internal(&tm);
   return error;
 }
@@ -5404,7 +5401,7 @@ void Field_timestamp::store_timestamp_in
 }
 
 
-type_convert_status Field_timestamp::store_packed(longlong nr)
+type_conversion_status Field_timestamp::store_packed(longlong nr)
 {
   /* Make sure the stored value was previously properly rounded or truncated */
   DBUG_ASSERT((MY_PACKED_TIME_GET_FRAC_PART(nr) % 
@@ -5514,7 +5511,7 @@ ulonglong Field_timestampf::date_flags(c
 }
 
 
-type_convert_status Field_timestampf::reset()
+type_conversion_status Field_timestampf::reset()
 {
   memset(ptr, 0, pack_length());
   return TYPE_OK;
@@ -5527,19 +5524,20 @@ void Field_timestampf::store_timestamp_i
 }
 
 
-type_convert_status
+type_conversion_status
 Field_timestampf::store_internal(const MYSQL_TIME *ltime, int *warnings)
 {
   THD *thd= table ? table->in_use : current_thd;
   struct timeval tm;
   convert_TIME_to_timestamp(thd, ltime, &tm, warnings);
-  const type_convert_status error= time_warning_to_type_convert_status(*warnings);
+  const type_conversion_status error=
+    time_warning_to_type_conversion_status(*warnings);
   store_timestamp_internal(&tm);
   return error;
 }
 
 
-type_convert_status Field_timestampf::store_packed(longlong nr)
+type_conversion_status Field_timestampf::store_packed(longlong nr)
 {
   MYSQL_TIME ltime;
   TIME_from_longlong_datetime_packed(&ltime, nr);
@@ -5605,7 +5603,7 @@ Field_time_common::convert_str_to_TIME(c
 }
 
 
-type_convert_status
+type_conversion_status
 Field_time_common::convert_number_to_TIME(longlong nr, bool unsigned_val,
                                           int nanoseconds,
                                           MYSQL_TIME *ltime, int *warnings)
@@ -5632,12 +5630,12 @@ Field_time_common::convert_number_to_TIM
   bool round_error= time_add_nanoseconds_with_round(ltime, nanoseconds,
                                                     warnings);
 
-  return round_error ? time_warning_to_type_convert_status(*warnings)
+  return round_error ? time_warning_to_type_conversion_status(*warnings)
                      : TYPE_OK;
 }
 
 
-type_convert_status
+type_conversion_status
 Field_time_common::store_time(MYSQL_TIME *ltime,
                               uint8 dec_arg __attribute__((unused)))
 {
@@ -5654,7 +5652,7 @@ Field_time_common::store_time(MYSQL_TIME
 }
 
 
-type_convert_status
+type_conversion_status
 Field_time_common::store_internal_with_round(MYSQL_TIME *ltime, int *warnings)
 {
   if (my_time_round(ltime, dec))
@@ -5736,7 +5734,7 @@ bool Field_time_common::send_binary(Prot
 ** Stored as a 3 byte unsigned int
 ****************************************************************************/
 
-type_convert_status
+type_conversion_status
 Field_time::store_internal(const MYSQL_TIME *ltime, int *warnings)
 {
   long tmp= ((ltime->month ? 0 : ltime->day * 24L) + ltime->hour) * 10000L +
@@ -5748,7 +5746,7 @@ Field_time::store_internal(const MYSQL_T
 }
 
 
-type_convert_status Field_time::store_packed(longlong nr)
+type_conversion_status Field_time::store_packed(longlong nr)
 {
   MYSQL_TIME ltime;
   TIME_from_longlong_time_packed(&ltime, nr);
@@ -5868,13 +5866,13 @@ void Field_timef::sql_type(String &res) 
 }
 
 
-type_convert_status Field_timef::reset()
+type_conversion_status Field_timef::reset()
 {
   return store_packed(0);
 }
 
 
-type_convert_status Field_timef::store_packed(longlong nr)
+type_conversion_status Field_timef::store_packed(longlong nr)
 {
   my_time_packed_to_binary(nr, ptr, dec);
   return TYPE_OK;
@@ -5888,10 +5886,10 @@ longlong Field_timef::val_time_temporal(
 }
 
 
-type_convert_status
+type_conversion_status
 Field_timef::store_internal(const MYSQL_TIME *ltime, int *warnings)
 {
-  type_convert_status rc= store_packed(TIME_to_longlong_time_packed(ltime));
+  type_conversion_status rc= store_packed(TIME_to_longlong_time_packed(ltime));
   if (rc == TYPE_OK && non_zero_date(ltime))
   {
     /*
@@ -5920,13 +5918,13 @@ bool Field_timef::get_time(MYSQL_TIME *l
 ** Can handle 2 byte or 4 byte years!
 ****************************************************************************/
 
-type_convert_status
+type_conversion_status
 Field_year::store(const char *from, uint len,const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   char *end;
   int conv_error;
-  type_convert_status ret= TYPE_OK;
+  type_conversion_status ret= TYPE_OK;
   longlong nr= cs->cset->strntoull10rnd(cs, from, len, 0, &end, &conv_error);
 
   if (nr < 0 || (nr >= 100 && nr <= 1900) || nr > 2155 ||
@@ -5965,7 +5963,7 @@ Field_year::store(const char *from, uint
 }
 
 
-type_convert_status Field_year::store(double nr)
+type_conversion_status Field_year::store(double nr)
 {
   if (nr < 0.0 || nr >= 2155.0)
   {
@@ -5976,7 +5974,7 @@ type_convert_status Field_year::store(do
 }
 
 
-type_convert_status
+type_conversion_status
 Field_year::store_time(MYSQL_TIME *ltime,
                        uint8 dec_arg __attribute__((unused)))
 {
@@ -5993,7 +5991,7 @@ Field_year::store_time(MYSQL_TIME *ltime
 }
 
 
-type_convert_status Field_year::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_year::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   if (nr < 0 || (nr >= 100 && nr <= 1900) || nr > 2155)
@@ -6074,7 +6072,7 @@ ulonglong Field_newdate::date_flags(cons
 }
 
 
-type_convert_status
+type_conversion_status
 Field_newdate::store_internal(const MYSQL_TIME *ltime, int *warnings)
 {
   long tmp= ltime->day + ltime->month * 32 + ltime->year * 16 * 32;
@@ -6100,7 +6098,7 @@ bool Field_newdate::get_date_internal(MY
 }
 
 
-type_convert_status Field_newdate::store_packed(longlong nr)
+type_conversion_status Field_newdate::store_packed(longlong nr)
 {
   int warnings= 0;
   MYSQL_TIME ltime;
@@ -6233,7 +6231,7 @@ void Field_datetime::store_timestamp_int
   @param tmp    The number, in YYYYMMDDhhmmss format
   @param ptr    Where to store to
 */
-static inline type_convert_status
+static inline type_conversion_status
 datetime_store_internal(TABLE *table, ulonglong tmp, uchar *ptr)
 {
 #ifdef WORDS_BIGENDIAN
@@ -6281,7 +6279,7 @@ bool Field_datetime::get_date_internal(M
 }
 
 
-type_convert_status
+type_conversion_status
 Field_datetime::store_internal(const MYSQL_TIME *ltime, int *warnings)
 {
   ulonglong tmp= TIME_to_ulonglong_datetime(ltime);
@@ -6289,19 +6287,19 @@ Field_datetime::store_internal(const MYS
 }
 
 
-type_convert_status Field_datetime::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_datetime::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   MYSQL_TIME ltime;
   int warnings;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   longlong tmp= convert_number_to_datetime(nr, unsigned_val,
                                            &ltime, &warnings);
   if (tmp == LL(-1))
     error= TYPE_ERR_BAD_VALUE;
   else
   {
-    error= time_warning_to_type_convert_status(warnings);
+    error= time_warning_to_type_conversion_status(warnings);
     datetime_store_internal(table, tmp, ptr);
   }
   if (warnings)
@@ -6310,7 +6308,7 @@ type_convert_status Field_datetime::stor
 }
 
 
-type_convert_status Field_datetime::store_packed(longlong nr)
+type_conversion_status Field_datetime::store_packed(longlong nr)
 {
   MYSQL_TIME ltime;
   TIME_from_longlong_datetime_packed(&ltime, nr);
@@ -6457,7 +6455,7 @@ bool Field_datetimef::get_date_internal(
 }
 
 
-type_convert_status
+type_conversion_status
 Field_datetimef::store_internal(const MYSQL_TIME *ltime, int *warnings)
 {
   store_packed(TIME_to_longlong_datetime_packed(ltime));
@@ -6465,7 +6463,7 @@ Field_datetimef::store_internal(const MY
 }
 
 
-type_convert_status Field_datetimef::reset()
+type_conversion_status Field_datetimef::reset()
 {
   store_packed(0);
   return TYPE_OK;
@@ -6478,7 +6476,7 @@ longlong Field_datetimef::val_date_tempo
 }
 
 
-type_convert_status Field_datetimef::store_packed(longlong nr)
+type_conversion_status Field_datetimef::store_packed(longlong nr)
 {
   my_datetime_packed_to_binary(nr, ptr, dec);
   return TYPE_OK;
@@ -6592,7 +6590,7 @@ Field_longstr::report_if_important_data(
 
 	/* Copy a string and fill with space */
 
-type_convert_status
+type_conversion_status
 Field_string::store(const char *from,uint length,const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
@@ -6635,7 +6633,7 @@ Field_string::store(const char *from,uin
   @param nr            number
 */
 
-type_convert_status Field_str::store(double nr)
+type_conversion_status Field_str::store(double nr)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
@@ -6675,7 +6673,7 @@ uint Field_str::is_equal(Create_field *n
 }
 
 
-type_convert_status Field_string::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_string::store(longlong nr, bool unsigned_val)
 {
   char buff[64];
   int  l;
@@ -6686,7 +6684,7 @@ type_convert_status Field_string::store(
 }
 
 
-type_convert_status Field_longstr::store_decimal(const my_decimal *d)
+type_conversion_status Field_longstr::store_decimal(const my_decimal *d)
 {
   char buff[DECIMAL_MAX_STR_LENGTH+1];
   String str(buff, sizeof(buff), &my_charset_numeric);
@@ -7102,8 +7100,8 @@ int Field_varstring::do_save_field_metad
   return 2;
 }
 
-type_convert_status Field_varstring::store(const char *from,uint length,
-                                   const CHARSET_INFO *cs)
+type_conversion_status Field_varstring::store(const char *from,uint length,
+                                              const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   uint copy_length;
@@ -7134,7 +7132,7 @@ type_convert_status Field_varstring::sto
 }
 
 
-type_convert_status Field_varstring::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_varstring::store(longlong nr, bool unsigned_val)
 {
   char buff[64];
   uint  length;
@@ -7666,7 +7664,7 @@ void Field_blob::put_length(uchar *pos, 
 }
 
 
-type_convert_status
+type_conversion_status
 Field_blob::store(const char *from,uint length,const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
@@ -7753,7 +7751,7 @@ oom_error:
 }
 
 
-type_convert_status Field_blob::store(double nr)
+type_conversion_status Field_blob::store(double nr)
 {
   const CHARSET_INFO *cs=charset();
   value.set_real(nr, NOT_FIXED_DEC, cs);
@@ -7761,7 +7759,7 @@ type_convert_status Field_blob::store(do
 }
 
 
-type_convert_status Field_blob::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_blob::store(longlong nr, bool unsigned_val)
 {
   const CHARSET_INFO *cs=charset();
   value.set_int(nr, unsigned_val, cs);
@@ -8179,7 +8177,7 @@ void Field_geom::sql_type(String &res) c
 }
 
 
-type_convert_status Field_geom::store(double nr)
+type_conversion_status Field_geom::store(double nr)
 {
   my_message(ER_CANT_CREATE_GEOMETRY_OBJECT,
              ER(ER_CANT_CREATE_GEOMETRY_OBJECT), MYF(0));
@@ -8187,7 +8185,7 @@ type_convert_status Field_geom::store(do
 }
 
 
-type_convert_status Field_geom::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_geom::store(longlong nr, bool unsigned_val)
 {
   my_message(ER_CANT_CREATE_GEOMETRY_OBJECT,
              ER(ER_CANT_CREATE_GEOMETRY_OBJECT), MYF(0));
@@ -8195,7 +8193,7 @@ type_convert_status Field_geom::store(lo
 }
 
 
-type_convert_status Field_geom::store_decimal(const my_decimal *)
+type_conversion_status Field_geom::store_decimal(const my_decimal *)
 {
   my_message(ER_CANT_CREATE_GEOMETRY_OBJECT,
              ER(ER_CANT_CREATE_GEOMETRY_OBJECT), MYF(0));
@@ -8203,7 +8201,7 @@ type_convert_status Field_geom::store_de
 }
 
 
-type_convert_status
+type_conversion_status
 Field_geom::store(const char *from, uint length, const CHARSET_INFO *cs)
 {
   if (!length)
@@ -8300,12 +8298,12 @@ void Field_enum::store_type(ulonglong va
     (if there isn't a empty value in the enum)
 */
 
-type_convert_status
+type_conversion_status
 Field_enum::store(const char *from,uint length,const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   int err= 0;
-  type_convert_status ret= TYPE_OK;
+  type_conversion_status ret= TYPE_OK;
   uint32 not_used;
   char buff[STRING_BUFFER_USUAL_SIZE];
   String tmpstr(buff,sizeof(buff), &my_charset_bin);
@@ -8346,16 +8344,16 @@ Field_enum::store(const char *from,uint 
 }
 
 
-type_convert_status Field_enum::store(double nr)
+type_conversion_status Field_enum::store(double nr)
 {
   return Field_enum::store((longlong) nr, FALSE);
 }
 
 
-type_convert_status Field_enum::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_enum::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   if ((ulonglong) nr > typelib->count || nr == 0)
   {
     set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
@@ -8529,13 +8527,13 @@ Field *Field_enum::new_field(MEM_ROOT *r
 */
 
 
-type_convert_status
+type_conversion_status
 Field_set::store(const char *from,uint length,const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   bool got_warning= 0;
   int err= 0;
-  type_convert_status ret= TYPE_OK;
+  type_conversion_status ret= TYPE_OK;
   char *not_used;
   uint not_used2;
   uint32 not_used_offset;
@@ -8572,10 +8570,10 @@ Field_set::store(const char *from,uint l
 }
 
 
-type_convert_status Field_set::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_set::store(longlong nr, bool unsigned_val)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
-  type_convert_status error= TYPE_OK;
+  type_conversion_status error= TYPE_OK;
   ulonglong max_nr;
 
   if (sizeof(ulonglong)*8 <= typelib->count)
@@ -8943,7 +8941,7 @@ uint Field_bit::is_equal(Create_field *n
 }
 
                        
-type_convert_status
+type_conversion_status
 Field_bit::store(const char *from, uint length, const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
@@ -8994,13 +8992,13 @@ Field_bit::store(const char *from, uint 
 }
 
 
-type_convert_status Field_bit::store(double nr)
+type_conversion_status Field_bit::store(double nr)
 {
   return Field_bit::store((longlong) nr, FALSE);
 }
 
 
-type_convert_status Field_bit::store(longlong nr, bool unsigned_val)
+type_conversion_status Field_bit::store(longlong nr, bool unsigned_val)
 {
   char buf[8];
 
@@ -9009,11 +9007,11 @@ type_convert_status Field_bit::store(lon
 }
 
 
-type_convert_status Field_bit::store_decimal(const my_decimal *val)
+type_conversion_status Field_bit::store_decimal(const my_decimal *val)
 {
   bool has_overflow= false;
   longlong i= convert_decimal2longlong(val, 1, &has_overflow);
-  type_convert_status res= store(i, TRUE);
+  type_conversion_status res= store(i, TRUE);
   return has_overflow ? TYPE_WARN_OUT_OF_RANGE : res;
 }
 
@@ -9386,8 +9384,8 @@ Field_bit_as_char::Field_bit_as_char(uch
 }
 
 
-type_convert_status Field_bit_as_char::store(const char *from, uint length,
-                                     const CHARSET_INFO *cs)
+type_conversion_status Field_bit_as_char::store(const char *from, uint length,
+                                                const CHARSET_INFO *cs)
 {
   ASSERT_COLUMN_MARKED_FOR_WRITE;
   int delta;

=== modified file 'sql/field.h'
--- a/sql/field.h	2012-03-30 13:55:22 +0000
+++ b/sql/field.h	2012-04-11 12:47:00 +0000
@@ -99,42 +99,43 @@ enum Derivation
   DERIVATION_EXPLICIT= 0
 };
 
-/*
+/**
   Status when storing a value in a field or converting from one
   datatype to another. The values should be listed in order of
-  increasing seriousness so that if two type_convert_status variables are
-  compared, the bigger one is most serious.
+  increasing seriousness so that if two type_conversion_status
+  variables are compared, the bigger one is most serious.
 */
-enum type_convert_status
+enum type_conversion_status
 {
-  /* Store/conversion went fine. */
+  /// Storage/conversion went fine.
   TYPE_OK= 0,
-  /*
+  /**
     A minor problem when converting between temporal values, e.g.
     if datetime is converted to date the time information is lost.
   */
   TYPE_NOTE_TIME_TRUNCATED,
-  /*
+  /**
     Value outside min/max limit of datatype. The min/max value is
     stored by Field::store() instead (if applicable)
   */
   TYPE_WARN_OUT_OF_RANGE,
-  /*
+  /**
     Value was stored, but something was cut. Example: trying to store
-    a number with 5 decimals into a field that can only store 3
-    decimals. The number rounded to 3 decimals should be stored.
+    a number with 5 decimal places into a field that can only store 3
+    decimals. The number rounded to 3 decimal places should be stored.
     Another example: storing the string "2010-01-01foo" into a DATE.
     The garbage in the end of the string is cut in this case.
   */
   TYPE_NOTE_TRUNCATED,
-  /* Trying to store NULL in a NOT NULL field. */
-  TYPE_ERR_NULL_VIOLATION,
-  /*
+  /// Trying to store NULL in a NOT NULL field.
+  TYPE_ERR_NULL_CONSTRAINT_VIOLATION,
+  /**
     Store/convert incompatible values, like converting "foo" to a
     date.
-   */
+  */
   TYPE_ERR_BAD_VALUE,
-  TYPE_ERR_OOM                                  //< Out of memory
+  /// Out of memory
+  TYPE_ERR_OOM
 };
 
 
@@ -146,7 +147,7 @@ enum type_convert_status
 #define MY_REPERTOIRE_NUMERIC   MY_REPERTOIRE_ASCII
 
 struct st_cache_field;
-type_convert_status field_conv(Field *to,Field *from);
+type_conversion_status field_conv(Field *to,Field *from);
 
 inline uint get_enum_pack_length(int elements)
 {
@@ -159,7 +160,8 @@ inline uint get_set_pack_length(int elem
   return len > 4 ? 8 : len;
 }
 
-inline type_convert_status decimal_error_to_type_convert_status(int dec_error)
+inline type_conversion_status
+decimal_err_to_type_conv_status(int dec_error)
 {
   if (dec_error & E_DEC_OOM)
     return TYPE_ERR_OOM;
@@ -183,9 +185,10 @@ inline type_convert_status decimal_error
 
 /**
   Convert warnings returned from str_to_time() and str_to_datetime()
-  to their corresponding type_convert_status codes.
+  to their corresponding type_conversion_status codes.
 */
-inline type_convert_status time_warning_to_type_convert_status(const int warn)
+inline type_conversion_status
+time_warning_to_type_conversion_status(const int warn)
 {
   if (warn & MYSQL_TIME_NOTE_TRUNCATED)
     return TYPE_NOTE_TIME_TRUNCATED;
@@ -200,7 +203,7 @@ inline type_convert_status time_warning_
     return TYPE_ERR_BAD_VALUE;
 
   if (warn & MYSQL_TIME_WARN_INVALID_TIMESTAMP)
-    // date was fine but pointed to winter/summer time switch gap
+    // date was fine but pointed to daylight saving time switch gap
     return TYPE_OK;
 
   DBUG_ASSERT(!warn);
@@ -483,10 +486,10 @@ public:
   virtual ~Field() {}
 
   /* Store functions returns 1 on overflow and -1 on fatal error */
-  virtual type_convert_status store(const char *to, uint length,
-                             const CHARSET_INFO *cs)=0;
-  virtual type_convert_status store(double nr)=0;
-  virtual type_convert_status store(longlong nr, bool unsigned_val)=0;
+  virtual type_conversion_status store(const char *to, uint length,
+                                       const CHARSET_INFO *cs)=0;
+  virtual type_conversion_status store(double nr)=0;
+  virtual type_conversion_status store(longlong nr, bool unsigned_val)=0;
   /**
     Store a temporal value in packed longlong format into a field.
     The packed value is compatible with TIME_to_longlong_time_packed(),
@@ -498,11 +501,11 @@ public:
     @retval false on success
     @retval true  on error
   */
-  virtual type_convert_status store_packed(longlong nr)
+  virtual type_conversion_status store_packed(longlong nr)
   {
     return store(nr, 0);
   }
-  virtual type_convert_status store_decimal(const my_decimal *d)=0;
+  virtual type_conversion_status store_decimal(const my_decimal *d)=0;
   /**
     Store MYSQL_TIME value with the given amount of decimal digits
     into a field.
@@ -518,7 +521,7 @@ public:
     @retval false  on success
     @retval true   on error
   */
-  virtual type_convert_status store_time(MYSQL_TIME *ltime, uint8 dec);
+  virtual type_conversion_status store_time(MYSQL_TIME *ltime, uint8 dec);
   /**
     Store MYSQL_TYPE value into a field when the number of fractional
     digits is not important or is not know.
@@ -527,13 +530,13 @@ public:
     @retval false   on success
     @retval true   on error
   */
-  type_convert_status store_time(MYSQL_TIME *ltime)
+  type_conversion_status store_time(MYSQL_TIME *ltime)
   {
     return store_time(ltime, 0);
   }
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *cs,
-                            enum_check_fields check_level);
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *cs,
+                               enum_check_fields check_level);
   virtual double val_real(void)=0;
   virtual longlong val_int(void)=0;
   /**
@@ -656,7 +659,7 @@ public:
     return pack_length();
   };
 
-  virtual type_convert_status reset(void)
+  virtual type_conversion_status reset(void)
   {
     memset(ptr, 0, pack_length());
     return TYPE_OK;
@@ -1326,8 +1329,8 @@ public:
   friend class Create_field;
   uint decimals() const { return (uint) dec; }
   bool eq_def(Field *field);
-  type_convert_status store_decimal(const my_decimal *);
-  type_convert_status store_time(MYSQL_TIME *ltime, uint8 dec);
+  type_conversion_status store_decimal(const my_decimal *);
+  type_conversion_status store_time(MYSQL_TIME *ltime, uint8 dec);
   my_decimal *val_decimal(my_decimal *);
   bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
   bool get_time(MYSQL_TIME *ltime);
@@ -1339,13 +1342,13 @@ public:
                           field_metadata, length));
     return length;
   }
-  type_convert_status check_int(const CHARSET_INFO *cs,
-                                const char *str, int length,
-                        const char *int_end, int error);
-  type_convert_status get_int(const CHARSET_INFO *cs,
-                              const char *from, uint len,
-                      longlong *rnd, ulonglong unsigned_max,
-                      longlong signed_min, longlong signed_max);
+  type_conversion_status check_int(const CHARSET_INFO *cs,
+                                   const char *str, int length,
+                                   const char *int_end, int error);
+  type_conversion_status get_int(const CHARSET_INFO *cs,
+                                 const char *from, uint len,
+                                 longlong *rnd, ulonglong unsigned_max,
+                                 longlong signed_min, longlong signed_max);
 };
 
 
@@ -1364,11 +1367,11 @@ public:
   }
   uint decimals() const { return NOT_FIXED_DEC; }
   void make_field(Send_field *field);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val)=0;
-  type_convert_status store_decimal(const my_decimal *);
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *cs)=0;
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val)=0;
+  type_conversion_status store_decimal(const my_decimal *);
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *cs)=0;
   uint repertoire(void) const
   {
     return my_charset_repertoire(field_charset);
@@ -1408,7 +1411,7 @@ public:
                field_name_arg, charset_arg)
     {}
 
-  type_convert_status store_decimal(const my_decimal *d);
+  type_conversion_status store_decimal(const my_decimal *d);
   uint32 max_data_length() const;
 };
 
@@ -1425,8 +1428,8 @@ public:
                field_name_arg, dec_arg, zero_arg, unsigned_arg),
     not_fixed(dec_arg >= NOT_FIXED_DEC)
     {}
-  type_convert_status store_decimal(const my_decimal *);
-  type_convert_status store_time(MYSQL_TIME *ltime, uint8 dec);
+  type_conversion_status store_decimal(const my_decimal *);
+  type_conversion_status store_time(MYSQL_TIME *ltime, uint8 dec);
   my_decimal *val_decimal(my_decimal *);
   bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
   bool get_time(MYSQL_TIME *ltime);
@@ -1452,11 +1455,11 @@ public:
   enum_field_types type() const { return MYSQL_TYPE_DECIMAL;}
   enum ha_base_keytype key_type() const
   { return zerofill ? HA_KEYTYPE_BINARY : HA_KEYTYPE_NUM; }
-  type_convert_status reset(void);
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
+  type_conversion_status reset(void);
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
   double val_real(void);
   longlong val_int(void);
   String *val_str(String*,String *);
@@ -1511,15 +1514,15 @@ public:
   enum_field_types type() const { return MYSQL_TYPE_NEWDECIMAL;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
   Item_result result_type () const { return DECIMAL_RESULT; }
-  type_convert_status reset(void);
-  type_convert_status store_value(const my_decimal *decimal_value);
+  type_conversion_status reset(void);
+  type_conversion_status store_value(const my_decimal *decimal_value);
   void set_value_on_overflow(my_decimal *decimal_value, bool sign);
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status store_time(MYSQL_TIME *ltime, uint8 dec);
-  type_convert_status store_decimal(const my_decimal *);
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status store_time(MYSQL_TIME *ltime, uint8 dec);
+  type_conversion_status store_decimal(const my_decimal *);
   double val_real(void);
   longlong val_int(void);
   my_decimal *val_decimal(my_decimal *);
@@ -1565,11 +1568,11 @@ public:
   enum_field_types type() const { return MYSQL_TYPE_TINY;}
   enum ha_base_keytype key_type() const
     { return unsigned_flag ? HA_KEYTYPE_BINARY : HA_KEYTYPE_INT8; }
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status reset(void) { ptr[0]=0; return TYPE_OK; }
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status reset(void) { ptr[0]=0; return TYPE_OK; }
   double val_real(void);
   longlong val_int(void);
   String *val_str(String*,String *);
@@ -1622,11 +1625,11 @@ public:
   enum_field_types type() const { return MYSQL_TYPE_SHORT;}
   enum ha_base_keytype key_type() const
     { return unsigned_flag ? HA_KEYTYPE_USHORT_INT : HA_KEYTYPE_SHORT_INT;}
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status reset(void) { ptr[0]=ptr[1]=0; return TYPE_OK; }
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status reset(void) { ptr[0]=ptr[1]=0; return TYPE_OK; }
   double val_real(void);
   longlong val_int(void);
   String *val_str(String*,String *);
@@ -1671,11 +1674,15 @@ public:
   enum_field_types type() const { return MYSQL_TYPE_INT24;}
   enum ha_base_keytype key_type() const
     { return unsigned_flag ? HA_KEYTYPE_UINT24 : HA_KEYTYPE_INT24; }
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return TYPE_OK; }
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status reset(void)
+  {
+    ptr[0]=ptr[1]=ptr[2]=0;
+    return TYPE_OK;
+  }
   double val_real(void);
   longlong val_int(void);
   String *val_str(String*,String *);
@@ -1726,11 +1733,11 @@ public:
   enum_field_types type() const { return MYSQL_TYPE_LONG;}
   enum ha_base_keytype key_type() const
     { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status reset(void)
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status reset(void)
   {
     ptr[0]=ptr[1]=ptr[2]=ptr[3]=0;
     return TYPE_OK;
@@ -1788,11 +1795,11 @@ public:
   enum_field_types type() const { return MYSQL_TYPE_LONGLONG;}
   enum ha_base_keytype key_type() const
     { return unsigned_flag ? HA_KEYTYPE_ULONGLONG : HA_KEYTYPE_LONGLONG; }
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status reset(void)
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status reset(void)
   {
     ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
     return TYPE_OK;
@@ -1848,11 +1855,11 @@ public:
     {}
   enum_field_types type() const { return MYSQL_TYPE_FLOAT;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_FLOAT; }
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status reset(void)
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status reset(void)
   {
     memset(ptr, 0, sizeof(float));
     return TYPE_OK;
@@ -1901,11 +1908,11 @@ public:
     {not_fixed= not_fixed_arg; }
   enum_field_types type() const { return MYSQL_TYPE_DOUBLE;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status reset(void)
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status reset(void)
   {
     memset(ptr, 0, sizeof(double));
     return TYPE_OK;
@@ -1944,24 +1951,24 @@ public:
 	       unireg_check_arg, field_name_arg, cs)
     {}
   enum_field_types type() const { return MYSQL_TYPE_NULL;}
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *cs)
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *cs)
   {
-    null[0]=1;
+    null[0]= 1;
     return TYPE_OK;
   }
-  type_convert_status store(double nr)   { null[0]=1; return TYPE_OK; }
-  type_convert_status store(longlong nr, bool unsigned_val)
+  type_conversion_status store(double nr)   { null[0]=1; return TYPE_OK; }
+  type_conversion_status store(longlong nr, bool unsigned_val)
   {
     null[0]=1;
     return TYPE_OK;
   }
-  type_convert_status store_decimal(const my_decimal *d)
+  type_conversion_status store_decimal(const my_decimal *d)
   {
     null[0]=1;
     return TYPE_OK;
   }
-  type_convert_status reset(void)       { return TYPE_OK; }
+  type_conversion_status reset(void)       { return TYPE_OK; }
   double val_real(void)		{ return 0.0;}
   longlong val_int(void)	{ return 0;}
   my_decimal *val_decimal(my_decimal *) { return 0; }
@@ -2007,8 +2014,8 @@ protected:
     @retval     false   In case of success.
     @retval     true    In case of error.
   */
-  virtual type_convert_status store_internal(const MYSQL_TIME *ltime,
-                                             int *error)= 0;
+  virtual type_conversion_status store_internal(const MYSQL_TIME *ltime,
+                                                int *error)= 0;
 
   /**
     Low level routine to store a MYSQL_TIME value into a field
@@ -2019,8 +2026,8 @@ protected:
     @retval     false   In case of success.
     @retval     true    In case of error.    
   */
-  virtual type_convert_status store_internal_with_round(MYSQL_TIME *ltime,
-                                                int *warnings)= 0;
+  virtual type_conversion_status store_internal_with_round(MYSQL_TIME *ltime,
+                                                           int *warnings)= 0;
 
   /**
     Store a temporal value in lldiv_t into a field,
@@ -2031,7 +2038,7 @@ protected:
     @retval     false   In case of success.
     @retval     true    In case of error.    
   */
-  type_convert_status store_lldiv_t(const lldiv_t *lld, int *warning);
+  type_conversion_status store_lldiv_t(const lldiv_t *lld, int *warning);
 
   /**
     Convert a string to MYSQL_TIME, according to the field type.
@@ -2061,11 +2068,11 @@ protected:
     @retval     false         On success
     @retval     true          On error
   */
-  virtual type_convert_status convert_number_to_TIME(longlong nr,
-                                                     bool unsigned_val,
-                                                     int nanoseconds,
-                                                     MYSQL_TIME *ltime,
-                                                     int *warning)= 0;
+  virtual type_conversion_status convert_number_to_TIME(longlong nr,
+                                                        bool unsigned_val,
+                                                        int nanoseconds,
+                                                        MYSQL_TIME *ltime,
+                                                        int *warning)= 0;
 
   /**
     Convert an integer number into MYSQL_TIME, according to the field type.
@@ -2177,10 +2184,11 @@ public:
   const CHARSET_INFO *charset() const { return &my_charset_numeric; }
   bool can_be_compared_as_longlong() const { return true; }
   bool binary() const { return true; }
-  type_convert_status store(const char *str, uint len, const CHARSET_INFO *cs);
-  type_convert_status store_decimal(const my_decimal *decimal);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status store(double nr);
+  type_conversion_status store(const char *str, uint len,
+                               const CHARSET_INFO *cs);
+  type_conversion_status store_decimal(const my_decimal *decimal);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status store(double nr);
   double val_real() // FSP-enable types redefine it.
   {
     return (double) val_int();
@@ -2209,13 +2217,14 @@ protected:
   */
   bool get_internal_check_zero(MYSQL_TIME *ltime, uint fuzzydate);
   
-  type_convert_status convert_number_to_TIME(longlong nr, bool unsigned_val,
-                                     int nanoseconds,
-                                     MYSQL_TIME *ltime, int *warning);
+  type_conversion_status convert_number_to_TIME(longlong nr, bool unsigned_val,
+                                                int nanoseconds,
+                                                MYSQL_TIME *ltime,
+                                                int *warning);
   bool convert_str_to_TIME(const char *str, uint len, const CHARSET_INFO *cs,
                            MYSQL_TIME *ltime, MYSQL_TIME_STATUS *status);
-  type_convert_status store_internal_with_round(MYSQL_TIME *ltime,
-                                                int *warnings);
+  type_conversion_status store_internal_with_round(MYSQL_TIME *ltime,
+                                                   int *warnings);
 public:
   /**
     Constructor for Field_temporal
@@ -2249,7 +2258,7 @@ public:
                     NONE, field_name_arg, int_length_arg, dec_arg)
     { }
   bool send_binary(Protocol *protocol);
-  type_convert_status store_time(MYSQL_TIME *ltime, uint8 dec);
+  type_conversion_status store_time(MYSQL_TIME *ltime, uint8 dec);
   String *val_str(String *, String *);
   longlong val_time_temporal();
   longlong val_date_temporal();
@@ -2386,7 +2395,7 @@ public:
 class Field_timestamp :public Field_temporal_with_date_and_time {
 protected:
   ulonglong date_flags(const THD *thd);
-  type_convert_status store_internal(const MYSQL_TIME *ltime, int *error);
+  type_conversion_status store_internal(const MYSQL_TIME *ltime, int *error);
   bool get_date_internal(MYSQL_TIME *ltime);
   void store_timestamp_internal(const struct timeval *tm);
 public:
@@ -2397,8 +2406,8 @@ public:
   Field_timestamp(bool maybe_null_arg, const char *field_name_arg);
   enum_field_types type() const { return MYSQL_TYPE_TIMESTAMP;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
-  type_convert_status store_packed(longlong nr);
-  type_convert_status reset(void)
+  type_conversion_status store_packed(longlong nr);
+  type_conversion_status reset(void)
   {
     ptr[0]=ptr[1]=ptr[2]=ptr[3]=0;
     return TYPE_OK;
@@ -2441,7 +2450,7 @@ public:
 class Field_timestampf :public Field_temporal_with_date_and_timef {
 protected:
   bool get_date_internal(MYSQL_TIME *ltime);
-  type_convert_status store_internal(const MYSQL_TIME *ltime, int *error);
+  type_conversion_status store_internal(const MYSQL_TIME *ltime, int *error);
   ulonglong date_flags(const THD *thd);
   void store_timestamp_internal(const struct timeval *tm);
 public:
@@ -2494,8 +2503,8 @@ public:
     DBUG_RETURN(tmp);
   }
 
-  type_convert_status reset();
-  type_convert_status store_packed(longlong nr);
+  type_conversion_status reset();
+  type_conversion_status store_packed(longlong nr);
   bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
   void sql_type(String &str) const;
 
@@ -2512,11 +2521,11 @@ public:
 		unireg_check_arg, field_name_arg, 1, 1)
     {}
   enum_field_types type() const { return MYSQL_TYPE_YEAR;}
-  type_convert_status store(const char *to,uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status store_time(MYSQL_TIME *ltime, uint8 dec);
+  type_conversion_status store(const char *to,uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status store_time(MYSQL_TIME *ltime, uint8 dec);
   double val_real(void);
   longlong val_int(void);
   String *val_str(String*,String *);
@@ -2538,7 +2547,7 @@ class Field_newdate :public Field_tempor
 protected:
   ulonglong date_flags(const THD *thd);
   bool get_date_internal(MYSQL_TIME *ltime);
-  type_convert_status store_internal(const MYSQL_TIME *ltime, int *error);
+  type_conversion_status store_internal(const MYSQL_TIME *ltime, int *error);
 
 public:
   Field_newdate(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
@@ -2554,8 +2563,12 @@ public:
   enum_field_types type() const { return MYSQL_TYPE_DATE;}
   enum_field_types real_type() const { return MYSQL_TYPE_NEWDATE; }
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_UINT24; }
-  type_convert_status reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return TYPE_OK; }
-  type_convert_status store_packed(longlong nr);
+  type_conversion_status reset(void)
+  {
+    ptr[0]=ptr[1]=ptr[2]=0;
+    return TYPE_OK;
+  }
+  type_conversion_status store_packed(longlong nr);
   longlong val_int(void);
   longlong val_time_temporal();
   longlong val_date_temporal();
@@ -2589,21 +2602,22 @@ class Field_time_common :public Field_te
 protected:
   bool convert_str_to_TIME(const char *str, uint len, const CHARSET_INFO *cs,
                            MYSQL_TIME *ltime, MYSQL_TIME_STATUS *status);
-  type_convert_status convert_number_to_TIME(longlong nr, bool unsigned_val,
-                                     int nanoseconds,
-                                     MYSQL_TIME *ltime, int *warning);
+  type_conversion_status convert_number_to_TIME(longlong nr, bool unsigned_val,
+                                                int nanoseconds,
+                                                MYSQL_TIME *ltime,
+                                                int *warning);
   /**
     Low-level function to store MYSQL_TIME value.
     The value must be rounded or truncated according to decimals().
   */
-  virtual type_convert_status store_internal(const MYSQL_TIME *ltime,
-                                             int *error)= 0;
+  virtual type_conversion_status store_internal(const MYSQL_TIME *ltime,
+                                                int *error)= 0;
   /**
     Function to store time value.
     The value is rounded according to decimals().
   */
-  virtual type_convert_status store_internal_with_round(MYSQL_TIME *ltime,
-                                                int *warnings);
+  virtual type_conversion_status store_internal_with_round(MYSQL_TIME *ltime,
+                                                           int *warnings);
 public:
   /**
     Constructor for Field_time_common
@@ -2632,7 +2646,7 @@ public:
     :Field_temporal((uchar *) 0, maybe_null_arg ? (uchar *) "" : 0, 0,
                     NONE, field_name_arg, MAX_TIME_WIDTH, dec_arg)
     { }
-  type_convert_status store_time(MYSQL_TIME *ltime, uint8 dec);
+  type_conversion_status store_time(MYSQL_TIME *ltime, uint8 dec);
   String *val_str(String*, String *);
   bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
   longlong val_date_temporal();
@@ -2646,7 +2660,7 @@ public:
 */
 class Field_time :public Field_time_common {
 protected:
-  type_convert_status store_internal(const MYSQL_TIME *ltime, int *error);
+  type_conversion_status store_internal(const MYSQL_TIME *ltime, int *error);
 public:
   Field_time(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
 	     enum utype unireg_check_arg, const char *field_name_arg)
@@ -2659,8 +2673,12 @@ public:
     { }
   enum_field_types type() const { return MYSQL_TYPE_TIME;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; }
-  type_convert_status store_packed(longlong nr);
-  type_convert_status reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return TYPE_OK; }
+  type_conversion_status store_packed(longlong nr);
+  type_conversion_status reset(void)
+  {
+    ptr[0]=ptr[1]=ptr[2]=0;
+    return TYPE_OK;
+  }
   longlong val_int(void);
   longlong val_time_temporal();
   bool get_time(MYSQL_TIME *ltime);
@@ -2691,7 +2709,7 @@ private:
     return 1;
   }
 protected:
-  type_convert_status store_internal(const MYSQL_TIME *ltime, int *error);
+  type_conversion_status store_internal(const MYSQL_TIME *ltime, int *error);
 public:
   /**
     Constructor for Field_timef
@@ -2732,8 +2750,8 @@ public:
   enum_field_types type() const { return MYSQL_TYPE_TIME;}
   enum_field_types real_type() const { return MYSQL_TYPE_TIME2; }
   enum_field_types binlog_type() const { return MYSQL_TYPE_TIME2; }
-  type_convert_status store_packed(longlong nr);
-  type_convert_status reset();
+  type_conversion_status store_packed(longlong nr);
+  type_conversion_status reset();
   double val_real();
   longlong val_int();
   longlong val_time_temporal();
@@ -2771,7 +2789,7 @@ public:
 */
 class Field_datetime :public Field_temporal_with_date_and_time {
 protected:
-  type_convert_status store_internal(const MYSQL_TIME *ltime, int *error);
+  type_conversion_status store_internal(const MYSQL_TIME *ltime, int *error);
   bool get_date_internal(MYSQL_TIME *ltime);
   ulonglong date_flags(const THD *thd);
   void store_timestamp_internal(const struct timeval *tm);
@@ -2819,9 +2837,9 @@ public:
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; }
 #endif
   using Field_temporal_with_date_and_time::store; // Make -Woverloaded-virtual
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status store_packed(longlong nr);
-  type_convert_status reset(void)
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status store_packed(longlong nr);
+  type_conversion_status reset(void)
   {
     ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
     return TYPE_OK;
@@ -2864,7 +2882,7 @@ public:
 class Field_datetimef :public Field_temporal_with_date_and_timef {
 protected:
   bool get_date_internal(MYSQL_TIME *ltime);
-  type_convert_status store_internal(const MYSQL_TIME *ltime, int *error);
+  type_conversion_status store_internal(const MYSQL_TIME *ltime, int *error);
   ulonglong date_flags(const THD *thd);
   void store_timestamp_internal(const struct timeval *tm);
 
@@ -2924,8 +2942,8 @@ public:
   }
   bool zero_pack() const { return 1; }
 
-  type_convert_status store_packed(longlong nr);
-  type_convert_status reset();
+  type_conversion_status store_packed(longlong nr);
+  type_conversion_status reset();
   longlong val_date_temporal();
   bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
   void sql_type(String &str) const;
@@ -2960,17 +2978,17 @@ public:
   enum ha_base_keytype key_type() const
     { return binary() ? HA_KEYTYPE_BINARY : HA_KEYTYPE_TEXT; }
   bool zero_pack() const { return 0; }
-  type_convert_status reset(void)
+  type_conversion_status reset(void)
   {
     charset()->cset->fill(charset(),(char*) ptr, field_length,
                           (has_charset() ? ' ' : 0));
     return TYPE_OK;
   }
-  type_convert_status store(const char *to,uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(longlong nr, bool unsigned_val);
+  type_conversion_status store(const char *to,uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(longlong nr, bool unsigned_val);
   /* QQ: To be deleted */
-  type_convert_status store(double nr) { return Field_str::store(nr); }
+  type_conversion_status store(double nr) { return Field_str::store(nr); }
   double val_real(void);
   longlong val_int(void);
   String *val_str(String*,String *);
@@ -3050,7 +3068,7 @@ public:
   enum ha_base_keytype key_type() const;
   uint row_pack_length() const { return field_length; }
   bool zero_pack() const { return 0; }
-  type_convert_status reset(void)
+  type_conversion_status reset(void)
   {
     memset(ptr, 0, field_length+length_bytes);
     return TYPE_OK;
@@ -3062,11 +3080,11 @@ public:
     return (uint32) field_length + (field_charset == &my_charset_bin ?
                                     length_bytes : 0);
   }
-  type_convert_status store(const char *to,uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(longlong nr, bool unsigned_val);
+  type_conversion_status store(const char *to,uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(longlong nr, bool unsigned_val);
   /* QQ: To be deleted */
-  type_convert_status store(double nr) { return Field_str::store(nr); }
+  type_conversion_status store(double nr) { return Field_str::store(nr); }
   double val_real(void);
   longlong val_int(void);
   String *val_str(String*,String *);
@@ -3161,10 +3179,10 @@ public:
   bool match_collation_to_optimize_range() const { return true; }
   enum ha_base_keytype key_type() const
     { return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; }
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
   double val_real(void);
   longlong val_int(void);
   String *val_str(String*,String *);
@@ -3197,7 +3215,7 @@ public:
   {
     return (uint32) (((ulonglong) 1 << (packlength*8)) -1);
   }
-  type_convert_status reset(void)
+  type_conversion_status reset(void)
   {
     memset(ptr, 0, packlength+sizeof(uchar*));
     return TYPE_OK;
@@ -3289,7 +3307,7 @@ public:
   uint max_packed_col_length(uint max_length);
   void free() { value.free(); }
   inline void clear_temporary() { memset(&value, 0, sizeof(value)); }
-  friend type_convert_status field_conv(Field *to,Field *from);
+  friend type_conversion_status field_conv(Field *to,Field *from);
   bool has_charset(void) const
   { return charset() == &my_charset_bin ? FALSE : TRUE; }
   uint32 max_display_length();
@@ -3322,22 +3340,22 @@ public:
   enum_field_types type() const { return MYSQL_TYPE_GEOMETRY; }
   bool match_collation_to_optimize_range() const { return false; }
   void sql_type(String &str) const;
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status store_decimal(const my_decimal *);
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status store_decimal(const my_decimal *);
 
   /**
     Non-nullable GEOMETRY types cannot have defaults,
     but the underlying blob must still be reset.
    */
-  type_convert_status reset(void)
+  type_conversion_status reset(void)
   {
-    type_convert_status res= Field_blob::reset();
+    type_conversion_status res= Field_blob::reset();
     if (res != TYPE_OK)
       return res;
-    return maybe_null() ? TYPE_OK : TYPE_ERR_NULL_VIOLATION;
+    return maybe_null() ? TYPE_OK : TYPE_ERR_NULL_CONSTRAINT_VIOLATION;
   }
 
   geometry_type get_geometry_type() { return geom_type; };
@@ -3376,10 +3394,10 @@ public:
   enum Item_result cmp_type () const { return INT_RESULT; }
   enum Item_result cast_to_int_type () const { return INT_RESULT; }
   enum ha_base_keytype key_type() const;
-  type_convert_status store(const char *to,uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
+  type_conversion_status store(const char *to,uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
   double val_real(void);
   my_decimal *val_decimal(my_decimal *decimal_value);
   longlong val_int(void);
@@ -3432,13 +3450,13 @@ public:
     {
       flags= (flags & ~ENUM_FLAG) | SET_FLAG;
     }
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr)
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr)
   {
     return Field_set::store((longlong) nr, FALSE);
   }
-  type_convert_status store(longlong nr, bool unsigned_val);
+  type_conversion_status store(longlong nr, bool unsigned_val);
   virtual bool zero_pack() const { return 1; }
   String *val_str(String*,String *);
   void sql_type(String &str) const;
@@ -3484,18 +3502,18 @@ public:
   uint32 max_data_length() const { return (field_length + 7) / 8; }
   uint32 max_display_length() { return field_length; }
   Item_result result_type () const { return INT_RESULT; }
-  type_convert_status reset(void)
+  type_conversion_status reset(void)
   {
     memset(ptr, 0, bytes_in_rec);
     if (bit_ptr && (bit_len > 0))  // reset odd bits among null bits
       clr_rec_bits(bit_ptr, bit_ofs, bit_len);
     return TYPE_OK;
   }
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr);
-  type_convert_status store(longlong nr, bool unsigned_val);
-  type_convert_status store_decimal(const my_decimal *);
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr);
+  type_conversion_status store(longlong nr, bool unsigned_val);
+  type_conversion_status store_decimal(const my_decimal *);
   double val_real(void);
   longlong val_int(void);
   String *val_str(String*, String *);
@@ -3587,10 +3605,10 @@ public:
                     uchar null_bit_arg,
                     enum utype unireg_check_arg, const char *field_name_arg);
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
-  type_convert_status store(const char *to, uint length,
-                            const CHARSET_INFO *charset);
-  type_convert_status store(double nr) { return Field_bit::store(nr); }
-  type_convert_status store(longlong nr, bool unsigned_val)
+  type_conversion_status store(const char *to, uint length,
+                               const CHARSET_INFO *charset);
+  type_conversion_status store(double nr) { return Field_bit::store(nr); }
+  type_conversion_status store(longlong nr, bool unsigned_val)
   { return Field_bit::store(nr, unsigned_val); }
   void sql_type(String &str) const;
   Field_bit_as_char *clone(MEM_ROOT *mem_root) const { 
@@ -3742,9 +3760,9 @@ Field *make_field(TABLE_SHARE *share, uc
 uint pack_length_to_packflag(uint type);
 enum_field_types get_blob_type_from_length(ulong length);
 uint32 calc_pack_length(enum_field_types type,uint32 length);
-type_convert_status set_field_to_null(Field *field);
-type_convert_status set_field_to_null_with_conversions(Field *field,
-                                                       bool no_conversions);
+type_conversion_status set_field_to_null(Field *field);
+type_conversion_status set_field_to_null_with_conversions(Field *field,
+                                                          bool no_conversions);
 
 /*
   The following are for the interface with the .frm file

=== modified file 'sql/field_conv.cc'
--- a/sql/field_conv.cc	2012-03-30 13:55:22 +0000
+++ b/sql/field_conv.cc	2012-04-11 12:47:00 +0000
@@ -98,7 +98,7 @@ static void do_field_to_null_str(Copy_fi
 }
 
 
-type_convert_status
+type_conversion_status
 set_field_to_null(Field *field)
 {
   if (field->real_maybe_null())
@@ -117,10 +117,10 @@ set_field_to_null(Field *field)
   case CHECK_FIELD_ERROR_FOR_NULL:
     if (!field->table->in_use->no_errors)
       my_error(ER_BAD_NULL_ERROR, MYF(0), field->field_name);
-    return TYPE_ERR_NULL_VIOLATION;
+    return TYPE_ERR_NULL_CONSTRAINT_VIOLATION;
   }
   DBUG_ASSERT(false); // impossible
-  return TYPE_ERR_NULL_VIOLATION;
+  return TYPE_ERR_NULL_CONSTRAINT_VIOLATION;
 }
 
 
@@ -141,7 +141,7 @@ set_field_to_null(Field *field)
     If no_conversion was not set, an error message is printed
 */
 
-type_convert_status
+type_conversion_status
 set_field_to_null_with_conversions(Field *field, bool no_conversions)
 {
   if (field->real_maybe_null())
@@ -151,7 +151,7 @@ set_field_to_null_with_conversions(Field
     return TYPE_OK;
   }
   if (no_conversions)
-    return TYPE_ERR_NULL_VIOLATION;
+    return TYPE_ERR_NULL_CONSTRAINT_VIOLATION;
 
   /*
     Check if this is a special type, which will get a special walue
@@ -185,10 +185,10 @@ set_field_to_null_with_conversions(Field
   case CHECK_FIELD_ERROR_FOR_NULL:
     if (!field->table->in_use->no_errors)
       my_error(ER_BAD_NULL_ERROR, MYF(0), field->field_name);
-    return TYPE_ERR_NULL_VIOLATION;
+    return TYPE_ERR_NULL_CONSTRAINT_VIOLATION;
   }
   DBUG_ASSERT(false); // impossible
-  return TYPE_ERR_NULL_VIOLATION;
+  return TYPE_ERR_NULL_CONSTRAINT_VIOLATION;
 }
 
 
@@ -343,7 +343,7 @@ static void do_field_decimal(Copy_field 
 }
 
 
-inline type_convert_status copy_time_to_time(Field *from, Field *to)
+inline type_conversion_status copy_time_to_time(Field *from, Field *to)
 {
   MYSQL_TIME ltime;
   from->get_time(&ltime);
@@ -779,7 +779,7 @@ Copy_field::get_copy_func(Field *to,Fiel
 
 /** Simple quick field convert that is called on insert. */
 
-type_convert_status field_conv(Field *to,Field *from)
+type_conversion_status field_conv(Field *to,Field *from)
 {
   if (to->real_type() == from->real_type() &&
       !(to->type() == MYSQL_TYPE_BLOB && to->table->copy_blobs) &&

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2012-03-30 13:55:22 +0000
+++ b/sql/item.cc	2012-04-11 12:47:00 +0000
@@ -495,7 +495,7 @@ longlong Item::val_int_from_datetime()
 }
 
 
-type_convert_status Item::save_time_in_field(Field *field)
+type_conversion_status Item::save_time_in_field(Field *field)
 {
   MYSQL_TIME ltime;
   if (get_time(&ltime))
@@ -505,7 +505,7 @@ type_convert_status Item::save_time_in_f
 }
 
 
-type_convert_status Item::save_date_in_field(Field *field)
+type_conversion_status Item::save_date_in_field(Field *field)
 {
   MYSQL_TIME ltime;
   if (get_date(&ltime, TIME_FUZZY_DATE))
@@ -536,7 +536,7 @@ type_convert_status Item::save_date_in_f
     Nonzero value if error
 */
 
-type_convert_status
+type_conversion_status
 Item::save_str_value_in_field(Field *field, String *result)
 {
   if (null_value)
@@ -1462,7 +1462,7 @@ const CHARSET_INFO *Item::default_charse
    for example in opt_range to adjust the key value to fit the column.
 */
 
-type_convert_status
+type_conversion_status
 Item::save_in_field_no_warnings(Field *field, bool no_conversions)
 {
   DBUG_ENTER("Item::save_in_field_no_warnings");
@@ -1474,7 +1474,7 @@ Item::save_in_field_no_warnings(Field *f
   thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE);
   thd->count_cuted_fields= CHECK_FIELD_IGNORE;
 
-  const type_convert_status res= save_in_field(field, no_conversions);
+  const type_conversion_status res= save_in_field(field, no_conversions);
 
   thd->count_cuted_fields= tmp;
   dbug_tmp_restore_column_map(table->write_set, old_map);
@@ -3687,7 +3687,7 @@ void Item_param::reset()
 }
 
 
-type_convert_status
+type_conversion_status
 Item_param::save_in_field(Field *field, bool no_conversions)
 {
   field->set_notnull();
@@ -4298,7 +4298,7 @@ longlong Item_copy_string::val_int()
 }
 
 
-type_convert_status
+type_conversion_status
 Item_copy_string::save_in_field(Field *field, bool no_conversions)
 {
   return save_str_value_in_field(field, &str_value);
@@ -4353,12 +4353,12 @@ void Item_copy_int::copy()
   null_value=item->null_value;
 }
 
-static type_convert_status
+static type_conversion_status
 save_int_value_in_field (Field *field, longlong nr,
                          bool null_value, bool unsigned_flag,
                          bool no_conversions);
 
-type_convert_status
+type_conversion_status
 Item_copy_int::save_in_field(Field *field, bool no_conversions)
 {
   return save_int_value_in_field(field, cached_value,
@@ -4430,7 +4430,7 @@ my_decimal *Item_copy_float::val_decimal
 }
 
 
-type_convert_status
+type_conversion_status
 Item_copy_float::save_in_field(Field *field, bool no_conversions)
 {
   if (null_value)
@@ -4445,7 +4445,7 @@ Item_copy_float::save_in_field(Field *fi
   Item_copy_decimal
 ****************************************************************************/
 
-type_convert_status
+type_conversion_status
 Item_copy_decimal::save_in_field(Field *field, bool no_conversions)
 {
   if (null_value)
@@ -6048,10 +6048,10 @@ void Item_field::save_org_in_field(Field
   }
 }
 
-type_convert_status
+type_conversion_status
 Item_field::save_in_field(Field *to, bool no_conversions)
 {
-  type_convert_status res;
+  type_conversion_status res;
   DBUG_ENTER("Item_field::save_in_field");
   if (result_field->is_null())
   {
@@ -6090,7 +6090,7 @@ Item_field::save_in_field(Field *to, boo
     1   Field doesn't support NULL values and can't handle 'field = NULL'
 */
 
-type_convert_status
+type_conversion_status
 Item_null::save_in_field(Field *field, bool no_conversions)
 {
   return set_field_to_null_with_conversions(field, no_conversions);
@@ -6108,7 +6108,7 @@ Item_null::save_in_field(Field *field, b
     1	 Field doesn't support NULL values
 */
 
-type_convert_status Item_null::save_safe_in_field(Field *field)
+type_conversion_status Item_null::save_safe_in_field(Field *field)
 {
   return set_field_to_null(field);
 }
@@ -6123,10 +6123,10 @@ type_convert_status Item_null::save_safe
   str != str_value. For example, see fix for bug #44743.
 */
 
-type_convert_status
+type_conversion_status
 Item::save_in_field(Field *field, bool no_conversions)
 {
-  type_convert_status error;
+  type_conversion_status error;
   if (result_type() == STRING_RESULT)
   {
     String *result;
@@ -6185,7 +6185,7 @@ Item::save_in_field(Field *field, bool n
 }
 
 
-type_convert_status
+type_conversion_status
 Item_string::save_in_field(Field *field, bool no_conversions)
 {
   String *result;
@@ -6194,14 +6194,34 @@ Item_string::save_in_field(Field *field,
 }
 
 
-type_convert_status
+type_conversion_status
 Item_uint::save_in_field(Field *field, bool no_conversions)
 {
   /* Item_int::save_in_field handles both signed and unsigned. */
   return Item_int::save_in_field(field, no_conversions);
 }
 
-static type_convert_status
+/**
+  Store an int in a field
+
+  @param field           The field where the int value is to be stored
+  @param nr              The value to store in field
+  @param null_value      True if the value to store is NULL, false otherwise
+  @param unsigned_flag   Whether or not the int value is signed or unsigned
+  @param no_conversions  Only applies if the value to store is NULL
+                         (null_value is true) and NULL is not allowed
+                         in field. In that case: if no_coversion is
+                         true, do nothing and return with error
+                         TYPE_ERR_NULL_CONSTRAINT_VIOLATION. If
+                         no_coversion is false, the field's default
+                         value is stored if one exists. Otherwise an
+                         error is returned.
+
+  @retval TYPE_OK   Storing of value went fine without warnings or errors
+  @retval !TYPE_OK  Warning/error as indicated by type_conversion_status enum
+                    value
+*/
+static type_conversion_status
 save_int_value_in_field (Field *field, longlong nr,
                          bool null_value, bool unsigned_flag,
                          bool no_conversions)
@@ -6213,7 +6233,24 @@ save_int_value_in_field (Field *field, l
 }
 
 
-type_convert_status
+/**
+  Store this item's int-value in a field
+
+  @param field           The field where the int value is to be stored
+  @param no_conversions  Only applies if the value to store is NULL
+                         (null_value is true) and NULL is not allowed
+                         in field. In that case: if no_coversion is
+                         true, do nothing and return with error
+                         TYPE_ERR_NULL_CONSTRAINT_VIOLATION. If
+                         no_coversion is false, the field's default
+                         value is stored if one exists. Otherwise an
+                         error is returned.
+
+  @retval TYPE_OK   Storing of value went fine without warnings or errors
+  @retval !TYPE_OK  Warning/error as indicated by type_conversion_status enum
+                    value
+*/
+type_conversion_status
 Item_int::save_in_field(Field *field, bool no_conversions)
 {
   return save_int_value_in_field (field, val_int(), null_value,
@@ -6221,7 +6258,7 @@ Item_int::save_in_field(Field *field, bo
 }
 
 
-type_convert_status
+type_conversion_status
 Item_temporal::save_in_field(Field *field, bool no_conversions)
 {
   longlong nr= field->is_temporal_with_time() ?
@@ -6234,7 +6271,7 @@ Item_temporal::save_in_field(Field *fiel
 }
 
 
-type_convert_status
+type_conversion_status
 Item_decimal::save_in_field(Field *field, bool no_conversions)
 {
   field->set_notnull();
@@ -6387,7 +6424,7 @@ Item_float::Item_float(const char *str_a
 }
 
 
-type_convert_status
+type_conversion_status
 Item_float::save_in_field(Field *field, bool no_conversions)
 {
   double nr= val_real();
@@ -6498,7 +6535,7 @@ my_decimal *Item_hex_string::val_decimal
 }
 
 
-type_convert_status
+type_conversion_status
 Item_hex_string::save_in_field(Field *field, bool no_conversions)
 {
   field->set_notnull();
@@ -6527,7 +6564,7 @@ Item_hex_string::save_in_field(Field *fi
   return field->store((longlong) nr, TRUE);  // Assume hex numbers are unsigned
 
 warn:
-  const type_convert_status res= field->store((longlong) nr, TRUE);
+  const type_conversion_status res= field->store((longlong) nr, TRUE);
   if (res == TYPE_OK)
     field->set_warning(Sql_condition::WARN_LEVEL_WARN,
                        ER_WARN_DATA_OUT_OF_RANGE, 1);
@@ -7531,10 +7568,10 @@ my_decimal *Item_ref::val_decimal(my_dec
   return val;
 }
 
-type_convert_status
+type_conversion_status
 Item_ref::save_in_field(Field *to, bool no_conversions)
 {
-  type_convert_status res;
+  type_conversion_status res;
   if (result_field)
   {
     if (result_field->is_null())
@@ -7862,7 +7899,7 @@ void Item_default_value::print(String *s
 }
 
 
-type_convert_status
+type_conversion_status
 Item_default_value::save_in_field(Field *field_arg, bool no_conversions)
 {
   if (!arg)
@@ -8883,13 +8920,13 @@ my_decimal *Item_cache_str::val_decimal(
 }
 
 
-type_convert_status
+type_conversion_status
 Item_cache_str::save_in_field(Field *field, bool no_conversions)
 {
   if (!value_cached && !cache_value())
     return TYPE_ERR_BAD_VALUE;               // Fatal: couldn't cache the value
-  const type_convert_status res= Item_cache::save_in_field(field,
-                                                           no_conversions);
+  const type_conversion_status res= Item_cache::save_in_field(field,
+                                                              no_conversions);
   if (is_varbinary && field->type() == MYSQL_TYPE_STRING &&
       value->length() < field->field_length)
     return TYPE_WARN_OUT_OF_RANGE;

=== modified file 'sql/item.h'
--- a/sql/item.h	2012-03-30 13:55:22 +0000
+++ b/sql/item.h	2012-04-11 12:47:00 +0000
@@ -638,8 +638,8 @@ public:
   */
   inline void quick_fix_field() { fixed= 1; }
   /* Function returns 1 on overflow and -1 on fatal errors */
-  type_convert_status save_in_field_no_warnings(Field *field,
-                                        bool no_conversions);
+  type_conversion_status save_in_field_no_warnings(Field *field,
+                                                   bool no_conversions);
   /**
     Save a temporal value in packed longlong format into a Field.
     Used in optimizer.
@@ -647,10 +647,11 @@ public:
     @retval 0         On success.
     @retval >0        In error.
   */
-  virtual type_convert_status save_in_field(Field *field, bool no_conversions);
+  virtual type_conversion_status save_in_field(Field *field,
+                                               bool no_conversions);
   virtual void save_org_in_field(Field *field)
   { (void) save_in_field(field, 1); }
-  virtual type_convert_status save_safe_in_field(Field *field)
+  virtual type_conversion_status save_safe_in_field(Field *field)
   { return save_in_field(field, 1); }
   virtual bool send(Protocol *protocol, String *str);
   virtual bool eq(const Item *, bool binary_cmp) const;
@@ -1003,9 +1004,9 @@ protected:
 
 public:
 
-  type_convert_status save_time_in_field(Field *field);
-  type_convert_status save_date_in_field(Field *field);
-  type_convert_status save_str_value_in_field(Field *field, String *result);
+  type_conversion_status save_time_in_field(Field *field);
+  type_conversion_status save_date_in_field(Field *field);
+  type_conversion_status save_str_value_in_field(Field *field, String *result);
 
   virtual Field *get_tmp_table_field() { return 0; }
   /* This is also used to create fields in CREATE ... SELECT: */
@@ -1584,7 +1585,8 @@ public:
 
 public:
   inline void make_field(Send_field *field);  
-  inline type_convert_status save_in_field(Field *field, bool no_conversions);
+  inline type_conversion_status save_in_field(Field *field,
+                                              bool no_conversions);
   inline bool send(Protocol *protocol, String *str);
 }; 
 
@@ -1603,7 +1605,7 @@ inline void Item_sp_variable::make_field
   it->make_field(field);
 }
 
-inline type_convert_status
+inline type_conversion_status
 Item_sp_variable::save_in_field(Field *field, bool no_conversions)
 {
   return this_item()->save_in_field(field, no_conversions);
@@ -1795,7 +1797,7 @@ public:
     return value_item->result_type();
   }
 
-  type_convert_status save_in_field(Field *field, bool no_conversions)
+  type_conversion_status save_in_field(Field *field, bool no_conversions)
   {
     return  value_item->save_in_field(field, no_conversions);
   }
@@ -2003,7 +2005,7 @@ public:
   void reset_field(Field *f);
   bool fix_fields(THD *, Item **);
   void make_field(Send_field *tmp_field);
-  type_convert_status save_in_field(Field *field,bool no_conversions);
+  type_conversion_status save_in_field(Field *field,bool no_conversions);
   void save_org_in_field(Field *field);
   table_map used_tables() const;
   virtual table_map resolved_used_tables() const;
@@ -2129,8 +2131,8 @@ public:
   {
     return true;
   }
-  type_convert_status save_in_field(Field *field, bool no_conversions);
-  type_convert_status save_safe_in_field(Field *field);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_safe_in_field(Field *field);
   bool send(Protocol *protocol, String *str);
   enum Item_result result_type () const { return STRING_RESULT; }
   enum_field_types field_type() const   { return MYSQL_TYPE_NULL; }
@@ -2245,7 +2247,7 @@ public:
   String *val_str(String*);
   bool get_time(MYSQL_TIME *tm);
   bool get_date(MYSQL_TIME *tm, uint fuzzydate);
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
 
   void set_null();
   void set_int(longlong i, uint32 max_length_arg);
@@ -2354,7 +2356,7 @@ public:
   {
     return get_time_from_int(ltime);
   }
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
   bool basic_const_item() const { return 1; }
   Item *clone_item() { return new Item_int(name,value,max_length); }
   virtual void print(String *str, enum_query_type query_type);
@@ -2395,7 +2397,7 @@ public:
     fixed= 1;
   }
   Item *clone_item() { return new Item_temporal(field_type(), value); }
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
   longlong val_time_temporal() { return val_int(); }
   longlong val_date_temporal() { return val_int(); }
   bool get_date(MYSQL_TIME *ltime, uint fuzzydate)
@@ -2425,7 +2427,7 @@ public:
     { DBUG_ASSERT(fixed == 1); return ulonglong2double((ulonglong)value); }
   String *val_str(String*);
   Item *clone_item() { return new Item_uint(name, value, max_length); }
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
   virtual void print(String *str, enum_query_type query_type);
   Item_num *neg ();
   uint decimal_precision() const { return max_length; }
@@ -2462,7 +2464,7 @@ public:
   {
     return get_time_from_decimal(ltime);
   }
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
   bool basic_const_item() const { return 1; }
   Item *clone_item()
   {
@@ -2502,7 +2504,7 @@ public:
     decimals= (uint8) decimal_par;
     fixed= 1;
   }
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
   enum Type type() const { return REAL_ITEM; }
   enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; }
   double val_real() { DBUG_ASSERT(fixed == 1); return value; }
@@ -2634,7 +2636,7 @@ public:
   {
     return get_time_from_string(ltime);
   }
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
   enum Item_result result_type () const { return STRING_RESULT; }
   enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; }
   bool basic_const_item() const { return 1; }
@@ -2813,7 +2815,7 @@ public:
   {
     return get_time_from_string(ltime);
   }
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
   enum Item_result result_type () const { return STRING_RESULT; }
   enum Item_result cast_to_int_type() const { return INT_RESULT; }
   enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; }
@@ -2933,7 +2935,7 @@ public:
   bool fix_fields(THD *, Item **);
   void fix_after_pullout(st_select_lex *parent_select,
                          st_select_lex *removed_select, Item **ref);
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
   void save_org_in_field(Field *field);
   enum Item_result result_type () const { return (*ref)->result_type(); }
   enum_field_types field_type() const   { return (*ref)->field_type(); }
@@ -3235,7 +3237,7 @@ public:
   {
     unsigned_flag= unsigned_arg;
   }
-  type_convert_status save_in_field(Field *field, bool no_conversions)
+  type_conversion_status save_in_field(Field *field, bool no_conversions)
   {
     return ref->save_in_field(field, no_conversions);
   }
@@ -3453,8 +3455,8 @@ public:
   virtual longlong val_int() = 0;
   virtual bool get_date(MYSQL_TIME *ltime, uint fuzzydate)= 0;
   virtual bool get_time(MYSQL_TIME *ltime)= 0;
-  virtual type_convert_status save_in_field(Field *field,
-                                    bool no_conversions) = 0;
+  virtual type_conversion_status save_in_field(Field *field,
+                                               bool no_conversions) = 0;
 };
 
 /**
@@ -3474,7 +3476,7 @@ public:
   bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
   bool get_time(MYSQL_TIME *ltime);
   void copy();
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
 };
 
 
@@ -3484,7 +3486,7 @@ protected:  
   longlong cached_value; 
 public:
   Item_copy_int (Item *i) : Item_copy(i) {}
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
 
   virtual String *val_str(String*);
   virtual my_decimal *val_decimal(my_decimal *);
@@ -3530,7 +3532,7 @@ protected:  
   double cached_value; 
 public:
   Item_copy_float (Item *i) : Item_copy(i) {}
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
 
   String *val_str(String*);
   my_decimal *val_decimal(my_decimal *);
@@ -3564,7 +3566,7 @@ protected:  
   my_decimal cached_value;
 public:
   Item_copy_decimal (Item *i) : Item_copy(i) {}
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
 
   String *val_str(String*);
   my_decimal *val_decimal(my_decimal *) 
@@ -3680,7 +3682,7 @@ public:
   bool eq(const Item *item, bool binary_cmp) const;
   bool fix_fields(THD *, Item **);
   virtual void print(String *str, enum_query_type query_type);
-  type_convert_status save_in_field(Field *field_arg, bool no_conversions);
+  type_conversion_status save_in_field(Field *field_arg, bool no_conversions);
   table_map used_tables() const { return (table_map)0L; }
 
   bool walk(Item_processor processor, bool walk_subquery, uchar *args)
@@ -3713,7 +3715,7 @@ public:
   bool eq(const Item *item, bool binary_cmp) const;
   bool fix_fields(THD *, Item **);
   virtual void print(String *str, enum_query_type query_type);
-  type_convert_status save_in_field(Field *field_arg, bool no_conversions)
+  type_conversion_status save_in_field(Field *field_arg, bool no_conversions)
   {
     return Item_field::save_in_field(field_arg, no_conversions);
   }
@@ -4023,7 +4025,7 @@ public:
   }
   enum Item_result result_type() const { return STRING_RESULT; }
   const CHARSET_INFO *charset() const { return value->charset(); };
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
   bool cache_value();
 };
 

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2012-03-30 13:55:22 +0000
+++ b/sql/item_func.cc	2012-04-11 12:47:00 +0000
@@ -5242,13 +5242,13 @@ void Item_func_set_user_var::make_field(
     TRUE        Error
 */
 
-type_convert_status
+type_conversion_status
 Item_func_set_user_var::save_in_field(Field *field, bool no_conversions,
                                       bool can_use_result_field)
 {
   bool use_result_field= (!can_use_result_field ? 0 :
                           (result_field && result_field != field));
-  type_convert_status error;
+  type_conversion_status error;
 
   /* Update the value of the user variable */
   check(use_result_field);

=== modified file 'sql/item_func.h'
--- a/sql/item_func.h	2012-03-30 13:55:22 +0000
+++ b/sql/item_func.h	2012-04-11 12:47:00 +0000
@@ -1670,9 +1670,9 @@ public:
   virtual void print(String *str, enum_query_type query_type);
   void print_as_stmt(String *str, enum_query_type query_type);
   const char *func_name() const { return "set_user_var"; }
-  type_convert_status save_in_field(Field *field, bool no_conversions,
-                                    bool can_use_result_field);
-  type_convert_status save_in_field(Field *field, bool no_conversions)
+  type_conversion_status save_in_field(Field *field, bool no_conversions,
+                                       bool can_use_result_field);
+  type_conversion_status save_in_field(Field *field, bool no_conversions)
   {
     return save_in_field(field, no_conversions, 1);
   }

=== modified file 'sql/item_strfunc.h'
--- a/sql/item_strfunc.h	2012-03-30 13:55:22 +0000
+++ b/sql/item_strfunc.h	2012-04-11 12:47:00 +0000
@@ -506,7 +506,7 @@ public:
   }
   const char *func_name() const { return "user"; }
   const char *fully_qualified_func_name() const { return "user()"; }
-  type_convert_status save_in_field(Field *field, bool no_conversions)
+  type_conversion_status save_in_field(Field *field, bool no_conversions)
   {
     return save_str_value_in_field(field, &str_value);
   }

=== modified file 'sql/item_timefunc.cc'
--- a/sql/item_timefunc.cc	2012-03-30 13:55:22 +0000
+++ b/sql/item_timefunc.cc	2012-04-11 12:47:00 +0000
@@ -812,7 +812,7 @@ bool Item_temporal_func::check_precision
 }
 
 
-type_convert_status
+type_conversion_status
 Item_temporal_hybrid_func::save_in_field(Field *field, bool no_conversions)
 {
   if (cached_field_type == MYSQL_TYPE_TIME)
@@ -1869,7 +1869,7 @@ Time_zone *Item_func_now_utc::time_zone(
 }
 
 
-type_convert_status
+type_conversion_status
 Item_func_now::save_in_field(Field *to, bool no_conversions)
 {
   to->set_notnull();

=== modified file 'sql/item_timefunc.h'
--- a/sql/item_timefunc.h	2012-03-30 13:55:22 +0000
+++ b/sql/item_timefunc.h	2012-04-11 12:47:00 +0000
@@ -560,7 +560,7 @@ public:
   longlong val_int() { return val_int_from_decimal(); }
   double val_real() { return val_real_from_decimal(); }
   my_decimal *val_decimal(my_decimal *decimal_value);
-  type_convert_status save_in_field(Field *field, bool no_conversions);
+  type_conversion_status save_in_field(Field *field, bool no_conversions);
   /**
     Return string value in ASCII character set.
   */
@@ -618,7 +618,7 @@ public:
     DBUG_ASSERT(fixed == 1);
     return  val_decimal_from_date(decimal_value);
   }
-  type_convert_status save_in_field(Field *field, bool no_conversions)
+  type_conversion_status save_in_field(Field *field, bool no_conversions)
   {
     return save_date_in_field(field);
   }
@@ -659,7 +659,7 @@ public:
     DBUG_ASSERT(fixed == 1);
     return  val_decimal_from_date(decimal_value);
   }
-  type_convert_status save_in_field(Field *field, bool no_conversions)
+  type_conversion_status save_in_field(Field *field, bool no_conversions)
   {
     return save_date_in_field(field);
   }
@@ -691,7 +691,7 @@ public:
     DBUG_ASSERT(fixed == 1);
     return  val_decimal_from_time(decimal_value);
   }
-  type_convert_status save_in_field(Field *field, bool no_conversions)
+  type_conversion_status save_in_field(Field *field, bool no_conversions)
   {
     return save_time_in_field(field);
   }
@@ -1135,7 +1135,7 @@ public:
   */
   Item_func_now(uint8 dec_arg) :Item_datetime_func() { decimals= dec_arg; }
   void fix_length_and_dec();
-  type_convert_status save_in_field(Field *to, bool no_conversions);
+  type_conversion_status save_in_field(Field *to, bool no_conversions);
   longlong val_date_temporal()
   {
     DBUG_ASSERT(fixed == 1);

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2012-03-30 13:55:22 +0000
+++ b/sql/opt_range.cc	2012-04-11 12:47:00 +0000
@@ -6353,7 +6353,7 @@ get_mm_leaf(RANGE_OPT_PARAM *param, Item
   MEM_ROOT *alloc= param->mem_root;
   uchar *str;
   sql_mode_t orig_sql_mode;
-  type_convert_status err;
+  type_conversion_status err;
   const char* impossible_cond_cause= NULL;
   DBUG_ENTER("get_mm_leaf");
 
@@ -6587,7 +6587,7 @@ get_mm_leaf(RANGE_OPT_PARAM *param, Item
   // Note that value may be a stored function call, executed here.
   err= value->save_in_field_no_warnings(field, 1);
 
-  if (!((err == TYPE_OK) || (err == TYPE_ERR_NULL_VIOLATION)))
+  if (err != TYPE_OK && err != TYPE_ERR_NULL_CONSTRAINT_VIOLATION)
   {
     if (field->cmp_type() != value->result_type())
     {
@@ -6658,7 +6658,7 @@ get_mm_leaf(RANGE_OPT_PARAM *param, Item
         type = Item_func::GE_FUNC;
     }
   }
-  else if (err == TYPE_ERR_NULL_VIOLATION)
+  else if (err == TYPE_ERR_NULL_CONSTRAINT_VIOLATION)
   {
     impossible_cond_cause= "null_field_in_non_null_column";
     field->table->in_use->variables.sql_mode= orig_sql_mode;

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2012-03-30 13:55:22 +0000
+++ b/sql/sql_base.cc	2012-04-11 12:11:35 +0000
@@ -9058,7 +9058,7 @@ fill_record(THD *thd, Field **ptr, List<
     table= field->table;
     if (field == table->next_number_field)
       table->auto_increment_field_not_null= TRUE;
-    if (value->save_in_field(field, 0) == TYPE_ERR_NULL_VIOLATION)
+    if (value->save_in_field(field, 0) == TYPE_ERR_NULL_CONSTRAINT_VIOLATION)
       goto err;
   }
   DBUG_RETURN(thd->is_error());

=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h	2012-03-30 13:55:22 +0000
+++ b/sql/sql_select.h	2012-04-11 12:47:00 +0000
@@ -1014,8 +1014,8 @@ public:
 };
 
 
-inline store_key::store_key_result
-type_convert_status_to_store_key (type_convert_status ts)
+static store_key::store_key_result
+type_conversion_status_to_store_key (type_conversion_status ts)
 {
   switch (ts)
   {
@@ -1025,13 +1025,14 @@ type_convert_status_to_store_key (type_c
     return store_key::STORE_KEY_CONV;
   case TYPE_WARN_OUT_OF_RANGE:
   case TYPE_NOTE_TRUNCATED:
-  case TYPE_ERR_NULL_VIOLATION:
+  case TYPE_ERR_NULL_CONSTRAINT_VIOLATION:
   case TYPE_ERR_BAD_VALUE:
   case TYPE_ERR_OOM:
     return store_key::STORE_KEY_FATAL;
+  default:
+    DBUG_ASSERT(false); // not possible
   }
 
-  DBUG_ASSERT(false); // not possible
   return store_key::STORE_KEY_FATAL;
 }
 
@@ -1087,14 +1088,16 @@ public:
     TABLE *table= to_field->table;
     my_bitmap_map *old_map= dbug_tmp_use_all_columns(table,
                                                      table->write_set);
-    type_convert_status save_res= item->save_in_field(to_field, true);
-    store_key_result res= type_convert_status_to_store_key(save_res);
+    type_conversion_status save_res= item->save_in_field(to_field, true);
+    store_key_result res;
     /*
      Item::save_in_field() may call Item::val_xxx(). And if this is a subquery
      we need to check for errors executing it and react accordingly
     */
     if (save_res != TYPE_OK && table->in_use->is_error())
-      res= STORE_KEY_FATAL; /* STORE_KEY_FATAL */
+      res= STORE_KEY_FATAL;
+    else
+      res= type_conversion_status_to_store_key(save_res);
     dbug_tmp_restore_column_map(table->write_set, old_map);
     null_key= to_field->is_null() || item->null_value;
     return (err != 0) ? STORE_KEY_FATAL : res;

=== modified file 'sql/unireg.cc'
--- a/sql/unireg.cc	2012-03-30 13:55:22 +0000
+++ b/sql/unireg.cc	2012-04-11 12:47:00 +0000
@@ -1133,8 +1133,7 @@ static bool make_empty_rec(THD *thd, Fil
         be constant.
       */
       DBUG_ASSERT(field->def->type() != Item::FUNC_ITEM);
-      type_convert_status res= field->def->save_in_field(regfield, 1);
-      /* If not ok or warning of level 'note' */
+      type_conversion_status res= field->def->save_in_field(regfield, 1);
       if (res != TYPE_OK &&
           res != TYPE_NOTE_TIME_TRUNCATED &&
           res != TYPE_NOTE_TRUNCATED)

=== modified file 'unittest/gunit/field-t.cc'
--- a/unittest/gunit/field-t.cc	2012-03-30 13:55:22 +0000
+++ b/unittest/gunit/field-t.cc	2012-04-11 12:47:00 +0000
@@ -24,9 +24,9 @@
 #include "sql_time.h"
 #include <my_decimal.h>
 
-type_convert_status store_internal_with_error_check(Field_new_decimal *field,
-                                                    int err,
-                                                    my_decimal *value);
+type_conversion_status
+store_internal_with_error_check(Field_new_decimal *field,
+                                int err, my_decimal *value);
 namespace {
 
 using my_testing::Server_initializer;
@@ -580,7 +580,7 @@ TEST_F(FieldTest, FieldLongFromInt)
   Item_int intMinMinus1(static_cast<longlong>(INT_MIN32) - 1);
   Item_int intMaxPlus1(static_cast<longlong>(INT_MAX32) + 1);
 
-  type_convert_status err;
+  type_conversion_status err;
 
   // Legal values
   {
@@ -647,9 +647,10 @@ TEST_F(FieldTest, FieldLongFromInt)
     err= intNull.save_in_field(&field_long, true); // don't convert
     /*
       The NULL value was not stored in the field, so val_int() and
-      is_null() cannot be called when TYPE_ERR_NULL_VIOLATION is returned
+      is_null() cannot be called when
+      TYPE_ERR_NULL_CONSTRAINT_VIOLATION is returned
     */
-    EXPECT_EQ(TYPE_ERR_NULL_VIOLATION, err);
+    EXPECT_EQ(TYPE_ERR_NULL_CONSTRAINT_VIOLATION, err);
     EXPECT_EQ(0, error_handler.handle_called());
   }
 
@@ -683,7 +684,7 @@ TEST_F(FieldTest, FieldLongFromString)
   Item_string stringNull("", 0, &my_charset_latin1);
   stringNull.null_value= true;
 
-  type_convert_status err;
+  type_conversion_status err;
 
   // Legal values
   {
@@ -773,9 +774,10 @@ TEST_F(FieldTest, FieldLongFromString)
     err= stringNull.save_in_field(&field_long, true); // don't convert
     / *
       The NULL value was not stored in the field, so val_int() and
-      is_null() cannot be called when TYPE_ERR_NULL_VIOLATION is returned
+      is_null() cannot be called when
+      TYPE_ERR_NULL_CONSTRAINT_VIOLATION is returned
     * /
-    EXPECT_EQ(err, TYPE_ERR_NULL_VIOLATION);
+    EXPECT_EQ(err, TYPE_ERR_NULL_CONSTRAINT_VIOLATION);
     EXPECT_EQ(0, error_handler.handle_called());
     */
   }
@@ -812,7 +814,7 @@ TEST_F(FieldTest, FieldDateTime)
   Item_string stringFoo("foo", 3, &my_charset_latin1);
 
   Mock_field_datetime field_dt(thd(), NULL);
-  type_convert_status err;
+  type_conversion_status err;
 
   // Legal values
   {
@@ -1005,9 +1007,10 @@ TEST_F(FieldTest, FieldDateTime)
     err= stringNull.save_in_field(&field_dt, true); // don't convert
     / *
       The NULL value was not stored in the field, so val_int() and
-      is_null() cannot be called when TYPE_ERR_NULL_VIOLATION is returned
+      is_null() cannot be called when
+      TYPE_ERR_NULL_CONSTRAINT_VIOLATION is returned
     * /
-    EXPECT_EQ(err, TYPE_ERR_NULL_VIOLATION);
+    EXPECT_EQ(err, TYPE_ERR_NULL_CONSTRAINT_VIOLATION);
     EXPECT_EQ(0, error_handler.handle_called());
     */
 
@@ -1044,7 +1047,7 @@ TEST_F(FieldTest, FieldDate)
   Item_string stringFoo("foo", 3, &my_charset_latin1);
 
   Mock_field_date field_date(thd(), NULL);
-  type_convert_status err;
+  type_conversion_status err;
 
   // Legal values
   {
@@ -1194,9 +1197,10 @@ TEST_F(FieldTest, FieldDate)
     err= stringNull.save_in_field(&field_date, true); // don't convert
     / *
       The NULL value was not stored in the field, so val_int() and
-      is_null() cannot be called when TYPE_ERR_NULL_VIOLATION is returned
+      is_null() cannot be called when
+      TYPE_ERR_NULL_CONSTRAINT_VIOLATION is returned
     * /
-    EXPECT_EQ(err, TYPE_ERR_NULL_VIOLATION);
+    EXPECT_EQ(err, TYPE_ERR_NULL_CONSTRAINT_VIOLATION);
     EXPECT_EQ(0, error_handler.handle_called());
     */
   }
@@ -1297,7 +1301,7 @@ TEST_F(FieldTest, FieldNewDecimal)
 
   // Alows storing this range [-999.999, 999.999]
   Mock_field_new_decimal field_dec(thd(), NULL);
-  type_convert_status err;
+  type_conversion_status err;
 
   // Legal values
   {
@@ -1439,7 +1443,7 @@ TEST_F(FieldTest, FieldNewDecimal_store_
   Mock_field_new_decimal field_dec(thd(), NULL, 4);
 //  Field_new_decimal_unittest_only field_dec(&mock);
 
-  type_convert_status err;
+  type_conversion_status err;
 
   // Legal values
   {

=== modified file 'unittest/gunit/item-t.cc'
--- a/unittest/gunit/item-t.cc	2012-03-30 13:55:22 +0000
+++ b/unittest/gunit/item-t.cc	2012-04-11 12:47:00 +0000
@@ -92,7 +92,7 @@ public:
     This is the only member function we need to override.
     We expect it to be called with specific arguments.
    */
-  virtual type_convert_status store(longlong nr, bool unsigned_val)
+  virtual type_conversion_status store(longlong nr, bool unsigned_val)
   {
     EXPECT_EQ(m_expected_value, nr);
     EXPECT_FALSE(unsigned_val);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (jorgen.loland:3826 to 3828) Jorgen Loland11 Apr