~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/tztime.cc

  • Committer: Brian Aker
  • Date: 2008-07-15 06:45:16 UTC
  • Revision ID: brian@tangent.org-20080715064516-fnbq7kowh7w57bxj
Merge Monty's code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
 
17
 
#include <drizzled/server_includes.h>
 
16
#ifdef USE_PRAGMA_IMPLEMENTATION
 
17
#pragma implementation                          // gcc: Class implementation
 
18
#endif
 
19
 
 
20
#include <my_global.h>
 
21
#include "mysql_priv.h"
 
22
#include <my_time.h>
 
23
 
18
24
#include "tzfile.h"
 
25
#include <m_string.h>
19
26
 
20
27
/* Structure describing local time type (e.g. Moscow summer time (MSD)) */
21
28
typedef struct ttinfo
22
29
{
23
30
  long tt_gmtoff; // Offset from UTC in seconds
24
 
  uint32_t tt_isdst;   // Is daylight saving time or not. Used to set tm_isdst
25
 
  uint32_t tt_abbrind; // Index of start of abbreviation for this time type.
 
31
  uint tt_isdst;   // Is daylight saving time or not. Used to set tm_isdst
 
32
  uint tt_abbrind; // Index of start of abbreviation for this time type.
26
33
  /*
27
34
    We don't use tt_ttisstd and tt_ttisgmt members of original elsie-code
28
35
    struct since we don't support POSIX-style TZ descriptions in variables.
38
45
 
39
46
/*
40
47
  Structure with information describing ranges of my_time_t shifted to local
41
 
  time (my_time_t + offset). Used for local DRIZZLE_TIME -> my_time_t conversion.
 
48
  time (my_time_t + offset). Used for local MYSQL_TIME -> my_time_t conversion.
42
49
  See comments for TIME_to_gmt_sec() for more info.
43
50
*/
44
51
typedef struct revtinfo
45
52
{
46
53
  long rt_offset; // Offset of local time from UTC in seconds
47
 
  uint32_t rt_type;    // Type of period 0 - Normal period. 1 - Spring time-gap
 
54
  uint rt_type;    // Type of period 0 - Normal period. 1 - Spring time-gap
48
55
} REVT_INFO;
49
56
 
50
57
#ifdef TZNAME_MAX
60
67
*/
61
68
typedef struct st_time_zone_info
62
69
{
63
 
  uint32_t leapcnt;  // Number of leap-second corrections
64
 
  uint32_t timecnt;  // Number of transitions between time types
65
 
  uint32_t typecnt;  // Number of local time types
66
 
  uint32_t charcnt;  // Number of characters used for abbreviations
67
 
  uint32_t revcnt;   // Number of transition descr. for TIME->my_time_t conversion
 
70
  uint leapcnt;  // Number of leap-second corrections
 
71
  uint timecnt;  // Number of transitions between time types
 
72
  uint typecnt;  // Number of local time types
 
73
  uint charcnt;  // Number of characters used for abbreviations
 
74
  uint revcnt;   // Number of transition descr. for TIME->my_time_t conversion
68
75
  /* The following are dynamical arrays are allocated in MEM_ROOT */
69
76
  my_time_t *ats;       // Times of transitions between time types
70
 
  unsigned char *types; // Local time types for transitions
 
77
  uchar *types; // Local time types for transitions
71
78
  TRAN_TYPE_INFO *ttis; // Local time types descriptions
72
79
  /* Storage for local time types abbreviations. They are stored as ASCIIZ */
73
80
  char *chars;
94
101
 
95
102
#if !defined(TZINFO2SQL)
96
103
 
97
 
static const uint32_t mon_lengths[2][MONS_PER_YEAR]=
 
104
static const uint mon_lengths[2][MONS_PER_YEAR]=
98
105
{
99
106
  { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
100
107
  { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
101
108
};
102
109
 
103
 
static const uint32_t mon_starts[2][MONS_PER_YEAR]=
 
110
static const uint mon_starts[2][MONS_PER_YEAR]=
104
111
{
105
112
  { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 },
106
113
  { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }
107
114
};
108
115
 
109
 
static const uint32_t year_lengths[2]=
 
116
static const uint year_lengths[2]=
110
117
{
111
118
  DAYS_PER_NYEAR, DAYS_PER_LYEAR
112
119
};
125
132
      offset - local time zone offset
126
133
 
127
134
  DESCRIPTION
128
 
    Convert my_time_t with offset to DRIZZLE_TIME struct. Differs from timesub
 
135
    Convert my_time_t with offset to MYSQL_TIME struct. Differs from timesub
129
136
    (from elsie code) because doesn't contain any leap correction and
130
137
    TM_GMTOFF and is_dst setting and contains some MySQL specific
131
138
    initialization. Funny but with removing of these we almost have
132
139
    glibc's offtime function.
133
140
*/
134
141
static void
135
 
sec_to_TIME(DRIZZLE_TIME * tmp, my_time_t t, long offset)
 
142
sec_to_TIME(MYSQL_TIME * tmp, my_time_t t, long offset)
136
143
{
137
144
  long days;
138
145
  long rem;
139
146
  int y;
140
147
  int yleap;
141
 
  const uint32_t *ip;
 
148
  const uint *ip;
142
149
 
143
150
  days= (long) (t / SECS_PER_DAY);
144
151
  rem=  (long) (t % SECS_PER_DAY);
188
195
  tmp->month++;
189
196
  tmp->day= (uint)(days + 1);
190
197
 
191
 
  /* filling MySQL specific DRIZZLE_TIME members */
 
198
  /* filling MySQL specific MYSQL_TIME members */
192
199
  tmp->neg= 0; tmp->second_part= 0;
193
 
  tmp->time_type= DRIZZLE_TIMESTAMP_DATETIME;
 
200
  tmp->time_type= MYSQL_TIMESTAMP_DATETIME;
194
201
}
195
202
 
196
203
 
217
224
*/
218
225
static uint
219
226
find_time_range(my_time_t t, const my_time_t *range_boundaries,
220
 
                uint32_t higher_bound)
 
227
                uint higher_bound)
221
228
{
222
 
  uint32_t i, lower_bound= 0;
 
229
  uint i, lower_bound= 0;
223
230
 
224
231
  /*
225
232
    Function will work without this assertion but result would be meaningless.
280
287
 
281
288
/*
282
289
  Converts time in my_time_t representation (seconds in UTC since Epoch) to
283
 
  broken down DRIZZLE_TIME representation in local time zone.
 
290
  broken down MYSQL_TIME representation in local time zone.
284
291
 
285
292
  SYNOPSIS
286
293
    gmt_sec_to_TIME()
295
302
    (60th and 61st second, look how we calculate them as "hit" in this
296
303
    function).
297
304
    Under realistic assumptions about frequency of transitions the same array
298
 
    can be used fot DRIZZLE_TIME -> my_time_t conversion. For this we need to
 
305
    can be used fot MYSQL_TIME -> my_time_t conversion. For this we need to
299
306
    implement tweaked binary search which will take into account that some
300
 
    DRIZZLE_TIME has two matching my_time_t ranges and some of them have none.
 
307
    MYSQL_TIME has two matching my_time_t ranges and some of them have none.
301
308
*/
302
309
static void
303
 
gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t sec_in_utc, const TIME_ZONE_INFO *sp)
 
310
gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t sec_in_utc, const TIME_ZONE_INFO *sp)
304
311
{
305
312
  const TRAN_TYPE_INFO *ttisp;
306
313
  const LS_INFO *lp;
402
409
}
403
410
 
404
411
/*
405
 
  Converts local time in broken down DRIZZLE_TIME representation to my_time_t
 
412
  Converts local time in broken down MYSQL_TIME representation to my_time_t
406
413
  representation.
407
414
 
408
415
  SYNOPSIS
444
451
 
445
452
    We use completely different approach. It is better since it is both
446
453
    faster than iterative implementations and fully determenistic. If you
447
 
    look at my_time_t to DRIZZLE_TIME conversion then you'll find that it consist
 
454
    look at my_time_t to MYSQL_TIME conversion then you'll find that it consist
448
455
    of two steps:
449
456
    The first is calculating shifted my_time_t value and the second - TIME
450
457
    calculation from shifted my_time_t value (well it is a bit simplified
474
481
    0 in case of error.
475
482
*/
476
483
static my_time_t
477
 
TIME_to_gmt_sec(const DRIZZLE_TIME *t, const TIME_ZONE_INFO *sp,
 
484
TIME_to_gmt_sec(const MYSQL_TIME *t, const TIME_ZONE_INFO *sp,
478
485
                bool *in_dst_time_gap)
479
486
{
480
487
  my_time_t local_t;
481
 
  uint32_t saved_seconds;
482
 
  uint32_t i;
 
488
  uint saved_seconds;
 
489
  uint i;
483
490
  int shift= 0;
484
491
 
485
492
  if (!validate_timestamp_range(t))
580
587
/*
581
588
  String with names of SYSTEM time zone.
582
589
*/
583
 
static const String tz_SYSTEM_name("SYSTEM", 6, &my_charset_utf8_general_ci);
 
590
static const String tz_SYSTEM_name("SYSTEM", 6, &my_charset_latin1);
584
591
 
585
592
 
586
593
/*
597
604
{
598
605
public:
599
606
  Time_zone_system() {}                       /* Remove gcc warning */
600
 
  virtual my_time_t TIME_to_gmt_sec(const DRIZZLE_TIME *t,
 
607
  virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t,
601
608
                                    bool *in_dst_time_gap) const;
602
 
  virtual void gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t t) const;
 
609
  virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const;
603
610
  virtual const String * get_name() const;
604
611
};
605
612
 
606
613
 
607
614
/*
608
 
  Converts local time in system time zone in DRIZZLE_TIME representation
 
615
  Converts local time in system time zone in MYSQL_TIME representation
609
616
  to its my_time_t representation.
610
617
 
611
618
  SYNOPSIS
612
619
    TIME_to_gmt_sec()
613
 
      t               - pointer to DRIZZLE_TIME structure with local time in
 
620
      t               - pointer to MYSQL_TIME structure with local time in
614
621
                        broken-down representation.
615
622
      in_dst_time_gap - pointer to bool which is set to true if datetime
616
623
                        value passed doesn't really exist (i.e. falls into
618
625
 
619
626
  DESCRIPTION
620
627
    This method uses system function (localtime_r()) for conversion
621
 
    local time in system time zone in DRIZZLE_TIME structure to its my_time_t
 
628
    local time in system time zone in MYSQL_TIME structure to its my_time_t
622
629
    representation. Unlike the same function for Time_zone_db class
623
630
    it it won't handle unnormalized input properly. Still it will
624
631
    return lowest possible my_time_t in case of ambiguity or if we
630
637
    Corresponding my_time_t value or 0 in case of error
631
638
*/
632
639
my_time_t
633
 
Time_zone_system::TIME_to_gmt_sec(const DRIZZLE_TIME *t, bool *in_dst_time_gap) const
 
640
Time_zone_system::TIME_to_gmt_sec(const MYSQL_TIME *t, bool *in_dst_time_gap) const
634
641
{
635
642
  long not_used;
636
643
  return my_system_gmt_sec(t, &not_used, in_dst_time_gap);
643
650
 
644
651
  SYNOPSIS
645
652
    gmt_sec_to_TIME()
646
 
      tmp - pointer to DRIZZLE_TIME structure to fill-in
 
653
      tmp - pointer to MYSQL_TIME structure to fill-in
647
654
      t   - my_time_t value to be converted
648
655
 
649
656
  NOTE
654
661
    the 1902 easily.
655
662
*/
656
663
void
657
 
Time_zone_system::gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t t) const
 
664
Time_zone_system::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const
658
665
{
659
666
  struct tm tmp_tm;
660
667
  time_t tmp_t= (time_t)t;
661
668
 
662
669
  localtime_r(&tmp_t, &tmp_tm);
663
670
  localtime_to_TIME(tmp, &tmp_tm);
664
 
  tmp->time_type= DRIZZLE_TIMESTAMP_DATETIME;
 
671
  tmp->time_type= MYSQL_TIMESTAMP_DATETIME;
665
672
}
666
673
 
667
674
 
684
691
/*
685
692
  Instance of this class represents UTC time zone. It uses system gmtime_r
686
693
  function for conversions and is always available. It is used only for
687
 
  my_time_t -> DRIZZLE_TIME conversions in various UTC_...  functions, it is not
688
 
  intended for DRIZZLE_TIME -> my_time_t conversions and shouldn't be exposed to user.
 
694
  my_time_t -> MYSQL_TIME conversions in various UTC_...  functions, it is not
 
695
  intended for MYSQL_TIME -> my_time_t conversions and shouldn't be exposed to user.
689
696
*/
690
697
class Time_zone_utc : public Time_zone
691
698
{
692
699
public:
693
700
  Time_zone_utc() {}                          /* Remove gcc warning */
694
 
  virtual my_time_t TIME_to_gmt_sec(const DRIZZLE_TIME *t,
 
701
  virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t,
695
702
                                    bool *in_dst_time_gap) const;
696
 
  virtual void gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t t) const;
 
703
  virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const;
697
704
  virtual const String * get_name() const;
698
705
};
699
706
 
700
707
 
701
708
/*
702
 
  Convert UTC time from DRIZZLE_TIME representation to its my_time_t representation.
 
709
  Convert UTC time from MYSQL_TIME representation to its my_time_t representation.
703
710
 
704
711
  SYNOPSIS
705
712
    TIME_to_gmt_sec()
706
 
      t               - pointer to DRIZZLE_TIME structure with local time
 
713
      t               - pointer to MYSQL_TIME structure with local time
707
714
                        in broken-down representation.
708
715
      in_dst_time_gap - pointer to bool which is set to true if datetime
709
716
                        value passed doesn't really exist (i.e. falls into
718
725
    0
719
726
*/
720
727
my_time_t
721
 
Time_zone_utc::TIME_to_gmt_sec(const DRIZZLE_TIME *t __attribute__((unused)),
722
 
                               bool *in_dst_time_gap __attribute__((unused))) const
 
728
Time_zone_utc::TIME_to_gmt_sec(const MYSQL_TIME *t __attribute__((__unused__)),
 
729
                               bool *in_dst_time_gap __attribute__((__unused__))) const
723
730
{
724
731
  /* Should be never called */
725
732
  assert(0);
733
740
 
734
741
  SYNOPSIS
735
742
    gmt_sec_to_TIME()
736
 
      tmp - pointer to DRIZZLE_TIME structure to fill-in
 
743
      tmp - pointer to MYSQL_TIME structure to fill-in
737
744
      t   - my_time_t value to be converted
738
745
 
739
746
  NOTE
740
747
    See note for apropriate Time_zone_system method.
741
748
*/
742
749
void
743
 
Time_zone_utc::gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t t) const
 
750
Time_zone_utc::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const
744
751
{
745
752
  struct tm tmp_tm;
746
753
  time_t tmp_t= (time_t)t;
747
754
  gmtime_r(&tmp_t, &tmp_tm);
748
755
  localtime_to_TIME(tmp, &tmp_tm);
749
 
  tmp->time_type= DRIZZLE_TIMESTAMP_DATETIME;
 
756
  tmp->time_type= MYSQL_TIMESTAMP_DATETIME;
750
757
}
751
758
 
752
759
 
781
788
{
782
789
public:
783
790
  Time_zone_db(TIME_ZONE_INFO *tz_info_arg, const String * tz_name_arg);
784
 
  virtual my_time_t TIME_to_gmt_sec(const DRIZZLE_TIME *t,
 
791
  virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t,
785
792
                                    bool *in_dst_time_gap) const;
786
 
  virtual void gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t t) const;
 
793
  virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const;
787
794
  virtual const String * get_name() const;
788
795
private:
789
796
  TIME_ZONE_INFO *tz_info;
817
824
 
818
825
  SYNOPSIS
819
826
    TIME_to_gmt_sec()
820
 
      t               - pointer to DRIZZLE_TIME structure with local time
 
827
      t               - pointer to MYSQL_TIME structure with local time
821
828
                        in broken-down representation.
822
829
      in_dst_time_gap - pointer to bool which is set to true if datetime
823
830
                        value passed doesn't really exist (i.e. falls into
831
838
    Corresponding my_time_t value or 0 in case of error
832
839
*/
833
840
my_time_t
834
 
Time_zone_db::TIME_to_gmt_sec(const DRIZZLE_TIME *t, bool *in_dst_time_gap) const
 
841
Time_zone_db::TIME_to_gmt_sec(const MYSQL_TIME *t, bool *in_dst_time_gap) const
835
842
{
836
843
  return ::TIME_to_gmt_sec(t, tz_info, in_dst_time_gap);
837
844
}
843
850
 
844
851
  SYNOPSIS
845
852
    gmt_sec_to_TIME()
846
 
      tmp - pointer to DRIZZLE_TIME structure to fill-in
 
853
      tmp - pointer to MYSQL_TIME structure to fill-in
847
854
      t   - my_time_t value to be converted
848
855
*/
849
856
void
850
 
Time_zone_db::gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t t) const
 
857
Time_zone_db::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const
851
858
{
852
859
  ::gmt_sec_to_TIME(tmp, t, tz_info);
853
860
}
877
884
{
878
885
public:
879
886
  Time_zone_offset(long tz_offset_arg);
880
 
  virtual my_time_t TIME_to_gmt_sec(const DRIZZLE_TIME *t,
 
887
  virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t,
881
888
                                    bool *in_dst_time_gap) const;
882
 
  virtual void   gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t t) const;
 
889
  virtual void   gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const;
883
890
  virtual const String * get_name() const;
884
891
  /*
885
892
    This have to be public because we want to be able to access it from
904
911
Time_zone_offset::Time_zone_offset(long tz_offset_arg):
905
912
  offset(tz_offset_arg)
906
913
{
907
 
  uint32_t hours= abs((int)(offset / SECS_PER_HOUR));
908
 
  uint32_t minutes= abs((int)(offset % SECS_PER_HOUR / SECS_PER_MIN));
 
914
  uint hours= abs((int)(offset / SECS_PER_HOUR));
 
915
  uint minutes= abs((int)(offset % SECS_PER_HOUR / SECS_PER_MIN));
909
916
  ulong length= snprintf(name_buff, sizeof(name_buff), "%s%02d:%02d",
910
917
                         (offset>=0) ? "+" : "-", hours, minutes);
911
 
  name.set(name_buff, length, &my_charset_utf8_general_ci);
 
918
  name.set(name_buff, length, &my_charset_latin1);
912
919
}
913
920
 
914
921
 
915
922
/*
916
923
  Converts local time in time zone described as offset from UTC
917
 
  from DRIZZLE_TIME representation to its my_time_t representation.
 
924
  from MYSQL_TIME representation to its my_time_t representation.
918
925
 
919
926
  SYNOPSIS
920
927
    TIME_to_gmt_sec()
921
 
      t               - pointer to DRIZZLE_TIME structure with local time
 
928
      t               - pointer to MYSQL_TIME structure with local time
922
929
                        in broken-down representation.
923
930
      in_dst_time_gap - pointer to bool which should be set to true if
924
931
                        datetime  value passed doesn't really exist
930
937
    Corresponding my_time_t value or 0 in case of error
931
938
*/
932
939
my_time_t
933
 
Time_zone_offset::TIME_to_gmt_sec(const DRIZZLE_TIME *t,
934
 
                                  bool *in_dst_time_gap __attribute__((unused))) const
 
940
Time_zone_offset::TIME_to_gmt_sec(const MYSQL_TIME *t,
 
941
                                  bool *in_dst_time_gap __attribute__((__unused__))) const
935
942
{
936
943
  my_time_t local_t;
937
944
  int shift= 0;
976
983
 
977
984
  SYNOPSIS
978
985
    gmt_sec_to_TIME()
979
 
      tmp - pointer to DRIZZLE_TIME structure to fill-in
 
986
      tmp - pointer to MYSQL_TIME structure to fill-in
980
987
      t   - my_time_t value to be converted
981
988
*/
982
989
void
983
 
Time_zone_offset::gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t t) const
 
990
Time_zone_offset::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const
984
991
{
985
992
  sec_to_TIME(tmp, t, offset);
986
993
}
1044
1051
    1 - Error
1045
1052
*/
1046
1053
bool
1047
 
my_tz_init(THD *thd, const char *default_tzname)
 
1054
my_tz_init(THD *thd, const char *default_tzname,
 
1055
           bool bootstrap __attribute__((__unused__)))
1048
1056
{
1049
1057
  if (default_tzname)
1050
1058
  {
1051
 
    String tmp_tzname2(default_tzname, &my_charset_utf8_general_ci);
 
1059
    String tmp_tzname2(default_tzname, &my_charset_latin1);
1052
1060
    /*
1053
1061
      Time zone tables may be open here, and my_tz_find() may open
1054
1062
      most of them once more, but this is OK for system tables open
1056
1064
    */
1057
1065
    if (!(global_system_variables.time_zone= my_tz_find(thd, &tmp_tzname2)))
1058
1066
    {
1059
 
      sql_print_error(_("Fatal error: Illegal or unknown default time zone '%s'"),
 
1067
      sql_print_error("Fatal error: Illegal or unknown default time zone '%s'",
1060
1068
                      default_tzname);
1061
1069
      return true;
1062
1070
    }
1094
1102
    1 - String doesn't contain valid time zone offset
1095
1103
*/
1096
1104
bool
1097
 
str_to_offset(const char *str, uint32_t length, long *offset)
 
1105
str_to_offset(const char *str, uint length, long *offset)
1098
1106
{
1099
1107
  const char *end= str + length;
1100
1108
  bool negative;
1114
1122
 
1115
1123
  number_tmp= 0;
1116
1124
 
1117
 
  while (str < end && my_isdigit(&my_charset_utf8_general_ci, *str))
 
1125
  while (str < end && my_isdigit(&my_charset_latin1, *str))
1118
1126
  {
1119
1127
    number_tmp= number_tmp*10 + *str - '0';
1120
1128
    str++;
1126
1134
 
1127
1135
  offset_tmp = number_tmp * MINS_PER_HOUR; number_tmp= 0;
1128
1136
 
1129
 
  while (str < end && my_isdigit(&my_charset_utf8_general_ci, *str))
 
1137
  while (str < end && my_isdigit(&my_charset_latin1, *str))
1130
1138
  {
1131
1139
    number_tmp= number_tmp * 10 + *str - '0';
1132
1140
    str++;
1162
1170
 
1163
1171
*/
1164
1172
Time_zone *
1165
 
my_tz_find(THD *thd __attribute__((unused)),
1166
 
           const String *name __attribute__((unused)))
 
1173
my_tz_find(THD *thd __attribute__((__unused__)),
 
1174
           const String *name __attribute__((__unused__)))
1167
1175
{
1168
1176
  return NULL;
1169
1177
}