~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/func_time.test

  • Committer: Stewart Smith
  • Date: 2011-01-14 05:11:45 UTC
  • mto: (2086.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2087.
  • Revision ID: stewart@flamingspork.com-20110114051145-xiputq4lvmtct377
storage engine docs. add bit about some temp table only engines.

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