~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/func_time.result

  • Committer: Jay Pipes
  • Date: 2009-01-30 04:38:21 UTC
  • mto: This revision was merged to the branch mainline in revision 830.
  • Revision ID: jpipes@serialcoder-20090130043821-4d7jg2ftabefamxb
Fixes for the QUARTER() function to use new Temporal system and throw
errors on bad datetime values.

Added test case for QUARTER() function and modified func_time.test existing
test to correctly throw errors and report NULL, not 0 on NULL input.

Show diffs side-by-side

added added

removed removed

Lines of Context:
457
457
select month("0000-00-00"),month(d),month(dt),month(t),month(c) from t1;
458
458
ERROR HY000: Received an invalid datetime value '0000-00-00'.
459
459
select quarter("0000-00-00"),quarter(d),quarter(dt),quarter(t),quarter(c) from t1;
460
 
quarter("0000-00-00")   quarter(d)      quarter(dt)     quarter(t)      quarter(c)
461
 
0       0       0       0       0
 
460
ERROR HY000: Received an invalid datetime value '0000-00-00'.
462
461
select week("0000-00-00"),week(d),week(dt),week(t),week(c) from t1;
463
462
week("0000-00-00")      week(d) week(dt)        week(t) week(c)
464
463
NULL    NULL    NULL    NULL    NULL
1112
1111
FROM t1;
1113
1112
t1      t2      SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) )    QUARTER(d)
1114
1113
10:00:00        NULL    NULL    NULL
1115
 
11:00:00        11:15:00        00:15:00        1
 
1114
11:00:00        11:15:00        00:15:00        NULL
1116
1115
SELECT t1, t2, SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ), QUARTER(d)
1117
1116
FROM t1 ORDER BY a DESC;
1118
1117
t1      t2      SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) )    QUARTER(d)