CUBRID Engine
latest
|
#include "config.h"
#include <assert.h>
#include "tz_support.h"
#include "db_date.h"
#include "environment_variable.h"
#include "chartype.h"
#include "error_manager.h"
#include <dlfcn.h>
#include <unistd.h>
#include "system_parameter.h"
#include "show_scan.h"
#include "authenticate.h"
#include "db.h"
#include "boot_sr.h"
#include "dbtype.h"
Go to the source code of this file.
Classes | |
struct | tz_decode_info |
Macros | |
#define | strlen(s1) ((int) strlen(s1)) |
#define | FULL_DATE(jul_date, time_sec) |
#define | TIME_OFFSET(is_utc, offset) ((is_utc) ? (-offset) : (offset)) |
#define | ABS(i) ((i) >= 0 ? (i) : -(i)) |
#define | TZ_INVALID_OFFSET ((((23 * 60) + 59) * 60) + 59) |
#define | TZ_MIN_OFFSET -12 * 3600 |
#define | TZ_MAX_OFFSET 14 * 3600 |
#define | MILLIS_IN_A_DAY (long)(86400000) /* 24L * 60L * 60L * 1000 */ |
#define | TZ_MASK_TZ_ID_FLAG 0xc0000000 |
#define | TZ_BIT_SHIFT_TZ_ID_FLAG 30 |
#define | TZ_OFFSET_MASK 0x3fffffff |
#define | SECONDS_IN_A_DAY 24 * 3600 |
#define | TZ_GET_SYM_ADDR(lib, sym) dlsym(lib, sym) |
#define | TZLIB_GET_ADDR(v, SYM_NAME, SYM_TYPE, lh) |
#define | TZLIB_GET_VAL(v, SYM_NAME, SYM_TYPE, lh) |
#define | APPLY_NEXT_OFF_RULE() |
#define | LEN_MIN_HOUR 6 |
#define | LEN_MIN_HOUR_SEC 9 |
Typedefs | |
typedef struct tz_decode_info | TZ_DECODE_INFO |
typedef enum ds_search_direction | DS_SEARCH_DIRECTION |
Enumerations | |
enum | ds_search_direction { FORWARD = 0, BACKWARD = 1 } |
Functions | |
static int | tz_load_library (const char *lib_file, void **handle) |
static int | tz_load_data_from_lib (TZ_DATA *tzd, void *lib_handle) |
static bool | tz_get_leapsec_support (void) |
static const TZ_REGION * | tz_get_invalid_tz_region (void) |
static DB_DATE | tz_get_current_date (void) |
static int | tz_str_timezone_decode (const char *tz_str, const int tz_str_size, TZ_DECODE_INFO *tz_info, const char **tz_end) |
static int | tz_zone_info_to_str (const TZ_DECODE_INFO *tz_info, char *tz_str, const int tz_str_size) |
static void | tz_encode_tz_id (const TZ_DECODE_INFO *tz_info, TZ_ID *tz_id) |
static void | tz_encode_tz_region (const TZ_DECODE_INFO *tz_info, TZ_REGION *tz_region) |
static void | tz_decode_tz_id (const TZ_ID *tz_id, const bool is_full_decode, TZ_DECODE_INFO *tz_info) |
static void | tz_decode_tz_region (const TZ_REGION *tz_region, TZ_DECODE_INFO *tz_info) |
static int | tz_fast_find_ds_rule (const TZ_DATA *tzd, const TZ_DS_RULESET *ds_ruleset, const int src_julian_date, const int src_year, const int src_month, int *ds_rule_id) |
static bool | tz_check_ds_match_string (const TZ_OFFSET_RULE *off_rule, const TZ_DS_RULE *ds_rule, const char *ds_string, const char *default_abrev) |
static int | tz_datetime_utc_conv (const DB_DATETIME *src_dt, TZ_DECODE_INFO *tz_info, bool src_is_utc, bool only_tz_adjust, DB_DATETIME *dest_dt) |
static int | tz_conv_tz_datetime_w_zone_info (const DB_DATETIME *src_dt, const TZ_DECODE_INFO *src_zone_info_in, const TZ_DECODE_INFO *dest_zone_info_in, DB_DATETIME *dest_dt, TZ_DECODE_INFO *src_zone_info_out, TZ_DECODE_INFO *dest_zone_info_out) |
static int | tz_print_tz_offset (char *result, int tz_offset) |
static int | starts_with (const char *prefix, const char *str) |
static int | tz_get_zone_id_by_name (const char *name, const int name_size) |
static void | tz_timestamp_decode_leap_sec_adj (int timestamp, int *yearp, int *monthsp, int *dayp, int *hoursp, int *minutesp, int *secondsp) |
static int | tz_offset (const bool src_is_utc, const TZ_TIME_TYPE until_time_type, const int gmt_offset_sec, const int ds_save_time) |
static int | get_date_diff_from_ds_rule (const int src_julian_date, const int src_time_sec, const TZ_DS_RULE *ds_rule, const DS_SEARCH_DIRECTION direction, full_date_t *date_diff) |
static int | get_closest_ds_rule (const int src_julian_date, const int src_time_sec, const TZ_DS_RULESET *ds_ruleset, const TZ_DATA *tzd, const DS_SEARCH_DIRECTION direction) |
static int | get_saving_time_from_offset_rule (const TZ_OFFSET_RULE *offset_rule, const TZ_DATA *tzd, int *save_time) |
static bool | is_in_overlap_interval (const TZ_TIME_TYPE time_type, const full_date_t offset_rule_diff, const full_date_t gmt_diff, const int save_time_diff) |
static int | get_year_to_apply_rule (const int src_year, const TZ_DS_RULE *ds_rule) |
static int | set_new_zone_id (TZ_DECODE_INFO *tz_info) |
int | tz_load (void) |
void | tz_unload (void) |
DB_BIGINT | tz_timestamp_encode_leap_sec_adj (const int year_century, const int year, const int mon, const int day) |
void | tz_timestamp_decode_sec (int timestamp, int *yearp, int *monthsp, int *dayp, int *hoursp, int *minutesp, int *secondsp) |
void | tz_timestamp_decode_no_leap_sec (int timestamp, int *yearp, int *monthsp, int *dayp, int *hoursp, int *minutesp, int *secondsp) |
const TZ_DATA * | tz_get_data (void) |
void | tz_set_data (const TZ_DATA *data) |
const TZ_DATA * | tz_get_new_timezone_data (void) |
void | tz_set_new_timezone_data (const TZ_DATA *data) |
const char * | tz_get_session_local_timezone (void) |
const char * | tz_get_system_timezone (void) |
void | tz_get_system_tz_region (TZ_REGION *tz_region) |
void | tz_get_session_tz_region (TZ_REGION *tz_region) |
void | tz_id_to_region (const TZ_ID *tz_id, TZ_REGION *tz_region) |
const TZ_ID * | tz_get_utc_tz_id (void) |
const TZ_REGION * | tz_get_utc_tz_region (void) |
int | tz_get_timezone_offset (const char *tz_str, int tz_size, char *result, DB_DATETIME *utc_datetime) |
int | tz_create_session_tzid_for_datetime (const DB_DATETIME *src_dt, bool src_is_utc, TZ_ID *tz_id) |
int | tz_create_session_tzid_for_timestamp (const DB_UTIME *src_ts, TZ_ID *tz_id) |
int | tz_create_session_tzid_for_time (const DB_TIME *src_time, bool src_is_utc, TZ_ID *tz_id) |
int | tz_str_to_region (const char *tz_str, const int tz_str_size, TZ_REGION *tz_region) |
int | tz_create_datetimetz (const DB_DATETIME *dt, const char *tz_str, const int tz_size, const TZ_REGION *default_tz_region, DB_DATETIMETZ *dt_tz, const char **end_tz_str) |
int | tz_create_timestamptz (const DB_DATE *date, const DB_TIME *time, const char *tz_str, const int tz_size, const TZ_REGION *default_tz_region, DB_TIMESTAMPTZ *ts_tz, const char **end_tz_str) |
int | tz_create_datetimetz_from_ses (const DB_DATETIME *dt, DB_DATETIMETZ *dt_tz) |
int | tz_conv_tz_time_w_zone_name (const DB_TIME *time_source, const char *source_zone, int len_source, const char *dest_zone, int len_dest, DB_TIME *time_dest) |
int | tz_utc_datetimetz_to_local (const DB_DATETIME *dt_utc, const TZ_ID *tz_id, DB_DATETIME *dt_local) |
int | tz_datetimeltz_to_local (const DB_DATETIME *dt_ltz, DB_DATETIME *dt_local) |
int | tz_id_to_str (const TZ_ID *tz_id, char *tz_str, const int tz_str_size) |
int | tz_datetimetz_fix_zone (const DB_DATETIMETZ *src_dt_tz, DB_DATETIMETZ *dest_dt_tz) |
int | tz_timestamptz_fix_zone (const DB_TIMESTAMPTZ *src_ts_tz, DB_TIMESTAMPTZ *dest_ts_tz) |
int | tz_get_first_weekday_around_date (const int year, const int month, const int weekday, const int ref_day, const bool before) |
int | tz_str_read_number (const char *str, const char *str_end, const bool strict, const bool read_sign, int *val, const char **str_next) |
int | tz_str_read_time (const char *str, const char *str_end, bool need_minutes, bool allow_sec60, int *hour, int *min, int *sec, const char **str_next) |
int | tz_str_to_seconds (const char *str, const char *str_end, int *seconds, const char **str_next, const bool is_offset) |
int | tz_get_ds_change_julian_date_diff (const int src_julian_date, const TZ_DS_RULE *ds_rule, const int year, int *ds_rule_julian_date, full_date_t *date_diff) |
int | tz_conv_tz_datetime_w_region (const DB_DATETIME *src_dt, const TZ_REGION *src_tz_region, const TZ_REGION *dest_tz_region, DB_DATETIME *dest_dt, TZ_ID *src_tz_id_out, TZ_ID *dest_tz_id_out) |
int | tz_conv_tz_datetime_w_zone_name (const DB_DATETIME *src_dt, const char *source_zone, int len_source, const char *dest_zone, int len_dest, DB_DATETIME *dest_dt) |
int | tz_explain_tz_id (const TZ_ID *tz_id, char *tzr, const int tzr_size, char *tzdst, const int tzdst_size, int *tzh, int *tzm) |
int | tz_create_datetimetz_from_offset (const DB_DATETIME *dt, const int tzh, const int tzm, DB_DATETIMETZ *dt_tz) |
int | tz_create_timestamptz_from_offset (const DB_DATE *date, const DB_TIME *time, const int tzh, const int tzm, DB_TIMESTAMPTZ *timestamp_tz) |
int | tz_get_best_match_zone (const char *name, int *size) |
int | tz_create_datetimetz_from_zoneid_and_tzd (const DB_DATETIME *dt, TZ_REGION *default_tz_region, const int zone_id, const char *tzd, const int tzd_len, bool is_time_tz, DB_DATETIMETZ *dt_tz) |
int | tz_create_timestamptz_from_zoneid_and_tzd (const DB_DATE *date, const DB_TIME *time, TZ_REGION *default_tz_region, const int zone_id, const char *tzd, const int tzd_len, DB_TIMESTAMPTZ *timestamp_tz) |
int | tz_resolve_os_timezone (char *timezone, int buf_len) |
void | tz_set_tz_region_system (const TZ_REGION *tz_region) |
TZ_REGION * | tz_get_client_tz_region_session (void) |
int | tz_timezones_start_scan (THREAD_ENTRY *thread_p, int show_type, DB_VALUE **arg_values, int arg_cnt, void **ptr) |
int | tz_full_timezones_start_scan (THREAD_ENTRY *thread_p, int show_type, DB_VALUE **arg_values, int arg_cnt, void **ptr) |
int | tz_load_with_library_path (TZ_DATA *tzd, const char *timezone_library_path) |
int | tz_check_geographic_tz (const TZ_ID *tz_id) |
int | tz_check_session_has_geographic_tz (void) |
int | put_timezone_checksum (char *checksum) |
int | check_timezone_compat (const char *client_checksum, const char *server_checksum, const char *client_text, const char *server_text) |
void | tz_tzid_convert_region_to_offset (TZ_ID *tz_id) |
int | tz_create_datetimetz_from_utc (const DB_DATETIME *src_dt, const TZ_REGION *dest_region, DB_DATETIMETZ *dest_dt_tz) |
int | tz_create_datetimetz_from_parts (const int m, const int d, const int y, const int h, const int mi, const int s, const int ms, const TZ_ID *tz_id, DB_DATETIMETZ *dt_tz) |
int | conv_tz (void *p_out, const void *p_in, DB_TYPE type) |
int | tz_get_offset_in_mins () |
Variables | |
static int | tz_Initialized = 0 |
static TZ_REGION | tz_Region_system |
static TZ_REGION | tz_Region_session |
static void * | tz_Lib_handle = NULL |
static TZ_DATA | tz_Timezone_data = { 0, NULL, 0, NULL, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, {'0'} } |
static TZ_DATA | tz_New_timezone_data = { 0, NULL, 0, NULL, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, {'0'} } |
static const int | tz_Days_of_month [] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } |
static const int | tz_Days_up_to_month [] = { 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 } |
Definition at line 90 of file tz_support.c.
Referenced by is_in_overlap_interval(), and tz_datetime_utc_conv().
#define APPLY_NEXT_OFF_RULE | ( | ) |
Definition at line 204 of file tz_support.c.
Referenced by tz_datetime_utc_conv().
#define FULL_DATE | ( | jul_date, | |
time_sec | |||
) |
Definition at line 86 of file tz_support.c.
Referenced by get_date_diff_from_ds_rule(), tz_datetime_utc_conv(), tz_fast_find_ds_rule(), and tz_get_ds_change_julian_date_diff().
#define LEN_MIN_HOUR 6 |
Referenced by tz_explain_tz_id().
#define LEN_MIN_HOUR_SEC 9 |
Referenced by tz_explain_tz_id().
#define MILLIS_IN_A_DAY (long)(86400000) /* 24L * 60L * 60L * 1000 */ |
Definition at line 95 of file tz_support.c.
Referenced by tz_datetime_utc_conv().
#define SECONDS_IN_A_DAY 24 * 3600 |
Definition at line 99 of file tz_support.c.
Referenced by tz_datetime_utc_conv().
#define strlen | ( | s1 | ) | ((int) strlen(s1)) |
Definition at line 53 of file tz_support.c.
Referenced by set_new_zone_id(), tz_explain_tz_id(), tz_get_best_match_zone(), tz_get_zone_id_by_name(), tz_resolve_os_timezone(), and tz_zone_info_to_str().
#define TIME_OFFSET | ( | is_utc, | |
offset | |||
) | ((is_utc) ? (-offset) : (offset)) |
Definition at line 88 of file tz_support.c.
Referenced by tz_datetime_utc_conv().
#define TZ_BIT_SHIFT_TZ_ID_FLAG 30 |
Definition at line 97 of file tz_support.c.
Referenced by tz_decode_tz_id(), and tz_tzid_convert_region_to_offset().
#define TZ_GET_SYM_ADDR | ( | lib, | |
sym | |||
) | dlsym(lib, sym) |
Definition at line 183 of file tz_support.c.
#define TZ_INVALID_OFFSET ((((23 * 60) + 59) * 60) + 59) |
Definition at line 92 of file tz_support.c.
Referenced by tz_datetime_utc_conv(), tz_explain_tz_id(), tz_get_invalid_tz_region(), tz_utc_datetimetz_to_local(), and tz_zone_info_to_str().
#define TZ_MASK_TZ_ID_FLAG 0xc0000000 |
Definition at line 96 of file tz_support.c.
Referenced by tz_decode_tz_id(), and tz_tzid_convert_region_to_offset().
#define TZ_MAX_OFFSET 14 * 3600 |
Definition at line 94 of file tz_support.c.
Referenced by tz_create_datetimetz_from_offset(), tz_create_timestamptz_from_offset(), tz_explain_tz_id(), tz_str_to_seconds(), and tz_zone_info_to_str().
#define TZ_MIN_OFFSET -12 * 3600 |
Definition at line 93 of file tz_support.c.
Referenced by tz_create_datetimetz_from_offset(), tz_create_timestamptz_from_offset(), tz_str_to_seconds(), and tz_zone_info_to_str().
#define TZ_OFFSET_MASK 0x3fffffff |
Definition at line 98 of file tz_support.c.
Referenced by tz_decode_tz_id(), and tz_encode_tz_id().
#define TZLIB_GET_ADDR | ( | v, | |
SYM_NAME, | |||
SYM_TYPE, | |||
lh | |||
) |
Definition at line 186 of file tz_support.c.
Referenced by tz_load_data_from_lib().
#define TZLIB_GET_VAL | ( | v, | |
SYM_NAME, | |||
SYM_TYPE, | |||
lh | |||
) |
Definition at line 197 of file tz_support.c.
Referenced by tz_load_data_from_lib().
typedef enum ds_search_direction DS_SEARCH_DIRECTION |
Definition at line 83 of file tz_support.c.
typedef struct tz_decode_info TZ_DECODE_INFO |
Definition at line 56 of file tz_support.c.
enum ds_search_direction |
Enumerator | |
---|---|
FORWARD | |
BACKWARD |
Definition at line 78 of file tz_support.c.
int check_timezone_compat | ( | const char * | client_checksum, |
const char * | server_checksum, | ||
const char * | client_text, | ||
const char * | server_text | ||
) |
Definition at line 5043 of file tz_support.c.
References ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, er_set(), ER_TZ_INCOMPATIBLE_TIMEZONE_LIBRARIES, NO_ERROR, and NULL.
Referenced by boot_restart_server(), and boot_set_server_session_key().
Definition at line 5209 of file tz_support.c.
References ARG_FILE_LINE, assert, db_datetime::date, db_datetimetz::datetime, db_timestamp_decode_w_tz_id(), db_timestamp_encode_utc(), DB_TYPE_DATETIMELTZ, DB_TYPE_DATETIMETZ, DB_TYPE_TIMESTAMPLTZ, DB_TYPE_TIMESTAMPTZ, ER_ERROR_SEVERITY, er_set(), NO_ERROR, set_new_zone_id(), db_datetime::time, db_timestamptz::timestamp, tz_decode_info::type, tz_create_session_tzid_for_datetime(), tz_create_session_tzid_for_timestamp(), tz_datetime_utc_conv(), tz_decode_tz_id(), tz_encode_tz_id(), db_timestamptz::tz_id, db_datetimetz::tz_id, TZ_REGION_OFFSET, tz_set_data(), tz_Timezone_data, tz_utc_datetimetz_to_local(), and tz_decode_info::zone.
Referenced by db_conv_tz().
|
static |
Definition at line 2648 of file tz_support.c.
References tz_ds_ruleset::count, tz_data::ds_rules, FORWARD, get_date_diff_from_ds_rule(), tz_ds_ruleset::index_start, NO_ERROR, and tz_ds_rule::save_time.
Referenced by tz_datetime_utc_conv().
|
static |
Definition at line 2601 of file tz_support.c.
References tz_ds_rule::at_time, FORWARD, tz_ds_rule::from_year, FULL_DATE, NO_ERROR, NULL, tz_ds_rule::to_year, and tz_get_ds_change_julian_date_diff().
Referenced by get_closest_ds_rule().
|
static |
Definition at line 2692 of file tz_support.c.
References assert, tz_data::ds_rule_count, tz_data::ds_rules, tz_offset_rule::ds_ruleset, tz_data::ds_rulesets, tz_offset_rule::ds_type, DS_TYPE_RULESET_ID, tz_ds_ruleset::index_start, tz_offset_rule::julian_date, julian_decode(), NO_ERROR, NULL, tz_ds_rule::save_time, and tz_fast_find_ds_rule().
Referenced by tz_datetime_utc_conv().
|
static |
Definition at line 2777 of file tz_support.c.
References tz_ds_rule::from_year.
Referenced by tz_datetime_utc_conv(), and tz_fast_find_ds_rule().
|
static |
Definition at line 2744 of file tz_support.c.
References ABS, TZ_TIME_TYPE_LOCAL_STD, and TZ_TIME_TYPE_UTC.
Referenced by tz_datetime_utc_conv().
int put_timezone_checksum | ( | char * | checksum | ) |
Definition at line 5017 of file tz_support.c.
References AU_DISABLE, AU_ENABLE, Au_root, db_make_string(), db_put_internal(), and NO_ERROR.
Referenced by createdb(), and gen_tz().
|
static |
Definition at line 5177 of file tz_support.c.
References ER_TZ_INVALID_TIMEZONE, tz_name::name, tz_data::names, NO_ERROR, NULL, strlen, tz_get_new_timezone_data(), tz_get_zone_id_by_name(), tz_set_data(), and tz_decode_info::zone.
Referenced by conv_tz().
Definition at line 4349 of file tz_support.c.
References assert, error(), NULL, p, tz_get_data(), and tz_decode_info::zone.
Referenced by tz_get_best_match_zone().
|
static |
Definition at line 2499 of file tz_support.c.
References tz_ds_rule::letter_abbrev, NULL, tz_offset_rule::save_format, tz_ds_rule::save_time, tz_offset_rule::std_format, TZ_MAX_FORMAT_SIZE, and tz_offset_rule::var_format.
Referenced by tz_datetime_utc_conv().
Definition at line 4975 of file tz_support.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, er_set(), ER_TZ_GEOGRAPHIC_ZONE, NO_ERROR, tz_decode_info::type, tz_decode_tz_id(), and TZ_REGION_ZONE.
int tz_check_session_has_geographic_tz | ( | void | ) |
Definition at line 4995 of file tz_support.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, er_set(), ER_TZ_GEOGRAPHIC_ZONE, NO_ERROR, tz_region::type, tz_get_session_tz_region(), and TZ_REGION_OFFSET.
int tz_conv_tz_datetime_w_region | ( | const DB_DATETIME * | src_dt, |
const TZ_REGION * | src_tz_region, | ||
const TZ_REGION * | dest_tz_region, | ||
DB_DATETIME * | dest_dt, | ||
TZ_ID * | src_tz_id_out, | ||
TZ_ID * | dest_tz_id_out | ||
) |
Definition at line 3812 of file tz_support.c.
References assert, NO_ERROR, NULL, tz_conv_tz_datetime_w_zone_info(), tz_decode_tz_region(), tz_encode_tz_id(), and TZ_REGION_OFFSET.
Referenced by db_timestamp_decode_w_reg(), db_timestamp_encode_w_reg(), do_evaluate_default_expr(), fetch_peek_arith(), pt_evaluate_db_value_expr(), qexec_execute_insert(), tz_conv_tz_datetime_w_zone_name(), and tz_conv_tz_time_w_zone_name().
|
static |
Definition at line 3730 of file tz_support.c.
References assert, NO_ERROR, NULL, tz_decode_info::offset, tz_decode_info::type, tz_datetime_utc_conv(), TZ_IS_ZONE_VALID_DECODE_INFO, TZ_REGION_OFFSET, TZ_REGION_ZONE, and tz_decode_info::zone.
Referenced by tz_conv_tz_datetime_w_region().
int tz_conv_tz_datetime_w_zone_name | ( | const DB_DATETIME * | src_dt, |
const char * | source_zone, | ||
int | len_source, | ||
const char * | dest_zone, | ||
int | len_dest, | ||
DB_DATETIME * | dest_dt | ||
) |
Definition at line 3858 of file tz_support.c.
References NO_ERROR, NULL, tz_conv_tz_datetime_w_region(), and tz_str_to_region().
Referenced by db_new_time().
int tz_conv_tz_time_w_zone_name | ( | const DB_TIME * | time_source, |
const char * | source_zone, | ||
int | len_source, | ||
const char * | dest_zone, | ||
int | len_dest, | ||
DB_TIME * | time_dest | ||
) |
Definition at line 1528 of file tz_support.c.
References db_datetime::date, NO_ERROR, NULL, db_datetime::time, tz_conv_tz_datetime_w_region(), tz_get_current_date(), and tz_str_to_region().
Referenced by db_new_time(), do_evaluate_default_expr(), fetch_peek_arith(), pt_evaluate_db_value_expr(), and qexec_execute_insert().
int tz_create_datetimetz | ( | const DB_DATETIME * | dt, |
const char * | tz_str, | ||
const int | tz_size, | ||
const TZ_REGION * | default_tz_region, | ||
DB_DATETIMETZ * | dt_tz, | ||
const char ** | end_tz_str | ||
) |
Definition at line 1383 of file tz_support.c.
References db_datetimetz::datetime, NO_ERROR, NULL, tz_datetime_utc_conv(), tz_decode_tz_region(), tz_encode_tz_id(), db_datetimetz::tz_id, and tz_str_timezone_decode().
Referenced by db_date_add_sub_interval_expr(), db_from_tz(), db_string_to_datetimetz_ex(), and netval_to_dbval().
int tz_create_datetimetz_from_offset | ( | const DB_DATETIME * | dt, |
const int | tzh, | ||
const int | tzm, | ||
DB_DATETIMETZ * | dt_tz | ||
) |
Definition at line 4068 of file tz_support.c.
References ARG_FILE_LINE, db_datetimetz::datetime, ER_DATE_CONVERSION, ER_ERROR_SEVERITY, er_set(), NO_ERROR, tz_decode_info::offset, tz_decode_info::type, tz_datetime_utc_conv(), tz_encode_tz_id(), db_datetimetz::tz_id, TZ_MAX_OFFSET, TZ_MIN_OFFSET, and TZ_REGION_OFFSET.
Referenced by db_str_to_date(), and db_to_datetime().
int tz_create_datetimetz_from_parts | ( | const int | m, |
const int | d, | ||
const int | y, | ||
const int | h, | ||
const int | mi, | ||
const int | s, | ||
const int | ms, | ||
const TZ_ID * | tz_id, | ||
DB_DATETIMETZ * | dt_tz | ||
) |
Definition at line 5138 of file tz_support.c.
References db_datetimetz::datetime, db_datetime_encode(), NO_ERROR, NULL, tz_create_datetimetz_from_utc(), tz_datetimetz_fix_zone(), tz_get_session_tz_region(), and db_datetimetz::tz_id.
Referenced by db_add_time(), db_date_add_sub_interval_days(), and db_date_add_sub_interval_expr().
int tz_create_datetimetz_from_ses | ( | const DB_DATETIME * | dt, |
DB_DATETIMETZ * | dt_tz | ||
) |
Definition at line 1493 of file tz_support.c.
References db_datetimetz::datetime, NO_ERROR, tz_datetime_utc_conv(), tz_decode_tz_region(), tz_encode_tz_id(), tz_get_session_tz_region(), and db_datetimetz::tz_id.
Referenced by db_date_add_sub_interval_expr(), qdata_subtract_datetime_to_dbval(), tp_value_cast_internal(), and tp_value_coerce_strict().
int tz_create_datetimetz_from_utc | ( | const DB_DATETIME * | src_dt, |
const TZ_REGION * | dest_region, | ||
DB_DATETIMETZ * | dest_dt_tz | ||
) |
Definition at line 5104 of file tz_support.c.
References db_datetimetz::datetime, NO_ERROR, tz_datetime_utc_conv(), tz_decode_tz_region(), tz_encode_tz_id(), and db_datetimetz::tz_id.
Referenced by tz_create_datetimetz_from_parts().
int tz_create_datetimetz_from_zoneid_and_tzd | ( | const DB_DATETIME * | dt, |
TZ_REGION * | default_tz_region, | ||
const int | zone_id, | ||
const char * | tzd, | ||
const int | tzd_len, | ||
bool | is_time_tz, | ||
DB_DATETIMETZ * | dt_tz | ||
) |
Definition at line 4212 of file tz_support.c.
References ARG_FILE_LINE, db_datetime::date, db_datetimetz::datetime, ER_ERROR_SEVERITY, er_set(), ER_TZ_INVALID_DST, NO_ERROR, NULL, tz_decode_info::offset, db_datetime::time, tz_decode_info::type, tz_datetime_utc_conv(), tz_decode_tz_region(), TZ_DS_ID_MAX, tz_encode_tz_id(), db_datetimetz::tz_id, TZ_OFFSET_ID_MAX, TZ_REGION_OFFSET, TZ_REGION_ZONE, tz_decode_info::zone, and tz_decode_info::zone_id.
Referenced by db_str_to_date(), and db_to_datetime().
int tz_create_session_tzid_for_datetime | ( | const DB_DATETIME * | src_dt, |
bool | src_is_utc, | ||
TZ_ID * | tz_id | ||
) |
Definition at line 1037 of file tz_support.c.
References NO_ERROR, tz_datetime_utc_conv(), tz_decode_tz_region(), tz_encode_tz_id(), and tz_get_session_tz_region().
Referenced by conv_tz(), date_to_char(), db_date_format(), db_datetimeltz_to_string(), db_time_format(), dbval_to_net_buf(), qdata_subtract_dbval(), tp_value_cast_internal(), tp_value_coerce_strict(), tz_create_session_tzid_for_time(), tz_create_session_tzid_for_timestamp(), tz_datetimeltz_to_local(), and valcnv_convert_data_to_string().
Definition at line 1091 of file tz_support.c.
References db_datetime::date, db_datetime::time, tz_create_session_tzid_for_datetime(), and tz_get_current_date().
Referenced by date_to_char(), and db_time_format().
Definition at line 1068 of file tz_support.c.
References db_datetime::date, db_timestamp_decode_utc(), db_datetime::time, and tz_create_session_tzid_for_datetime().
Referenced by conv_tz(), date_to_char(), db_date_format(), db_time_format(), db_timestampltz_to_string(), dbval_to_net_buf(), qdata_add_bigint_to_dbval(), qdata_add_dbval(), qdata_add_int_to_dbval(), qdata_add_short_to_dbval(), tp_value_cast_internal(), tp_value_coerce_strict(), and valcnv_convert_data_to_string().
int tz_create_timestamptz | ( | const DB_DATE * | date, |
const DB_TIME * | time, | ||
const char * | tz_str, | ||
const int | tz_size, | ||
const TZ_REGION * | default_tz_region, | ||
DB_TIMESTAMPTZ * | ts_tz, | ||
const char ** | end_tz_str | ||
) |
Definition at line 1435 of file tz_support.c.
References db_datetime::date, db_timestamp_encode_utc(), NO_ERROR, NULL, db_datetime::time, db_timestamptz::timestamp, tz_datetime_utc_conv(), tz_decode_tz_region(), tz_encode_tz_id(), db_timestamptz::tz_id, and tz_str_timezone_decode().
Referenced by db_string_to_timestamptz_ex(), and netval_to_dbval().
int tz_create_timestamptz_from_offset | ( | const DB_DATE * | date, |
const DB_TIME * | time, | ||
const int | tzh, | ||
const int | tzm, | ||
DB_TIMESTAMPTZ * | timestamp_tz | ||
) |
Definition at line 4107 of file tz_support.c.
References ARG_FILE_LINE, db_datetime::date, db_timestamp_encode_utc(), ER_DATE_CONVERSION, ER_ERROR_SEVERITY, er_set(), NO_ERROR, tz_decode_info::offset, db_datetime::time, db_timestamptz::timestamp, tz_decode_info::type, tz_datetime_utc_conv(), tz_encode_tz_id(), db_timestamptz::tz_id, TZ_MAX_OFFSET, TZ_MIN_OFFSET, and TZ_REGION_OFFSET.
Referenced by db_to_timestamp().
int tz_create_timestamptz_from_zoneid_and_tzd | ( | const DB_DATE * | date, |
const DB_TIME * | time, | ||
TZ_REGION * | default_tz_region, | ||
const int | zone_id, | ||
const char * | tzd, | ||
const int | tzd_len, | ||
DB_TIMESTAMPTZ * | timestamp_tz | ||
) |
Definition at line 4280 of file tz_support.c.
References ARG_FILE_LINE, db_datetime::date, db_timestamp_encode_utc(), ER_ERROR_SEVERITY, er_set(), ER_TZ_INVALID_DST, NO_ERROR, NULL, db_datetime::time, db_timestamptz::timestamp, tz_decode_info::type, tz_datetime_utc_conv(), tz_decode_tz_region(), TZ_DS_ID_MAX, tz_encode_tz_id(), db_timestamptz::tz_id, TZ_OFFSET_ID_MAX, TZ_REGION_ZONE, tz_decode_info::zone, and tz_decode_info::zone_id.
Referenced by db_to_timestamp().
|
static |
Definition at line 2815 of file tz_support.c.
References ABS, APPLY_NEXT_OFF_RULE, ARG_FILE_LINE, assert, tz_ds_rule::at_time, tz_ds_rule::at_time_type, BACKWARD, BO_IS_SERVER_RESTARTED, tz_ds_ruleset::count, db_datetime::date, DATE_DIFF_MATCH_SAFE_THRESHOLD_DAYS, DATE_DIFF_MATCH_SAFE_THRESHOLD_SEC, db_add_int_to_datetime(), tz_ds_ruleset::default_abrev, diff, tz_data::ds_rule_count, tz_data::ds_rules, tz_offset_rule::ds_ruleset, tz_data::ds_ruleset_count, tz_data::ds_rulesets, tz_offset_rule::ds_type, DS_TYPE_FIXED, DS_TYPE_RULESET_ID, ER_ERROR_SEVERITY, er_set(), ER_TIME_CONVERSION, ER_TZ_DURING_DS_LEAP, ER_TZ_DURING_OFFSET_RULE_LEAP, ER_TZ_INTERNAL_ERROR, ER_TZ_INVALID_COMBINATION, ER_TZ_INVALID_DST, FORWARD, tz_ds_rule::from_year, FULL_DATE, get_closest_ds_rule(), get_saving_time_from_offset_rule(), get_year_to_apply_rule(), tz_offset_rule::gmt_off, tz_timezone::gmt_off_rule_count, tz_timezone::gmt_off_rule_start, tz_ds_rule::in_month, tz_ds_ruleset::index_start, is_in_overlap_interval(), tz_offset_rule::julian_date, julian_decode(), MILLIS_IN_A_DAY, tz_data::name_count, tz_data::names, NO_ERROR, NULL, tz_decode_info::offset, tz_data::offset_rule_count, tz_data::offset_rules, tz_offset_rule::save_format, tz_ds_rule::save_time, SECONDS_IN_A_DAY, tz_offset_rule::std_format, db_datetime::time, TIME_OFFSET, tz_data::timezones, tz_ds_rule::to_year, tz_ds_ruleset::to_year_max, tz_decode_info::type, tz_check_ds_match_string(), tz_fast_find_ds_rule(), tz_get_data(), tz_get_ds_change_julian_date_diff(), TZ_INVALID_OFFSET, TZ_MAX_JULIAN_DATE, TZ_MON_DEC, TZ_MON_JAN, tz_offset(), TZ_REGION_OFFSET, TZ_REGION_ZONE, TZ_TIME_TYPE_LOCAL_STD, TZ_TIME_TYPE_LOCAL_WALL, TZ_TIME_TYPE_UTC, UNTIL_EXPLICIT, tz_offset_rule::until_flag, tz_offset_rule::until_hour, UNTIL_INFINITE, tz_offset_rule::until_min, tz_offset_rule::until_sec, tz_offset_rule::until_time_type, tz_offset_rule::var_format, tz_decode_info::zone, and tz_name::zone_id.
Referenced by conv_tz(), tz_conv_tz_datetime_w_zone_info(), tz_create_datetimetz(), tz_create_datetimetz_from_offset(), tz_create_datetimetz_from_ses(), tz_create_datetimetz_from_utc(), tz_create_datetimetz_from_zoneid_and_tzd(), tz_create_session_tzid_for_datetime(), tz_create_timestamptz(), tz_create_timestamptz_from_offset(), tz_create_timestamptz_from_zoneid_and_tzd(), tz_datetimetz_fix_zone(), tz_full_timezones_start_scan(), and tz_get_timezone_offset().
int tz_datetimeltz_to_local | ( | const DB_DATETIME * | dt_ltz, |
DB_DATETIME * | dt_local | ||
) |
Definition at line 1628 of file tz_support.c.
References error(), NO_ERROR, tz_create_session_tzid_for_datetime(), and tz_utc_datetimetz_to_local().
Referenced by db_add_time(), db_get_datetime_from_dbvalue(), db_get_time_from_dbvalue(), db_string_extract_dbval(), db_trunc_dbval(), qdata_subtract_int_to_dbval(), round_date(), and tp_value_cast_internal().
int tz_datetimetz_fix_zone | ( | const DB_DATETIMETZ * | src_dt_tz, |
DB_DATETIMETZ * | dest_dt_tz | ||
) |
Definition at line 1815 of file tz_support.c.
References db_datetimetz::datetime, NO_ERROR, tz_datetime_utc_conv(), tz_decode_tz_id(), tz_encode_tz_id(), and db_datetimetz::tz_id.
Referenced by pt_evaluate_db_value_expr(), qdata_add_datetimetz_to_dbval(), qdata_interpolation_function_values(), qdata_subtract_datetimetz_to_dbval(), tz_create_datetimetz_from_parts(), and tz_timestamptz_fix_zone().
|
static |
Definition at line 1957 of file tz_support.c.
References assert, cubregex::count(), tz_data::ds_rules, tz_offset_rule::ds_ruleset, tz_data::ds_rulesets, tz_offset_rule::ds_type, DS_TYPE_RULESET_ID, tz_decode_info::dst_id, tz_timezone::gmt_off_rule_start, tz_ds_ruleset::index_start, tz_ds_rule::letter_abbrev, tz_data::names, NULL, tz_decode_info::offset, tz_data::offset_rules, tz_data::timezones, tz_decode_info::type, TZ_BIT_SHIFT_TZ_ID_FLAG, TZ_DS_ID_MAX, tz_get_data(), TZ_MASK_TZ_ID_FLAG, TZ_OFFSET_ID_MAX, TZ_OFFSET_MASK, TZ_REGION_OFFSET, TZ_REGION_ZONE, TZ_ZONE_ID_MAX, tz_offset_rule::var_format, tz_decode_info::zone, tz_decode_info::zone_id, and tz_name::zone_id.
Referenced by conv_tz(), tz_check_geographic_tz(), tz_datetimetz_fix_zone(), tz_explain_tz_id(), tz_id_to_region(), tz_id_to_str(), tz_tzid_convert_region_to_offset(), and tz_utc_datetimetz_to_local().
|
static |
Definition at line 2053 of file tz_support.c.
References NULL, tz_decode_info::offset, tz_region::offset, tz_decode_info::type, tz_region::type, TZ_DS_ID_MAX, TZ_OFFSET_ID_MAX, TZ_REGION_OFFSET, tz_decode_info::zone, and tz_region::zone_id.
Referenced by tz_conv_tz_datetime_w_region(), tz_create_datetimetz(), tz_create_datetimetz_from_ses(), tz_create_datetimetz_from_utc(), tz_create_datetimetz_from_zoneid_and_tzd(), tz_create_session_tzid_for_datetime(), tz_create_timestamptz(), and tz_create_timestamptz_from_zoneid_and_tzd().
|
static |
Definition at line 1891 of file tz_support.c.
References tz_decode_info::dst_id, tz_decode_info::offset, tz_decode_info::offset_id, tz_decode_info::type, TZ_DS_ID_MAX, TZ_OFFSET_ID_MAX, TZ_OFFSET_MASK, TZ_REGION_OFFSET, TZ_ZONE_ID_MAX, tz_decode_info::zone, and tz_decode_info::zone_id.
Referenced by conv_tz(), tz_conv_tz_datetime_w_region(), tz_create_datetimetz(), tz_create_datetimetz_from_offset(), tz_create_datetimetz_from_ses(), tz_create_datetimetz_from_utc(), tz_create_datetimetz_from_zoneid_and_tzd(), tz_create_session_tzid_for_datetime(), tz_create_timestamptz(), tz_create_timestamptz_from_offset(), tz_create_timestamptz_from_zoneid_and_tzd(), tz_datetimetz_fix_zone(), and tz_tzid_convert_region_to_offset().
|
static |
Definition at line 1932 of file tz_support.c.
References assert, tz_decode_info::offset, tz_region::offset, tz_decode_info::type, tz_region::type, TZ_REGION_OFFSET, TZ_ZONE_ID_MAX, tz_decode_info::zone, and tz_region::zone_id.
Referenced by tz_id_to_region().
int tz_explain_tz_id | ( | const TZ_ID * | tz_id, |
char * | tzr, | ||
const int | tzr_size, | ||
char * | tzdst, | ||
const int | tzdst_size, | ||
int * | tzh, | ||
int * | tzm | ||
) |
Definition at line 3893 of file tz_support.c.
References ARG_FILE_LINE, assert, BO_IS_SERVER_RESTARTED, cubregex::count(), db_time_decode(), tz_data::ds_rules, tz_offset_rule::ds_ruleset, tz_data::ds_rulesets, tz_offset_rule::ds_type, DS_TYPE_RULESET_ID, tz_decode_info::dst_id, ER_DATE_CONVERSION, ER_ERROR_SEVERITY, ER_FAILED, er_set(), ER_TZ_INTERNAL_ERROR, ER_TZ_LOAD_ERROR, tz_timezone::gmt_off_rule_start, tz_ds_ruleset::index_start, LEN_MIN_HOUR, LEN_MIN_HOUR_SEC, tz_ds_rule::letter_abbrev, min, tz_name::name, tz_data::names, NO_ERROR, NULL, tz_decode_info::offset, tz_data::offset_rules, tz_offset_rule::save_format, tz_ds_rule::save_time, tz_offset_rule::std_format, strlen, tz_data::timezones, tz_decode_info::type, tz_decode_tz_id(), tz_get_data(), TZ_INVALID_OFFSET, TZ_MAX_FORMAT_SIZE, TZ_MAX_OFFSET, TZ_REGION_OFFSET, tz_offset_rule::var_format, tz_decode_info::zone, tz_decode_info::zone_id, and tz_name::zone_id.
Referenced by date_to_char(), db_date_format(), and db_time_format().
|
static |
Definition at line 2388 of file tz_support.c.
References assert, tz_ds_rule::at_time, tz_ds_ruleset::count, DATE_DIFF_MATCH_SAFE_THRESHOLD_SEC, diff, tz_data::ds_rule_count, tz_data::ds_rules, tz_ds_rule::from_year, FULL_DATE, get_year_to_apply_rule(), tz_ds_rule::in_month, tz_ds_ruleset::index_start, NO_ERROR, NULL, tz_ds_rule::to_year, tz_ds_ruleset::to_year_max, tz_get_ds_change_julian_date_diff(), TZ_MON_DEC, and TZ_MON_JAN.
Referenced by get_saving_time_from_offset_rule(), and tz_datetime_utc_conv().
int tz_full_timezones_start_scan | ( | THREAD_ENTRY * | thread_p, |
int | show_type, | ||
DB_VALUE ** | arg_values, | ||
int | arg_cnt, | ||
void ** | ptr | ||
) |
Definition at line 4775 of file tz_support.c.
References db_datetime_encode(), db_make_null(), db_make_string(), db_make_string_copy(), tz_data::ds_rules, tz_offset_rule::ds_ruleset, tz_data::ds_rulesets, tz_offset_rule::ds_type, DS_TYPE_RULESET_ID, tz_decode_info::dst_id, er_errid(), error(), tz_offset_rule::gmt_off, tz_timezone::gmt_off_rule_start, i, tz_ds_ruleset::index_start, tz_ds_rule::letter_abbrev, MAX_LEN_OFFSET, tz_name::name, tz_data::name_count, tz_data::names, NO_ERROR, NULL, tz_data::offset_rules, tz_offset_rule::save_format, tz_ds_rule::save_time, showstmt_alloc_array_context(), showstmt_alloc_tuple_in_context(), showstmt_free_array_context(), tz_offset_rule::std_format, tz_data::timezones, tz_decode_info::type, tz_datetime_utc_conv(), TZ_DS_ID_MAX, tz_get_data(), TZ_MAX_FORMAT_SIZE, tz_print_tz_offset(), TZ_REGION_ZONE, tz_timestamp_decode_no_leap_sec(), tz_offset_rule::var_format, tz_decode_info::zone, tz_decode_info::zone_id, and tz_name::zone_id.
Referenced by showstmt_scan_init().
int tz_get_best_match_zone | ( | const char * | name, |
int * | size | ||
) |
Definition at line 4157 of file tz_support.c.
References assert, tz_name::name, tz_data::name_count, tz_data::names, NULL, starts_with(), strlen, and tz_get_data().
Referenced by db_str_to_date(), db_to_datetime(), db_to_time(), and db_to_timestamp().
TZ_REGION* tz_get_client_tz_region_session | ( | void | ) |
Definition at line 4662 of file tz_support.c.
References cubthread::manager::find_by_tid(), NULL, session_get_session_tz_region(), thread_get_manager(), thread_get_thread_entry_info(), TT_VACUUM_WORKER, tz_Region_session, and tz_Region_system.
Referenced by prm_load_by_section(), sysprm_set_value(), and tz_get_session_tz_region().
|
static |
Definition at line 852 of file tz_support.c.
References db_datetime::date, db_datetime_encode(), and NULL.
Referenced by tz_conv_tz_time_w_zone_name(), and tz_create_session_tzid_for_time().
Definition at line 687 of file tz_support.c.
References NULL, tz_data::timezone_count, and tz_Timezone_data.
Referenced by boot_restart_server(), boot_set_server_session_key(), createdb(), dump_tz(), sboot_get_timezone_checksum(), starts_with(), sysprm_final(), tz_datetime_utc_conv(), tz_decode_tz_id(), tz_explain_tz_id(), tz_full_timezones_start_scan(), tz_get_best_match_zone(), tz_get_zone_id_by_name(), tz_resolve_os_timezone(), tz_timestamp_decode_leap_sec_adj(), tz_timestamp_encode_leap_sec_adj(), tz_timezones_start_scan(), and tz_zone_info_to_str().
int tz_get_ds_change_julian_date_diff | ( | const int | src_julian_date, |
const TZ_DS_RULE * | ds_rule, | ||
const int | year, | ||
int * | ds_rule_julian_date, | ||
full_date_t * | date_diff | ||
) |
Definition at line 2333 of file tz_support.c.
References ARG_FILE_LINE, tz_ds_rule::change_on, tz_ds_change_on::day_of_month, tz_ds_change_on::day_of_week, ER_ERROR_SEVERITY, er_set(), ER_TZ_INTERNAL_ERROR, FULL_DATE, tz_ds_rule::in_month, IS_LEAP_YEAR, julian_encode(), NO_ERROR, NULL, tz_ds_change_on::type, TZ_DS_TYPE_FIXED, TZ_DS_TYPE_VAR_SMALLER, tz_get_first_weekday_around_date(), and TZ_MON_FEB.
Referenced by get_date_diff_from_ds_rule(), tz_datetime_utc_conv(), tz_fast_find_ds_rule(), and tzc_check_ds_ruleset().
int tz_get_first_weekday_around_date | ( | const int | year, |
const int | month, | ||
const int | weekday, | ||
const int | ref_day, | ||
const bool | before | ||
) |
Definition at line 2085 of file tz_support.c.
References assert, DAYS_IN_MONTH, db_get_day_of_week(), IS_LEAP_YEAR, TZ_MON_FEB, TZ_WEEK_DAY_COUNT, TZ_WEEK_DAY_SAT, and TZ_WEEK_DAY_SUN.
Referenced by get_day_of_week_for_raw_rule(), str_to_offset_rule_until(), and tz_get_ds_change_julian_date_diff().
Definition at line 840 of file tz_support.c.
References TZ_INVALID_OFFSET, and TZ_REGION_OFFSET.
Referenced by tz_get_session_tz_region().
|
static |
Definition at line 402 of file tz_support.c.
References prm_get_bool_value(), and PRM_ID_TZ_LEAP_SECOND_SUPPORT.
Referenced by tz_timestamp_decode_sec(), and tz_timestamp_encode_leap_sec_adj().
Definition at line 713 of file tz_support.c.
References NULL, tz_data::timezone_count, and tz_New_timezone_data.
Referenced by set_new_zone_id().
int tz_get_offset_in_mins | ( | ) |
Definition at line 5480 of file tz_support.c.
Referenced by db_sys_timezone().
const char* tz_get_session_local_timezone | ( | void | ) |
Definition at line 739 of file tz_support.c.
References prm_get_string_value(), and PRM_ID_TIMEZONE.
Referenced by do_evaluate_default_expr(), fetch_peek_arith(), pt_evaluate_db_value_expr(), and qexec_execute_insert().
void tz_get_session_tz_region | ( | TZ_REGION * | tz_region | ) |
Definition at line 767 of file tz_support.c.
References BO_IS_SERVER_RESTARTED, NULL, tz_get_client_tz_region_session(), tz_get_invalid_tz_region(), and tz_Region_system.
Referenced by db_str_to_date(), db_string_to_datetimetz_ex(), db_string_to_timestamptz_ex(), db_timestamp_decode_ses(), db_timestamp_encode_ses(), db_to_datetime(), db_to_timestamp(), do_evaluate_default_expr(), fetch_peek_arith(), netval_to_dbval(), pt_evaluate_db_value_expr(), qexec_execute_insert(), tz_check_session_has_geographic_tz(), tz_create_datetimetz_from_parts(), tz_create_datetimetz_from_ses(), and tz_create_session_tzid_for_datetime().
const char* tz_get_system_timezone | ( | void | ) |
Definition at line 749 of file tz_support.c.
References prm_get_string_value(), and PRM_ID_SERVER_TIMEZONE.
Referenced by do_evaluate_default_expr(), fetch_peek_arith(), pt_evaluate_db_value_expr(), qexec_execute_insert(), and sysprm_make_default_values().
void tz_get_system_tz_region | ( | TZ_REGION * | tz_region | ) |
Definition at line 758 of file tz_support.c.
References tz_Region_system.
Referenced by db_timestamp_encode_sys(), do_evaluate_default_expr(), fetch_peek_arith(), pt_evaluate_db_value_expr(), and qexec_execute_insert().
int tz_get_timezone_offset | ( | const char * | tz_str, |
int | tz_size, | ||
char * | result, | ||
DB_DATETIME * | utc_datetime | ||
) |
Definition at line 935 of file tz_support.c.
References ARG_FILE_LINE, CAST_BUFLEN, char_isspace(), db_datetime::date, ER_ERROR_SEVERITY, er_set(), ER_TZ_INVALID_TIMEZONE, error(), NO_ERROR, p, db_datetime::time, tz_decode_info::type, tz_datetime_utc_conv(), tz_get_zone_id_by_name(), tz_print_tz_offset(), TZ_REGION_ZONE, tz_str_to_seconds(), tz_decode_info::zone, and tz_decode_info::zone_id.
Referenced by db_tz_offset().
Definition at line 816 of file tz_support.c.
Referenced by db_timestamp_encode_w_reg(), db_value_domain_default(), db_value_domain_max(), db_value_domain_min(), and tp_value_coerce_strict().
Definition at line 828 of file tz_support.c.
References TZ_REGION_OFFSET.
Referenced by db_timestamp_decode_w_reg(), and db_timestamp_encode_w_reg().
Definition at line 1109 of file tz_support.c.
References assert, tz_name::name, tz_data::name_count, tz_data::names, NULL, strlen, and tz_get_data().
Referenced by set_new_zone_id(), tz_get_timezone_offset(), tz_resolve_os_timezone(), tz_str_timezone_decode(), and tz_str_to_region().
Definition at line 803 of file tz_support.c.
References tz_decode_tz_id(), and tz_encode_tz_region().
Referenced by db_date_add_sub_interval_expr().
Definition at line 1789 of file tz_support.c.
References tz_decode_tz_id(), and tz_zone_info_to_str().
Referenced by db_datetimetz_to_string(), db_timestamptz_to_string(), and dbval_to_net_buf().
int tz_load | ( | void | ) |
Definition at line 337 of file tz_support.c.
References ARG_FILE_LINE, envvar_libdir_file(), er_errid(), ER_ERROR_SEVERITY, er_set(), ER_TZ_LOAD_ERROR, LIB_TZ_NAME, NO_ERROR, tz_Initialized, tz_Lib_handle, tz_load_data_from_lib(), and tz_load_library().
Referenced by boot_restart_client(), boot_restart_server(), createdb(), dump_tz(), net_server_start(), prm_load_by_section(), xboot_initialize_server(), and xboot_restart_from_backup().
|
static |
Definition at line 281 of file tz_support.c.
References ARG_FILE_LINE, assert, tz_data::checksum, tz_data::countries, tz_data::country_count, tz_data::ds_leap_sec, tz_data::ds_leap_sec_count, tz_data::ds_rule_count, tz_data::ds_rules, tz_data::ds_ruleset_count, tz_data::ds_rulesets, ER_ERROR_SEVERITY, er_set(), ER_TZ_LOAD_ERROR, tz_data::name_count, tz_data::names, NO_ERROR, NULL, tz_data::offset_rule_count, tz_data::offset_rules, tz_data::timezone_count, tz_data::timezone_names, tz_data::timezones, TZLIB_GET_ADDR, TZLIB_GET_VAL, and TZLIB_SYMBOL_NAME_SIZE.
Referenced by tz_load(), and tz_load_with_library_path().
|
static |
Definition at line 220 of file tz_support.c.
References ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, er_set(), ER_TZ_LOAD_ERROR, error(), NO_ERROR, NULL, and snprintf_dots_truncate.
Referenced by tz_load(), and tz_load_with_library_path().
Definition at line 4937 of file tz_support.c.
References ARG_FILE_LINE, assert, er_errid(), ER_ERROR_SEVERITY, er_set(), ER_TZ_LOAD_ERROR, NO_ERROR, NULL, tz_Lib_handle, tz_load_data_from_lib(), and tz_load_library().
Referenced by init_tz_name().
|
static |
Definition at line 2559 of file tz_support.c.
References tz_decode_info::offset, TZ_TIME_TYPE_LOCAL_STD, TZ_TIME_TYPE_LOCAL_WALL, and TZ_TIME_TYPE_UTC.
Referenced by tz_datetime_utc_conv(), and tz_print_tz_offset().
|
static |
Definition at line 884 of file tz_support.c.
References assert, ER_FAILED, NO_ERROR, and tz_offset().
Referenced by tz_full_timezones_start_scan(), and tz_get_timezone_offset().
int tz_resolve_os_timezone | ( | char * | timezone, |
int | buf_len | ||
) |
Definition at line 4588 of file tz_support.c.
References NULL, strlen, tz_data::timezone_names, tz_get_data(), and tz_get_zone_id_by_name().
Referenced by sysprm_final().
Definition at line 702 of file tz_support.c.
Referenced by conv_tz(), and set_new_zone_id().
Definition at line 729 of file tz_support.c.
Referenced by tzc_compute_timezone_checksum().
Definition at line 4650 of file tz_support.c.
Referenced by prm_load_by_section(), and sysprm_set_value().
int tz_str_read_number | ( | const char * | str, |
const char * | str_end, | ||
const bool | strict, | ||
const bool | read_sign, | ||
int * | val, | ||
const char ** | str_next | ||
) |
Definition at line 2130 of file tz_support.c.
References assert, char_isdigit(), ER_FAILED, IS_EMPTY_STR, and NO_ERROR.
Referenced by str_read_day_var(), str_to_offset_rule_until(), tz_str_read_time(), tzc_add_ds_rule(), tzc_add_offset_rule(), and tzc_load_leap_secs().
int tz_str_read_time | ( | const char * | str, |
const char * | str_end, | ||
bool | need_minutes, | ||
bool | allow_sec60, | ||
int * | hour, | ||
int * | min, | ||
int * | sec, | ||
const char ** | str_next | ||
) |
Definition at line 2186 of file tz_support.c.
References assert, ER_FAILED, IS_EMPTY_STR, NO_ERROR, and tz_str_read_number().
Referenced by str_to_offset_rule_until(), tz_str_to_seconds(), and tzc_load_leap_secs().
|
static |
Definition at line 1170 of file tz_support.c.
References ARG_FILE_LINE, CAST_BUFLEN, char_isspace(), tz_decode_info::dst_str, ER_ERROR_SEVERITY, er_set(), ER_TZ_INVALID_DST, ER_TZ_INVALID_TIMEZONE, NO_ERROR, NULL, tz_decode_info::offset, tz_decode_info::type, TZ_DS_ID_MAX, tz_get_zone_id_by_name(), TZ_OFFSET_ID_MAX, TZ_REGION_OFFSET, TZ_REGION_ZONE, tz_str_to_seconds(), tz_decode_info::zone, and tz_decode_info::zone_id.
Referenced by tz_create_datetimetz(), and tz_create_timestamptz().
Definition at line 1286 of file tz_support.c.
References ARG_FILE_LINE, CAST_BUFLEN, char_isspace(), ER_ERROR_SEVERITY, er_set(), ER_TZ_INVALID_TIMEZONE, NO_ERROR, NULL, tz_region::offset, tz_region::type, tz_get_zone_id_by_name(), TZ_REGION_OFFSET, TZ_REGION_ZONE, tz_str_to_seconds(), and tz_region::zone_id.
Referenced by db_from_tz(), prm_load_by_section(), sysprm_generate_new_value(), sysprm_get_id(), sysprm_set_value(), tz_conv_tz_datetime_w_zone_name(), and tz_conv_tz_time_w_zone_name().
int tz_str_to_seconds | ( | const char * | str, |
const char * | str_end, | ||
int * | seconds, | ||
const char ** | str_next, | ||
const bool | is_offset | ||
) |
Definition at line 2278 of file tz_support.c.
References assert, ER_FAILED, min, NO_ERROR, NULL, TZ_MAX_OFFSET, TZ_MIN_OFFSET, and tz_str_read_time().
Referenced by tz_get_timezone_offset(), tz_str_timezone_decode(), tz_str_to_region(), tzc_add_ds_rule(), tzc_add_offset_rule(), and tzc_compile_data().
|
static |
Definition at line 474 of file tz_support.c.
References tz_leap_sec::day, diff, tz_data::ds_leap_sec, tz_data::ds_leap_sec_count, i, IS_LEAP_YEAR, tz_leap_sec::month, NULL, tz_Days_of_month, tz_get_data(), TZ_MON_DEC, TZ_MON_FEB, and TZ_MON_JAN.
Referenced by tz_timestamp_decode_sec().
void tz_timestamp_decode_no_leap_sec | ( | int | timestamp, |
int * | yearp, | ||
int * | monthsp, | ||
int * | dayp, | ||
int * | hoursp, | ||
int * | minutesp, | ||
int * | secondsp | ||
) |
Definition at line 601 of file tz_support.c.
References IS_LEAP_YEAR, tz_Days_of_month, tz_Days_up_to_month, TZ_MON_FEB, and TZ_MON_JAN.
Referenced by fetch_peek_arith(), pt_evaluate_db_value_expr(), tz_full_timezones_start_scan(), and tz_timestamp_decode_sec().
void tz_timestamp_decode_sec | ( | int | timestamp, |
int * | yearp, | ||
int * | monthsp, | ||
int * | dayp, | ||
int * | hoursp, | ||
int * | minutesp, | ||
int * | secondsp | ||
) |
Definition at line 458 of file tz_support.c.
References tz_get_leapsec_support(), tz_timestamp_decode_leap_sec_adj(), and tz_timestamp_decode_no_leap_sec().
Referenced by db_timestamp_decode_utc().
DB_BIGINT tz_timestamp_encode_leap_sec_adj | ( | const int | year_century, |
const int | year, | ||
const int | mon, | ||
const int | day | ||
) |
Definition at line 415 of file tz_support.c.
References tz_leap_sec::day, tz_data::ds_leap_sec, tz_data::ds_leap_sec_count, tz_leap_sec::month, NULL, tz_get_data(), tz_get_leapsec_support(), and tz_leap_sec::year.
Referenced by db_timestamp_encode_utc().
int tz_timestamptz_fix_zone | ( | const DB_TIMESTAMPTZ * | src_ts_tz, |
DB_TIMESTAMPTZ * | dest_ts_tz | ||
) |
Definition at line 1843 of file tz_support.c.
References db_datetime::date, db_datetimetz::datetime, db_timestamp_decode_utc(), db_timestamp_encode_utc(), NO_ERROR, db_datetime::time, db_timestamptz::timestamp, tz_datetimetz_fix_zone(), db_timestamptz::tz_id, and db_datetimetz::tz_id.
Referenced by pt_evaluate_db_value_expr(), qdata_add_bigint_to_timestamptz(), qdata_add_int_to_timestamptz(), qdata_add_short_to_timestamptz(), qdata_interpolation_function_values(), qdata_subtract_bigint_to_dbval(), and qdata_subtract_timestamptz_to_dbval().
int tz_timezones_start_scan | ( | THREAD_ENTRY * | thread_p, |
int | show_type, | ||
DB_VALUE ** | arg_values, | ||
int | arg_cnt, | ||
void ** | ptr | ||
) |
Definition at line 4716 of file tz_support.c.
References db_make_string(), er_errid(), error(), i, tz_name::name, tz_data::name_count, tz_data::names, NO_ERROR, NULL, showstmt_alloc_array_context(), showstmt_alloc_tuple_in_context(), showstmt_free_array_context(), and tz_get_data().
Referenced by showstmt_scan_init().
void tz_tzid_convert_region_to_offset | ( | TZ_ID * | tz_id | ) |
Definition at line 5068 of file tz_support.c.
References assert, DS_TYPE_RULESET_ID, NULL, tz_decode_info::offset, tz_decode_info::type, TZ_BIT_SHIFT_TZ_ID_FLAG, tz_decode_tz_id(), tz_encode_tz_id(), TZ_MASK_TZ_ID_FLAG, TZ_REGION_OFFSET, and tz_decode_info::zone.
void tz_unload | ( | void | ) |
Definition at line 381 of file tz_support.c.
References NULL, tz_Initialized, and tz_Lib_handle.
Referenced by boot_client_all_finalize(), boot_initialize_client(), boot_restart_client(), boot_server_all_finalize(), and dump_tz().
int tz_utc_datetimetz_to_local | ( | const DB_DATETIME * | dt_utc, |
const TZ_ID * | tz_id, | ||
DB_DATETIME * | dt_local | ||
) |
Definition at line 1571 of file tz_support.c.
References ARG_FILE_LINE, assert, BO_IS_SERVER_RESTARTED, db_datetime::date, db_add_int_to_datetime(), DS_TYPE_FIXED, DS_TYPE_RULESET_ID, ER_ERROR_SEVERITY, er_set(), ER_TZ_INTERNAL_ERROR, NO_ERROR, NULL, tz_decode_info::offset, db_datetime::time, tz_decode_info::type, tz_decode_tz_id(), TZ_INVALID_OFFSET, TZ_REGION_OFFSET, and tz_decode_info::zone.
Referenced by conv_tz(), date_to_char(), db_date_add_sub_interval_days(), db_date_add_sub_interval_expr(), db_date_format(), db_datetimetz_to_string(), db_get_datetime_from_dbvalue(), db_get_time_from_dbvalue(), db_string_extract_dbval(), db_time_format(), db_timestamp_decode_w_tz_id(), db_trunc_dbval(), dbval_to_net_buf(), qdata_subtract_datetime_to_dbval(), qdata_subtract_datetimetz_to_dbval(), qdata_subtract_int_to_dbval(), round_date(), tp_value_cast_internal(), tp_value_coerce_strict(), and tz_datetimeltz_to_local().
|
static |
Definition at line 1652 of file tz_support.c.
References assert, cubregex::count(), db_time_decode(), tz_data::ds_rules, tz_offset_rule::ds_ruleset, tz_data::ds_rulesets, tz_offset_rule::ds_type, DS_TYPE_RULESET_ID, tz_decode_info::dst_id, tz_timezone::gmt_off_rule_start, tz_ds_ruleset::index_start, tz_ds_rule::letter_abbrev, min, tz_name::name, tz_data::names, NULL, tz_decode_info::offset, tz_data::offset_rules, tz_offset_rule::save_format, tz_ds_rule::save_time, tz_offset_rule::std_format, strlen, tz_data::timezones, tz_decode_info::type, tz_get_data(), TZ_INVALID_OFFSET, TZ_MAX_FORMAT_SIZE, TZ_MAX_OFFSET, TZ_MIN_OFFSET, TZ_REGION_OFFSET, tz_offset_rule::var_format, tz_decode_info::zone, tz_decode_info::zone_id, and tz_name::zone_id.
Referenced by tz_id_to_str().
|
static |
Definition at line 126 of file tz_support.c.
Referenced by tz_timestamp_decode_leap_sec_adj(), and tz_timestamp_decode_no_leap_sec().
|
static |
Definition at line 127 of file tz_support.c.
Referenced by tz_timestamp_decode_no_leap_sec().
|
static |
Definition at line 101 of file tz_support.c.
Referenced by tz_load(), and tz_unload().
|
static |
Definition at line 110 of file tz_support.c.
Referenced by tz_load(), tz_load_with_library_path(), and tz_unload().
|
static |
Definition at line 123 of file tz_support.c.
Referenced by tz_get_new_timezone_data().
|
static |
Definition at line 104 of file tz_support.c.
Referenced by tz_get_client_tz_region_session().
|
static |
Definition at line 102 of file tz_support.c.
Referenced by tz_get_client_tz_region_session(), tz_get_session_tz_region(), and tz_get_system_tz_region().