~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/datetime.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:
53
53
    error= 1;                                 // Fix if invalid zero date
54
54
 
55
55
  if (error)
56
 
    set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
 
56
    set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
57
57
                         ER_WARN_DATA_OUT_OF_RANGE,
58
58
                         from, len, DRIZZLE_TIMESTAMP_DATETIME, 1);
59
59
 
74
74
  int error= 0;
75
75
  if (nr < 0.0 || nr > 99991231235959.0)
76
76
  {
77
 
    set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, 
 
77
    set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, 
78
78
                         ER_WARN_DATA_OUT_OF_RANGE,
79
79
                         nr, DRIZZLE_TIMESTAMP_DATETIME);
80
80
    nr= 0.0;
106
106
  }
107
107
 
108
108
  if (error)
109
 
    set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
 
109
    set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
110
110
                         error == 2 ? ER_WARN_DATA_OUT_OF_RANGE :
111
111
                         ER_WARN_DATA_TRUNCATED, initial_nr,
112
112
                         DRIZZLE_TIMESTAMP_DATETIME, 1);
145
145
      char buff[MAX_DATE_STRING_REP_LENGTH];
146
146
      String str(buff, sizeof(buff), &my_charset_latin1);
147
147
      make_datetime((DATE_TIME_FORMAT *) 0, ltime, &str);
148
 
      set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED,
 
148
      set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED,
149
149
                           str.ptr(), str.length(), DRIZZLE_TIMESTAMP_DATETIME,1);
150
150
    }
151
151
  }
153
153
  {
154
154
    tmp=0;
155
155
    error= 1;
156
 
    set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
 
156
    set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
157
157
  }
158
158
#ifdef WORDS_BIGENDIAN
159
159
  if (table && table->s->db_low_byte_first)