1
/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
3
* PrimeBase Media Stream for MySQL
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
* Original author: Paul McCullagh
20
* Continued development: Barry Leslie
31
//#include "mysql_priv.h"
33
//#define DRIZZLE_SERVER 1
35
//#include <drizzled/global.h>
36
#include <drizzled/server_includes.h>
37
//#include <drizzled/plugin.h>
38
//#include <drizzled/show.h>
39
#include <drizzled/data_home.h>
40
#include <drizzled/current_session.h>
46
#include "CSException.h"
50
/* Note: 'new' used here is NOT CSObject::new which is a DEBUG define*/
55
void *ms_my_get_thread()
57
THD *thd = current_thd;
62
bool ms_is_autocommit()
64
return (thd_test_options(current_thd, (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) == 0;
67
const char *ms_my_version()
73
extern ulong server_id;
76
u_long ms_my_get_server_id()
82
uint64_t ms_my_1970_to_mysql_time(time_t t)
92
gmtime_r(&t, &details);
93
sec = (uint64_t) details.tm_sec;
94
min = (uint64_t) details.tm_min * 100LL;
95
hour = (uint64_t) details.tm_hour * 10000LL;
96
day = (uint64_t) details.tm_mday * 1000000LL;
97
mon = (uint64_t) (details.tm_mon+1) * 100000000LL;
98
year = (uint64_t) (details.tm_year+1900) * 10000000000LL;
100
return year + mon + day + hour + min + sec;
103
const char *ms_my_get_mysql_home_path()
105
return mysql_real_data_home;