int Field_time::store_TIME_with_warning(MYSQL_TIME *ltime,
                                        const ErrConv *str,
                                        int was_cut,
                                        int have_smth_to_conv)
{
  Sql_condition::enum_warning_level trunc_level= Sql_condition::WARN_LEVEL_WARN;
  int ret= 2;
  ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;

  if (!have_smth_to_conv)
  {
    bzero(ltime, sizeof(*ltime));
    was_cut= MYSQL_TIME_WARN_TRUNCATED;
    ret= 1;
  }
  else if (!MYSQL_TIME_WARN_HAVE_WARNINGS(was_cut) &&
           ((ltime->year || ltime->month) ||
            MYSQL_TIME_WARN_HAVE_NOTES(was_cut)))
  {
    if (ltime->year || ltime->month)
      ltime->year= ltime->month= ltime->day= 0;
    trunc_level= Sql_condition::WARN_LEVEL_NOTE;
    was_cut|=  MYSQL_TIME_WARN_TRUNCATED;
    ret= 3;
  }
  set_warnings(trunc_level, str, was_cut, MYSQL_TIMESTAMP_TIME);
  store_TIME(ltime);
  return was_cut ? ret : 0;
}
int Field_time::store_TIME_with_warning(MYSQL_TIME *ltime,
                                        const ErrConv *str,
                                        int was_cut,
                                        int have_smth_to_conv)
{
  Sql_condition::enum_warning_level trunc_level= Sql_condition::WARN_LEVEL_WARN;
  int ret= 2;
  ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;

  if (!have_smth_to_conv)
  {
    bzero(ltime, sizeof(*ltime));
    was_cut= MYSQL_TIME_WARN_TRUNCATED;
    ret= 1;
  }
  else if (!MYSQL_TIME_WARN_HAVE_WARNINGS(was_cut) &&
           ((ltime->year || ltime->month) ||
            MYSQL_TIME_WARN_HAVE_NOTES(was_cut)))
  {
    if (ltime->year || ltime->month)
      ltime->year= ltime->month= ltime->day= 0;
    trunc_level= Sql_condition::WARN_LEVEL_NOTE;
    was_cut|=  MYSQL_TIME_WARN_TRUNCATED;
    ret= 3;
  }
  set_warnings(trunc_level, str, was_cut, MYSQL_TIMESTAMP_TIME);
  store_TIME(ltime);
  return was_cut ? ret : 0;
}