diff options
-rw-r--r-- | sql/mysql_priv.h | 8 | ||||
-rw-r--r-- | sql/tztime.cc | 14 | ||||
-rw-r--r-- | sql/tztime.h | 8 |
3 files changed, 22 insertions, 8 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 03313adf76b..d2366677b8e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -40,14 +40,6 @@ extern const key_map key_map_empty; extern const key_map key_map_full; extern const char *primary_key_name; -/* - Portable time_t replacement. - Should be signed and hold seconds for 1902-2038 range. -*/ -typedef long my_time_t; -#define MY_TIME_T_MAX LONG_MAX -#define MY_TIME_T_MIN LONG_MIN - #include "mysql_com.h" #include <violite.h> #include "unireg.h" diff --git a/sql/tztime.cc b/sql/tztime.cc index 0a5b8df664c..f6a9c99ac7f 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -24,7 +24,18 @@ #pragma implementation // gcc: Class implementation #endif +/* + We should not include mysql_priv.h in mysql_tzinfo_to_sql utility since + it creates unsolved link dependencies on some platforms. +*/ +#if !defined(TZINFO2SQL) && !defined(TESTTIME) #include "mysql_priv.h" +#else +#include <my_global.h> +#include "tztime.h" +#include <my_sys.h> +#endif + #include "tzfile.h" #include <m_string.h> #include <my_dir.h> @@ -486,6 +497,8 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) } +#if !defined(TZINFO2SQL) + static const uint mon_lengths[2][MONS_PER_YEAR]= { { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, @@ -922,6 +935,7 @@ TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, bool *in_dst_time_gap) /* End of elsie derived code. */ +#endif /* !defined(TZINFO2SQL) */ #if !defined(TESTTIME) && !defined(TZINFO2SQL) diff --git a/sql/tztime.h b/sql/tztime.h index ed92441d790..334b14f4fc4 100644 --- a/sql/tztime.h +++ b/sql/tztime.h @@ -19,6 +19,14 @@ #pragma interface /* gcc class interface */ #endif +/* + Portable time_t replacement. + Should be signed and hold seconds for 1902-2038 range. +*/ +typedef long my_time_t; +#define MY_TIME_T_MAX LONG_MAX +#define MY_TIME_T_MIN LONG_MIN + #if !defined(TESTTIME) && !defined(TZINFO2SQL) /* This class represents abstract time zone and provides |