~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/func_time.result

  • Committer: Monty Taylor
  • Date: 2009-03-05 02:06:48 UTC
  • mfrom: (907.1.8 trunk-with-temporal)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: mordred@inaugust.com-20090305020648-7jk1gie4lqsi22g8
Merged from Jay.

Show diffs side-by-side

added added

removed removed

Lines of Context:
382
382
drop table t1,t2,t3;
383
383
select @a:=FROM_UNIXTIME(1);
384
384
@a:=FROM_UNIXTIME(1)
385
 
1970-01-01 03:00:01
 
385
1970-01-01 00:00:01
386
386
select unix_timestamp(@a);
387
387
unix_timestamp(@a)
388
388
1
389
 
select unix_timestamp('1969-12-01 19:00:01');
390
 
unix_timestamp('1969-12-01 19:00:01')
391
 
0
 
389
select unix_timestamp('1970-01-01 00:00:01');
 
390
unix_timestamp('1970-01-01 00:00:01')
 
391
1
392
392
select from_unixtime(-1);
393
393
from_unixtime(-1)
394
394
NULL
395
395
select from_unixtime(2147483647);
396
396
from_unixtime(2147483647)
397
 
2038-01-19 06:14:07
 
397
2038-01-19 03:14:07
398
398
select from_unixtime(2147483648);
399
399
from_unixtime(2147483648)
400
400
NULL
401
401
select from_unixtime(0);
402
402
from_unixtime(0)
403
 
1970-01-01 03:00:00
 
403
1970-01-01 00:00:00
404
404
select unix_timestamp(from_unixtime(2147483647));
405
405
unix_timestamp(from_unixtime(2147483647))
406
406
2147483647
408
408
unix_timestamp(from_unixtime(2147483648))
409
409
NULL
410
410
select unix_timestamp('2039-01-20 01:00:00');
411
 
unix_timestamp('2039-01-20 01:00:00')
412
 
0
 
411
ERROR HY000: Received an invalid value '2039-01-20 01:00:00' for a UNIX timestamp.
413
412
select unix_timestamp('1968-01-20 01:00:00');
414
 
unix_timestamp('1968-01-20 01:00:00')
415
 
0
 
413
ERROR HY000: Received an invalid value '1968-01-20 01:00:00' for a UNIX timestamp.
416
414
select unix_timestamp('2038-02-10 01:00:00');
417
 
unix_timestamp('2038-02-10 01:00:00')
418
 
0
 
415
ERROR HY000: Received an invalid value '2038-02-10 01:00:00' for a UNIX timestamp.
419
416
select unix_timestamp('1969-11-20 01:00:00');
420
 
unix_timestamp('1969-11-20 01:00:00')
421
 
0
 
417
ERROR HY000: Received an invalid value '1969-11-20 01:00:00' for a UNIX timestamp.
422
418
select unix_timestamp('2038-01-20 01:00:00');
423
 
unix_timestamp('2038-01-20 01:00:00')
424
 
0
 
419
ERROR HY000: Received an invalid value '2038-01-20 01:00:00' for a UNIX timestamp.
425
420
select unix_timestamp('1969-12-30 01:00:00');
426
 
unix_timestamp('1969-12-30 01:00:00')
427
 
0
 
421
ERROR HY000: Received an invalid value '1969-12-30 01:00:00' for a UNIX timestamp.
428
422
select unix_timestamp('2038-01-17 12:00:00');
429
423
unix_timestamp('2038-01-17 12:00:00')
430
 
2147331600
431
 
select unix_timestamp('1970-01-01 03:00:01');
432
 
unix_timestamp('1970-01-01 03:00:01')
433
 
1
434
 
select unix_timestamp('2038-01-19 07:14:07');
435
 
unix_timestamp('2038-01-19 07:14:07')
436
 
0
 
424
2147342400
 
425
select unix_timestamp('2038-01-19 03:14:07');
 
426
unix_timestamp('2038-01-19 03:14:07')
 
427
2147483647
437
428
CREATE TABLE t1 (datetime datetime, timestamp timestamp, date date);
438
429
INSERT INTO t1 values ("2001-01-02 03:04:05", "2002-01-02 03:04:05", "2003-01-02");
439
430
SELECT * from t1;
666
657
select last_day("1997-12-1")+0.0;
667
658
last_day("1997-12-1")+0.0
668
659
19971231.0
669
 
select strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp())=0;
670
 
strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp())=0
 
660
select strcmp(date_sub(localtimestamp(), interval 0 hour), utc_timestamp())=0;
 
661
strcmp(date_sub(localtimestamp(), interval 0 hour), utc_timestamp())=0
671
662
1
672
 
select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%Y-%m-%d"), utc_date())=0;
673
 
strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%Y-%m-%d"), utc_date())=0
 
663
select strcmp(date_format(date_sub(localtimestamp(), interval 0 hour),"%Y-%m-%d"), utc_date())=0;
 
664
strcmp(date_format(date_sub(localtimestamp(), interval 0 hour),"%Y-%m-%d"), utc_date())=0
674
665
1
675
666
select strcmp(date_format(utc_timestamp(),"%Y-%m-%d"), utc_date())=0;
676
667
strcmp(date_format(utc_timestamp(),"%Y-%m-%d"), utc_date())=0