mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 18:03:03 +01:00
Fix #8211 - DATEADD truncates milliseconds for month and year deltas.
This commit is contained in:
parent
de5a727197
commit
16bb157b91
@ -2802,9 +2802,10 @@ dsc* evlDateAdd(thread_db* tdbb, const SysFunction* function, const NestValueArr
|
||||
ERR_post(Arg::Gds(rangeExceededStatus));
|
||||
|
||||
tm times;
|
||||
timestamp.decode(×);
|
||||
int fractions;
|
||||
timestamp.decode(×, &fractions);
|
||||
times.tm_year += quantity;
|
||||
timestamp.encode(×);
|
||||
timestamp.encode(×, fractions);
|
||||
|
||||
int day = times.tm_mday;
|
||||
timestamp.decode(×);
|
||||
@ -2820,7 +2821,8 @@ dsc* evlDateAdd(thread_db* tdbb, const SysFunction* function, const NestValueArr
|
||||
ERR_post(Arg::Gds(rangeExceededStatus));
|
||||
|
||||
tm times;
|
||||
timestamp.decode(×);
|
||||
int fractions;
|
||||
timestamp.decode(×, &fractions);
|
||||
|
||||
int md[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||
|
||||
@ -2855,7 +2857,7 @@ dsc* evlDateAdd(thread_db* tdbb, const SysFunction* function, const NestValueArr
|
||||
else if (times.tm_mday < 1)
|
||||
times.tm_mday = 1;
|
||||
|
||||
timestamp.encode(×);
|
||||
timestamp.encode(×, fractions);
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user