CUBRID Engine
latest
|
Go to the source code of this file.
Macros | |
#define | db_utime_to_string db_timestamp_to_string |
#define | db_string_to_utime db_string_to_timestamp |
#define | db_date_parse_utime db_date_parse_timestamp |
#define | TZLIB_SYMBOL_NAME_SIZE 64 |
#define | MAX_LEN_OFFSET 10 |
#define | SHLIB_EXPORT_PREFIX "" |
#define | LIB_TZ_NAME "libcubrid_timezones.so" |
#define | IS_LEAP_YEAR(y) ((((y) & 3) == 0) && ((((y) % 25) != 0) || (((y) & 15) == 0))) |
#define | DAYS_IN_MONTH(m) (31 - ((m) > 6 ? (m) - 7 : (m)) % 2) |
#define | IS_EMPTY_STR(s) ((s) == NULL || *(s) == '\0') |
#define | TZ_MAX_YEAR 9999 |
#define | TZ_MAX_JULIAN_DATE 5373486 |
#define | TZ_ZONE_ID_MAX 0x3ff |
#define | TZ_OFFSET_ID_MAX 0xff |
#define | TZ_DS_ID_MAX 0xff |
#define | DATE_DIFF_MATCH_SAFE_THRESHOLD_DAYS 2 |
#define | DATE_DIFF_MATCH_SAFE_THRESHOLD_SEC 172800ll |
#define | TZ_DS_STRING_SIZE 10 |
#define | TZR_SIZE 100 |
#define | ZONE_MAX 10000 |
#define | TZ_IS_ZONE_VALID_DECODE_INFO(tz_info) |
#define | TZ_IS_UTC_TZ_REGION(r) ((r)->type == TZ_REGION_OFFSET && (r)->offset == 0) |
Typedefs | |
typedef DB_BIGINT | full_date_t |
Enumerations | |
enum | { TIME_SPECIFIER = 1, DATE_SPECIFIER = 2, DATETIME_SPECIFIER = 3, REMOVED_TIMETZ_SPECIFIER = 4, DATETIMETZ_SPECIFIER = 5 } |
enum | { TZ_MON_JAN = 0, TZ_MON_FEB = 1, TZ_MON_MAR = 2, TZ_MON_APR = 3, TZ_MON_MAY = 4, TZ_MON_JUN = 5, TZ_MON_JUL = 6, TZ_MON_AUG = 7, TZ_MON_SEP = 8, TZ_MON_OCT = 9, TZ_MON_NOV = 10, TZ_MON_DEC = 11, TZ_MON_COUNT = 12 } |
enum | { TZ_WEEK_DAY_SUN = 0, TZ_WEEK_DAY_MON = 1, TZ_WEEK_DAY_TUE = 2, TZ_WEEK_DAY_WED = 3, TZ_WEEK_DAY_THU = 4, TZ_WEEK_DAY_FRI = 5, TZ_WEEK_DAY_SAT = 6, TZ_WEEK_DAY_COUNT = 7 } |
Functions | |
void | db_date_locale_init (void) |
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) |
int | tz_get_timezone_offset (const char *tz_str, int tz_size, char *result, DB_DATETIME *utc_datetime) |
int | tz_get_first_weekday_around_date (const int year, const int month, const int weekday, const int after_day, const bool before) |
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_system_timezone (void) |
const char * | tz_get_session_local_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_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_str_to_region (const char *tz_str, const int tz_str_size, TZ_REGION *tz_region) |
int | tz_create_session_tzid_for_time (const DB_TIME *src_time, bool src_is_utc, TZ_ID *tz_id) |
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 *sec, 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_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_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_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_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_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_size) |
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 *, const void *, DB_TYPE) |
int | tz_get_offset_in_mins () |
#define DATE_DIFF_MATCH_SAFE_THRESHOLD_DAYS 2 |
Definition at line 82 of file tz_support.h.
Referenced by tz_datetime_utc_conv().
#define DATE_DIFF_MATCH_SAFE_THRESHOLD_SEC 172800ll |
Definition at line 83 of file tz_support.h.
Referenced by tz_datetime_utc_conv(), and tz_fast_find_ds_rule().
#define DAYS_IN_MONTH | ( | m | ) | (31 - ((m) > 6 ? (m) - 7 : (m)) % 2) |
Definition at line 65 of file tz_support.h.
Referenced by str_to_offset_rule_until(), tz_get_first_weekday_around_date(), and tzc_is_valid_date().
#define db_date_parse_utime db_date_parse_timestamp |
Definition at line 31 of file tz_support.h.
Referenced by tp_atoutime().
#define db_string_to_utime db_string_to_timestamp |
Definition at line 30 of file tz_support.h.
Referenced by pt_db_value_initialize().
#define db_utime_to_string db_timestamp_to_string |
Definition at line 29 of file tz_support.h.
Referenced by csql_db_value_as_string(), db_value_printer::describe_data(), and pt_dbval_to_value().
#define IS_EMPTY_STR | ( | s | ) | ((s) == NULL || *(s) == '\0') |
Definition at line 67 of file tz_support.h.
Referenced by comp_func_raw_countries(), comp_func_raw_ds_rulesets(), comp_func_raw_links(), comp_func_raw_zones(), comp_func_tz_names(), str_day_to_int(), str_month_to_int(), str_to_offset_rule_until(), trim_comments_whitespaces(), tz_str_read_number(), tz_str_read_time(), tzc_add_ds_rule(), tzc_add_link(), tzc_add_offset_rule(), tzc_add_zone(), tzc_compile_data(), tzc_load_backward_zones(), tzc_load_countries(), tzc_load_leap_secs(), tzc_load_rule_file(), tzc_load_zone_names(), tzc_log_error(), and tzc_summary().
#define IS_LEAP_YEAR | ( | y | ) | ((((y) & 3) == 0) && ((((y) % 25) != 0) || (((y) & 15) == 0))) |
Definition at line 62 of file tz_support.h.
Referenced by db_add_weeks_and_days_to_date(), db_get_day_of_year(), db_get_week_of_year(), db_timestamp_encode_utc(), str_to_offset_rule_until(), tz_get_ds_change_julian_date_diff(), tz_get_first_weekday_around_date(), tz_timestamp_decode_leap_sec_adj(), tz_timestamp_decode_no_leap_sec(), and tzc_is_valid_date().
#define LIB_TZ_NAME "libcubrid_timezones.so" |
Definition at line 59 of file tz_support.h.
Referenced by init_tz_name(), and tz_load().
#define MAX_LEN_OFFSET 10 |
Definition at line 45 of file tz_support.h.
Referenced by db_tz_offset(), and tz_full_timezones_start_scan().
#define SHLIB_EXPORT_PREFIX "" |
Definition at line 58 of file tz_support.h.
Referenced by tzc_export_timezone_dot_c().
#define TZ_DS_ID_MAX 0xff |
Definition at line 78 of file tz_support.h.
Referenced by tz_create_datetimetz_from_zoneid_and_tzd(), tz_create_timestamptz_from_zoneid_and_tzd(), tz_decode_tz_id(), tz_decode_tz_region(), tz_encode_tz_id(), tz_full_timezones_start_scan(), and tz_str_timezone_decode().
#define TZ_DS_STRING_SIZE 10 |
Definition at line 85 of file tz_support.h.
Referenced by date_to_char(), db_date_format(), and db_time_format().
#define TZ_IS_UTC_TZ_REGION | ( | r | ) | ((r)->type == TZ_REGION_OFFSET && (r)->offset == 0) |
Definition at line 122 of file tz_support.h.
Referenced by db_timestamp_decode_w_reg(), and db_timestamp_encode_w_reg().
#define TZ_IS_ZONE_VALID_DECODE_INFO | ( | tz_info | ) |
Definition at line 118 of file tz_support.h.
Referenced by tz_conv_tz_datetime_w_zone_info().
#define TZ_MAX_JULIAN_DATE 5373486 |
Definition at line 74 of file tz_support.h.
Referenced by tz_datetime_utc_conv().
#define TZ_MAX_YEAR 9999 |
Definition at line 69 of file tz_support.h.
Referenced by str_to_offset_rule_until(), tzc_add_ds_rule(), tzc_check_ds_ruleset(), tzc_dump_ds_ruleset(), tzc_is_valid_date(), and tzc_parse_ds_change_on().
#define TZ_OFFSET_ID_MAX 0xff |
Definition at line 77 of file tz_support.h.
Referenced by tz_create_datetimetz_from_zoneid_and_tzd(), tz_create_timestamptz_from_zoneid_and_tzd(), tz_decode_tz_id(), tz_decode_tz_region(), tz_encode_tz_id(), and tz_str_timezone_decode().
#define TZ_ZONE_ID_MAX 0x3ff |
Definition at line 76 of file tz_support.h.
Referenced by tz_decode_tz_id(), tz_encode_tz_id(), and tz_encode_tz_region().
#define TZLIB_SYMBOL_NAME_SIZE 64 |
Definition at line 44 of file tz_support.h.
Referenced by tz_load_data_from_lib().
#define TZR_SIZE 100 |
Definition at line 86 of file tz_support.h.
Referenced by date_to_char(), db_date_format(), and db_time_format().
#define ZONE_MAX 10000 |
Definition at line 87 of file tz_support.h.
Referenced by init_tz_name().
typedef DB_BIGINT full_date_t |
Definition at line 125 of file tz_support.h.
anonymous enum |
Enumerator | |
---|---|
TIME_SPECIFIER | |
DATE_SPECIFIER | |
DATETIME_SPECIFIER | |
REMOVED_TIMETZ_SPECIFIER | |
DATETIMETZ_SPECIFIER |
Definition at line 33 of file tz_support.h.
anonymous enum |
Enumerator | |
---|---|
TZ_MON_JAN | |
TZ_MON_FEB | |
TZ_MON_MAR | |
TZ_MON_APR | |
TZ_MON_MAY | |
TZ_MON_JUN | |
TZ_MON_JUL | |
TZ_MON_AUG | |
TZ_MON_SEP | |
TZ_MON_OCT | |
TZ_MON_NOV | |
TZ_MON_DEC | |
TZ_MON_COUNT |
Definition at line 89 of file tz_support.h.
anonymous enum |
Enumerator | |
---|---|
TZ_WEEK_DAY_SUN | |
TZ_WEEK_DAY_MON | |
TZ_WEEK_DAY_TUE | |
TZ_WEEK_DAY_WED | |
TZ_WEEK_DAY_THU | |
TZ_WEEK_DAY_FRI | |
TZ_WEEK_DAY_SAT | |
TZ_WEEK_DAY_COUNT |
Definition at line 106 of file tz_support.h.
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().
void db_date_locale_init | ( | void | ) |
Definition at line 1531 of file db_date.c.
References fill_local_ampm_str(), local_am_str, local_am_strlen, local_pm_str, local_pm_strlen, and strlen.
Referenced by set_current_locale().
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().
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().
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().
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().
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().
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().
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 | after_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 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 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().
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().
int tz_resolve_os_timezone | ( | char * | timezone, |
int | buf_size | ||
) |
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().
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 * | sec, | ||
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().
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().