summaryrefslogtreecommitdiff
path: root/sql/tztime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/tztime.cc')
-rw-r--r--sql/tztime.cc29
1 files changed, 20 insertions, 9 deletions
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 079abfc9299..228a8cd9b92 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -807,6 +807,18 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec)
}
+ /*
+ Works like sec_since_epoch but expects TIME structure as parameter.
+*/
+
+my_time_t
+sec_since_epoch_TIME(TIME *t)
+{
+ return sec_since_epoch(t->year, t->month, t->day,
+ t->hour, t->minute, t->second);
+}
+
+
/*
Converts local time in broken down TIME representation to my_time_t
representation.
@@ -1648,7 +1660,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
mysql.time_zone* tables are MyISAM and these operations always succeed
for MyISAM.
*/
- (void)table->file->ha_index_init(0);
+ (void)table->file->ha_index_init(0, 1);
tz_leapcnt= 0;
res= table->file->index_first(table->record[0]);
@@ -1825,7 +1837,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
mysql.time_zone* tables are MyISAM and these operations always succeed
for MyISAM.
*/
- (void)table->file->ha_index_init(0);
+ (void)table->file->ha_index_init(0, 1);
if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr,
0, HA_READ_KEY_EXACT))
@@ -1852,7 +1864,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
table= tz_tables->table;
tz_tables= tz_tables->next_local;
table->field[0]->store((longlong) tzid, TRUE);
- (void)table->file->ha_index_init(0);
+ (void)table->file->ha_index_init(0, 1);
if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr,
0, HA_READ_KEY_EXACT))
@@ -1879,7 +1891,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
table= tz_tables->table;
tz_tables= tz_tables->next_local;
table->field[0]->store((longlong) tzid, TRUE);
- (void)table->file->ha_index_init(0);
+ (void)table->file->ha_index_init(0, 1);
// FIXME Is there any better approach than explicitly specifying 4 ???
res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr,
@@ -1951,7 +1963,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
*/
table= tz_tables->table;
table->field[0]->store((longlong) tzid, TRUE);
- (void)table->file->ha_index_init(0);
+ (void)table->file->ha_index_init(0, 1);
// FIXME Is there any better approach than explicitly specifying 4 ???
res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr,
@@ -2199,12 +2211,11 @@ my_tz_find(const String * name, TABLE_LIST *tz_tables)
Tz_names_entry *tmp_tzname;
Time_zone *result_tz= 0;
long offset;
-
DBUG_ENTER("my_tz_find");
DBUG_PRINT("enter", ("time zone name='%s'",
- name ? ((String *)name)->c_ptr() : "NULL"));
-
- DBUG_ASSERT(!time_zone_tables_exist || tz_tables || current_thd->slave_thread);
+ name ? ((String *)name)->c_ptr_safe() : "NULL"));
+ DBUG_ASSERT(!time_zone_tables_exist || tz_tables ||
+ current_thd->slave_thread);
if (!name)
DBUG_RETURN(0);