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

Fix #6800 - Client config DefaultTimeZone is not passed to server when isc_dpb_session_time_zone is not set.

This commit is contained in:
Adriano dos Santos Fernandes 2021-05-10 10:45:05 -03:00
parent c3445efbd4
commit 57c8fd53b9
2 changed files with 14 additions and 5 deletions

View File

@ -8,11 +8,13 @@ data types are defined to use the session time zone when converting from or to a
`TIME` and `TIMESTAMP` are synonymous to theirs respectively `WITHOUT TIME ZONE` data types.
The session time zone, as the name implies, can be a different one for each database attachment.
It can be set with the isc_dpb_session_time_zone DPB, and if not, it starts by default defined to be the
`firebird.conf` parameter `DefaultTimeZone` or the same time zone used by the Firebird OS process when the parameter is not defined.
It can be set (with this priority) using `isc_dpb_session_time_zone` DPB, the client's `firebird.conf`
parameter `DefaultTimeZone` and the server's `firebird.conf` parameter `DefaultTimeZone`. If none of these are set,
it starts using the same time zone used by the Firebird engine OS process.
A change in `DefaultTimeZone` configuration or the OS time zone does not changes the default of a running Firebird process.
It can then be changed with `SET TIME ZONE` statement to a given time zone or reset to its original value with `SET TIME ZONE LOCAL`.
The session time zone can be changed with `SET TIME ZONE` statement to a given time zone or reset to its original value
with `SET TIME ZONE LOCAL`.
The original time zone value is initially defined equal to the current time zone in session initialization and cannot
be changed manually. But the original time zone is internally changed when a routine (function, procedure or trigger)

View File

@ -6192,11 +6192,18 @@ YAttachment* Dispatcher::attachOrCreateDatabase(CheckStatusWrapper* status, bool
// Take care about DPB
setLogin(newDpb, false);
if (!utfData)
if (!newDpb.find(isc_dpb_session_time_zone))
{
IntlDpb().toUtf8(newDpb);
const char* defaultTimeZone = Config::getDefaultTimeZone();
if (defaultTimeZone && defaultTimeZone[0])
newDpb.insertString(isc_dpb_session_time_zone, defaultTimeZone);
}
if (!utfData)
IntlDpb().toUtf8(newDpb);
// Take care about filename
PathName orgFilename(filename);
if (utfData)