mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 00:03:02 +01:00
Remove weekday support in DATEADD/DATEDIFF - CORE-1526
This commit is contained in:
parent
51d8bae04f
commit
78e4d71ee1
@ -276,7 +276,7 @@ Format:
|
||||
DATEADD( <number> <timestamp_part> TO <date_time> )
|
||||
DATEADD( <timestamp_part>, <number>, <date_time> )
|
||||
|
||||
timestamp_part ::= { YEAR | MONTH | DAY | WEEKDAY | HOUR | MINUTE | SECOND | MILLISECOND }
|
||||
timestamp_part ::= { YEAR | MONTH | DAY | HOUR | MINUTE | SECOND | MILLISECOND }
|
||||
|
||||
Notes:
|
||||
1) YEAR, MONTH, DAY and WEEKDAY could not be used with time values.
|
||||
|
@ -1243,10 +1243,6 @@ static dsc* evlDateAdd(Jrd::thread_db* tdbb, const SysFunction* function, Jrd::j
|
||||
timestamp.value().timestamp_date += quantity;
|
||||
break;
|
||||
|
||||
case blr_extract_weekday:
|
||||
timestamp.value().timestamp_date += (quantity * 7);
|
||||
break;
|
||||
|
||||
case blr_extract_hour:
|
||||
add10msec(×tamp.value(), quantity, 3600 * ISC_TIME_SECONDS_PRECISION);
|
||||
break;
|
||||
@ -1384,7 +1380,6 @@ static dsc* evlDateDiff(Jrd::thread_db* tdbb, const SysFunction* function, Jrd::
|
||||
case blr_extract_year:
|
||||
case blr_extract_month:
|
||||
case blr_extract_day:
|
||||
case blr_extract_weekday:
|
||||
if (value1Dsc->dsc_dtype == dtype_sql_time || value2Dsc->dsc_dtype == dtype_sql_time)
|
||||
status_exception::raise(isc_expression_eval_err, 0);
|
||||
break;
|
||||
@ -1418,10 +1413,7 @@ static dsc* evlDateDiff(Jrd::thread_db* tdbb, const SysFunction* function, Jrd::
|
||||
break;
|
||||
|
||||
case blr_extract_day:
|
||||
case blr_extract_weekday:
|
||||
result = timestamp2.value().timestamp_date - timestamp1.value().timestamp_date;
|
||||
if (part == blr_extract_weekday)
|
||||
result /= 7;
|
||||
break;
|
||||
|
||||
case blr_extract_hour:
|
||||
|
Loading…
Reference in New Issue
Block a user