~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/timestamp.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:
158
158
  if (error || !have_smth_to_conv)
159
159
  {
160
160
    error= 1;
161
 
    set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED,
 
161
    set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED,
162
162
                         from, len, DRIZZLE_TIMESTAMP_DATETIME, 1);
163
163
  }
164
164
 
167
167
  {
168
168
    if (!(tmp= TIME_to_timestamp(thd, &l_time, &in_dst_time_gap)))
169
169
    {
170
 
      set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
 
170
      set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
171
171
                           ER_WARN_DATA_OUT_OF_RANGE,
172
172
                           from, len, DRIZZLE_TIMESTAMP_DATETIME, !error);
173
173
      error= 1;
174
174
    }
175
175
    else if (in_dst_time_gap)
176
176
    {
177
 
      set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
 
177
      set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
178
178
                           ER_WARN_INVALID_TIMESTAMP,
179
179
                           from, len, DRIZZLE_TIMESTAMP_DATETIME, !error);
180
180
      error= 1;
190
190
  int error= 0;
191
191
  if (nr < 0 || nr > 99991231235959.0)
192
192
  {
193
 
    set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
 
193
    set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
194
194
                         ER_WARN_DATA_OUT_OF_RANGE,
195
195
                         nr, DRIZZLE_TIMESTAMP_DATETIME);
196
196
    nr= 0;                                      // Avoid overflow on buff
223
223
  {
224
224
    if (!(timestamp= TIME_to_timestamp(thd, &l_time, &in_dst_time_gap)))
225
225
    {
226
 
      set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
 
226
      set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
227
227
                           ER_WARN_DATA_OUT_OF_RANGE,
228
228
                           nr, DRIZZLE_TIMESTAMP_DATETIME, 1);
229
229
      error= 1;
230
230
    }
231
231
    if (in_dst_time_gap)
232
232
    {
233
 
      set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
 
233
      set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
234
234
                           ER_WARN_INVALID_TIMESTAMP,
235
235
                           nr, DRIZZLE_TIMESTAMP_DATETIME, 1);
236
236
      error= 1;
237
237
    }
238
238
  } else if (error)
239
 
    set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
 
239
    set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
240
240
                         ER_WARN_DATA_TRUNCATED,
241
241
                         nr, DRIZZLE_TIMESTAMP_DATETIME, 1);
242
242