~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/time.cc

  • Committer: Felipe
  • Date: 2008-08-04 23:58:04 UTC
  • mto: (261.2.6 codestyle)
  • mto: This revision was merged to the branch mainline in revision 263.
  • Revision ID: felipe@pena-20080804235804-x55q2xqxcar6u66f
- Renamed MYSQL_ERROR to DRIZZLE_ERROR.

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
                                      MODE_NO_ZERO_DATE))),
231
231
                           &was_cut);
232
232
  if (was_cut || ts_type <= DRIZZLE_TIMESTAMP_ERROR)
233
 
    make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
233
    make_truncated_value_warning(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
234
234
                                 str, length, ts_type,  NullS);
235
235
  return ts_type;
236
236
}
284
284
  int warning;
285
285
  bool ret_val= str_to_time(str, length, l_time, &warning);
286
286
  if (ret_val || warning)
287
 
    make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
287
    make_truncated_value_warning(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
288
288
                                 str, length, DRIZZLE_TIMESTAMP_TIME, NullS);
289
289
  return ret_val;
290
290
}
713
713
}
714
714
 
715
715
 
716
 
void make_truncated_value_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
 
716
void make_truncated_value_warning(THD *thd, DRIZZLE_ERROR::enum_warning_level level,
717
717
                                  const char *str_val,
718
718
                                  uint str_length, timestamp_type time_type,
719
719
                                  const char *field_name)
720
720
{
721
 
  char warn_buff[MYSQL_ERRMSG_SIZE];
 
721
  char warn_buff[DRIZZLE_ERRMSG_SIZE];
722
722
  const char *type_str;
723
723
  CHARSET_INFO *cs= &my_charset_latin1;
724
724
  char buff[128];
860
860
  return 0;                                     // Ok
861
861
 
862
862
invalid_date:
863
 
  push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
863
  push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
864
864
                      ER_DATETIME_FUNCTION_OVERFLOW,
865
865
                      ER(ER_DATETIME_FUNCTION_OVERFLOW),
866
866
                      "datetime");