1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Adding the timezone plugin service, to convert between

MYSQL_TIME and my_time_t and back.

Using the new service instead of direct access to thd.

added:
  include/mysql/service_thd_timezone.h
  libservices/thd_timezone_service.c
modified:
  include/my_time.h
  include/mysql.h.pp
  include/mysql/plugin.h
  include/mysql/plugin_audit.h.pp
  include/mysql/plugin_auth.h.pp
  include/mysql/plugin_ftparser.h.pp
  include/mysql/services.h
  include/mysql_time.h
  include/service_versions.h
  libservices/CMakeLists.txt
  sql/sql_class.cc
  sql/sql_plugin_services.h
  storage/connect/value.cpp
This commit is contained in:
Alexander Barkov
2013-05-24 19:09:59 +04:00
parent 74be65c6d8
commit 32bd0c7d1f
15 changed files with 203 additions and 17 deletions

View File

@@ -35,6 +35,7 @@
#include "sql_cache.h" // query_cache_abort
#include "sql_base.h" // close_thread_tables
#include "sql_time.h" // date_time_format_copy
#include "tztime.h" // MYSQL_TIME <-> my_time_t
#include "sql_acl.h" // NO_ACCESS,
// acl_getroot_no_password
#include "sql_base.h" // close_temporary_tables
@@ -1261,6 +1262,26 @@ void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid)
*xid = *(MYSQL_XID *) &thd->transaction.xid_state.xid;
}
extern "C"
my_time_t thd_TIME_to_gmt_sec(MYSQL_THD thd, const MYSQL_TIME *ltime,
unsigned int *errcode)
{
Time_zone *tz= thd ? thd->variables.time_zone :
global_system_variables.time_zone;
return tz->TIME_to_gmt_sec(ltime, errcode);
}
extern "C"
void thd_gmt_sec_to_TIME(MYSQL_THD thd, MYSQL_TIME *ltime, my_time_t t)
{
Time_zone *tz= thd ? thd->variables.time_zone :
global_system_variables.time_zone;
tz->gmt_sec_to_TIME(ltime, t);
}
#ifdef _WIN32
extern "C" THD *_current_thd_noinline(void)
{