~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/date.cc

  • Committer: Brian Aker
  • Date: 2008-10-20 04:28:21 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020042821-rqqdrccuu8195k3y
Second pass of thd cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
  long tmp;
55
55
  DRIZZLE_TIME l_time;
56
56
  int error;
57
 
  Session *thd= table ? table->in_use : current_thd;
 
57
  Session *session= table ? table->in_use : current_session;
58
58
  enum enum_drizzle_timestamp_type ret;
59
59
  if ((ret= str_to_datetime(from, len, &l_time,
60
60
                            (TIME_FUZZY_DATE |
61
 
                             (thd->variables.sql_mode &
 
61
                             (session->variables.sql_mode &
62
62
                              (MODE_NO_ZERO_DATE | MODE_INVALID_DATES))),
63
63
                            &error)) <= DRIZZLE_TIMESTAMP_ERROR)
64
64
  {
103
103
  DRIZZLE_TIME l_time;
104
104
  int64_t tmp;
105
105
  int error;
106
 
  Session *thd= table ? table->in_use : current_thd;
 
106
  Session *session= table ? table->in_use : current_session;
107
107
  if (number_to_datetime(nr, &l_time,
108
108
                         (TIME_FUZZY_DATE |
109
 
                          (thd->variables.sql_mode &
 
109
                          (session->variables.sql_mode &
110
110
                           (MODE_NO_ZERO_DATE | MODE_INVALID_DATES))),
111
111
                         &error) == INT64_C(-1))
112
112
  {
143
143
    tmp=ltime->year*16*32+ltime->month*32+ltime->day;
144
144
    if (check_date(ltime, tmp != 0,
145
145
                   (TIME_FUZZY_DATE |
146
 
                    (current_thd->variables.sql_mode &
 
146
                    (current_session->variables.sql_mode &
147
147
                     (MODE_NO_ZERO_DATE | MODE_INVALID_DATES))), &error))
148
148
    {
149
149
      char buff[MAX_DATE_STRING_REP_LENGTH];