~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/datetime.cc

  • Committer: Jay Pipes
  • Date: 2009-03-01 03:08:20 UTC
  • mto: (910.2.6 mordred-noatomics)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: jpipes@serialcoder-20090301030820-8kxgypvo3yexa9d1
Final removal of timezones

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
                          uint32_t len,
46
46
                          const CHARSET_INFO * const )
47
47
{
48
 
#ifdef NOTDEFINED
49
 
  DRIZZLE_TIME time_tmp;
50
 
  int error;
51
 
  uint64_t tmp= 0;
52
 
  enum enum_drizzle_timestamp_type func_res;
53
 
  Session *session= table ? table->in_use : current_session;
54
 
 
55
 
  func_res= str_to_datetime(from, len, &time_tmp,
56
 
                            (TIME_FUZZY_DATE |
57
 
                             (session->variables.sql_mode &
58
 
                              (MODE_NO_ZERO_DATE | MODE_INVALID_DATES))),
59
 
                            &error);
60
 
  if ((int) func_res > (int) DRIZZLE_TIMESTAMP_ERROR)
61
 
    tmp= TIME_to_uint64_t_datetime(&time_tmp);
62
 
  else
63
 
    error= 1;                                 // Fix if invalid zero date
64
 
 
65
 
  if (error)
66
 
    set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
67
 
                         ER_WARN_DATA_OUT_OF_RANGE,
68
 
                         from, len, DRIZZLE_TIMESTAMP_DATETIME, 1);
69
 
 
70
 
#ifdef WORDS_BIGENDIAN
71
 
  if (table && table->s->db_low_byte_first)
72
 
  {
73
 
    int8store(ptr,tmp);
74
 
  }
75
 
  else
76
 
#endif
77
 
    int64_tstore(ptr,tmp);
78
 
#endif /* NOTDEFINED */
79
48
  /* 
80
49
   * Try to create a DateTime from the supplied string.  Throw an error
81
50
   * if unable to create a valid DateTime.