~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/datetime.cc

  • Committer: Monty Taylor
  • Date: 2008-10-22 21:31:15 UTC
  • Revision ID: monty@inaugust.com-20081022213115-xuxc80r939tl88p1
Renamed drizzle_common again. Removed sql_common. (empty) 
Now all we need to do is merge/disect base.h, common.h, common_includes.h, server_includes.h and globa.h (good grief)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifdef USE_PRAGMA_IMPLEMENTATION
22
 
#pragma implementation                          // gcc: Class implementation
23
 
#endif
24
21
 
25
22
#include <drizzled/server_includes.h>
26
23
#include <drizzled/field/datetime.h>
40
37
  int error;
41
38
  uint64_t tmp= 0;
42
39
  enum enum_drizzle_timestamp_type func_res;
43
 
  THD *thd= table ? table->in_use : current_thd;
 
40
  Session *session= table ? table->in_use : current_session;
44
41
 
45
42
  func_res= str_to_datetime(from, len, &time_tmp,
46
43
                            (TIME_FUZZY_DATE |
47
 
                             (thd->variables.sql_mode &
 
44
                             (session->variables.sql_mode &
48
45
                              (MODE_NO_ZERO_DATE | MODE_INVALID_DATES))),
49
46
                            &error);
50
47
  if ((int) func_res > (int) DRIZZLE_TIMESTAMP_ERROR)
91
88
  DRIZZLE_TIME not_used;
92
89
  int error;
93
90
  int64_t initial_nr= nr;
94
 
  THD *thd= table ? table->in_use : current_thd;
 
91
  Session *session= table ? table->in_use : current_session;
95
92
 
96
93
  nr= number_to_datetime(nr, &not_used, (TIME_FUZZY_DATE |
97
 
                                         (thd->variables.sql_mode &
 
94
                                         (session->variables.sql_mode &
98
95
                                          (MODE_NO_ZERO_DATE |
99
96
                                           MODE_INVALID_DATES))), &error);
100
97
 
138
135
         (ltime->hour*10000L+ltime->minute*100+ltime->second));
139
136
    if (check_date(ltime, tmp != 0,
140
137
                   (TIME_FUZZY_DATE |
141
 
                    (current_thd->variables.sql_mode &
 
138
                    (current_session->variables.sql_mode &
142
139
                     (MODE_NO_ZERO_DATE | MODE_INVALID_DATES))), &error))
143
140
    {
144
141
      char buff[MAX_DATE_STRING_REP_LENGTH];