~drizzle-developers/drizzle/elliott-release

« back to all changes in this revision

Viewing changes to tests/t/func_time.test

  • Committer: Patrick Crews
  • Date: 2011-02-01 20:33:06 UTC
  • mfrom: (1845.2.288 drizzle)
  • Revision ID: gleebix@gmail.com-20110201203306-mwq2rk0it81tlwxh
Merged Trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
 
174
174
create table t1 (d date, dt datetime, t timestamp, c char(10));
175
175
insert into t1 values (null, null, null, null);
176
 
--error ER_INVALID_DATETIME_VALUE # Bad dates...
 
176
 
 
177
--error ER_INVALID_DATE_VALUE # Bad dates...
177
178
insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00");
 
179
 
178
180
--error ER_INVALID_DATETIME_VALUE # 0000-00-00 is a bad date
179
181
select dayofyear("0000-00-00"),dayofyear(d),dayofyear(dt),dayofyear(t),dayofyear(c) from t1;
 
182
 
180
183
--error ER_INVALID_DATETIME_VALUE # 0000-00-00 is a bad date
181
184
select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c) from t1;
 
185
 
182
186
--error ER_INVALID_DATETIME_VALUE # 0000-00-00 is not a damn date.
183
187
select month("0000-00-00"),month(d),month(dt),month(t),month(c) from t1;
 
188
 
184
189
--error ER_INVALID_DATETIME_VALUE # 0000-00-00 not a date
185
190
select quarter("0000-00-00"),quarter(d),quarter(dt),quarter(t),quarter(c) from t1;
 
191
 
186
192
--error ER_INVALID_DATETIME_VALUE # Argh.  0000-00-00 is not a date.
187
193
select year("0000-00-00"),year(d),year(dt),year(t),year(c) from t1;
 
194
 
188
195
--error ER_INVALID_DATETIME_VALUE # Bad datetime
189
196
select to_days("0000-00-00"),to_days(d),to_days(dt),to_days(c) from t1;
 
197
 
190
198
--error ER_INVALID_DATETIME_VALUE # Ugh. bad datetime
191
199
select extract(MONTH FROM "0000-00-00"),extract(MONTH FROM d),extract(MONTH FROM dt),extract(MONTH FROM t),extract(MONTH FROM c) from t1;
192
200
drop table t1;
242
250
 
243
251
# check for invalid dates
244
252
 
245
 
# bad year
 
253
# Legal, Drizzle has 64bit timestamp
246
254
--error ER_INVALID_UNIX_TIMESTAMP_VALUE # Bad timestamp
247
255
select unix_timestamp('2039-01-20 01:00:00');
 
256
 
248
257
--error ER_INVALID_UNIX_TIMESTAMP_VALUE # Bad timestamp
249
258
select unix_timestamp('1968-01-20 01:00:00');
250
 
# bad month
 
259
 
251
260
--error ER_INVALID_UNIX_TIMESTAMP_VALUE # Bad timestamp
252
261
select unix_timestamp('2038-02-10 01:00:00');
 
262
 
253
263
--error ER_INVALID_UNIX_TIMESTAMP_VALUE # Bad timestamp
254
264
select unix_timestamp('1969-11-20 01:00:00');
255
 
# bad day
 
265
 
256
266
--error ER_INVALID_UNIX_TIMESTAMP_VALUE # Bad timestamp
257
267
select unix_timestamp('2038-01-20 01:00:00');
 
268
 
258
269
--error ER_INVALID_UNIX_TIMESTAMP_VALUE # Bad timestamp
259
270
select unix_timestamp('1969-12-30 01:00:00');
260
271