8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 14:43:03 +01:00

Fix #8211 - DATEADD truncates milliseconds for month and year deltas.

This commit is contained in:
Adriano dos Santos Fernandes 2024-08-10 21:12:33 -03:00
parent de5a727197
commit 16bb157b91

View File

@ -2802,9 +2802,10 @@ dsc* evlDateAdd(thread_db* tdbb, const SysFunction* function, const NestValueArr
ERR_post(Arg::Gds(rangeExceededStatus));
tm times;
timestamp.decode(&times);
int fractions;
timestamp.decode(&times, &fractions);
times.tm_year += quantity;
timestamp.encode(&times);
timestamp.encode(&times, fractions);
int day = times.tm_mday;
timestamp.decode(&times);
@ -2820,7 +2821,8 @@ dsc* evlDateAdd(thread_db* tdbb, const SysFunction* function, const NestValueArr
ERR_post(Arg::Gds(rangeExceededStatus));
tm times;
timestamp.decode(&times);
int fractions;
timestamp.decode(&times, &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(&times);
timestamp.encode(&times, fractions);
}
break;