mirror of
https://github.com/MariaDB/server.git
synced 2025-07-16 00:42:55 +03:00
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public domain elsie-code). Now user can select current time zone (from the list of time zones described in system tables). All NOW-like functions honor this time zone, values of TIMESTAMP type are interpreted as values in this time zone, so now our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH LOCAL TIME ZONE (or proper PostgresSQL type). WL#1266 "CONVERT_TZ() - basic time with time zone conversion function". Fixed problems described in Bug #2336 (Different number of warnings when inserting bad datetime as string or as number). This required reworking of datetime realted warning hadling (they now generated at Field object level not in conversion functions). Optimization: Now Field class descendants use table->in_use member instead of current_thd macro.
This commit is contained in:
@ -179,3 +179,42 @@ name varchar(64) not null,
|
||||
primary key (help_keyword_id),
|
||||
unique index (name)
|
||||
) comment='help keywords';
|
||||
|
||||
#
|
||||
# Create missing time zone related tables
|
||||
#
|
||||
|
||||
CREATE TABLE IF NOT EXISTS time_zone_name (
|
||||
Name char(64) NOT NULL,
|
||||
Time_zone_id int unsigned NOT NULL,
|
||||
PRIMARY KEY Name (Name)
|
||||
) DEFAULT CHARACTER SET latin1 comment='Time zone names';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS time_zone (
|
||||
Time_zone_id int unsigned NOT NULL auto_increment,
|
||||
Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,
|
||||
PRIMARY KEY TzId (Time_zone_id)
|
||||
) DEFAULT CHARACTER SET latin1 comment='Time zones';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS time_zone_transition (
|
||||
Time_zone_id int unsigned NOT NULL,
|
||||
Transition_time bigint signed NOT NULL,
|
||||
Transition_type_id int unsigned NOT NULL,
|
||||
PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)
|
||||
) DEFAULT CHARACTER SET latin1 comment='Time zone transitions';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS time_zone_transition_type (
|
||||
Time_zone_id int unsigned NOT NULL,
|
||||
Transition_type_id int unsigned NOT NULL,
|
||||
Offset int signed DEFAULT 0 NOT NULL,
|
||||
Is_DST tinyint unsigned DEFAULT 0 NOT NULL,
|
||||
Abbreviation char(8) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)
|
||||
) DEFAULT CHARACTER SET latin1 comment='Time zone transition types';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS time_zone_leap_second (
|
||||
Transition_time bigint signed NOT NULL,
|
||||
Correction int signed NOT NULL,
|
||||
PRIMARY KEY TranTime (Transition_time)
|
||||
) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones';
|
||||
|
||||
|
Reference in New Issue
Block a user