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
33
#include <drizzled/common.h>
34
#include <drizzled/data_home.h>
35
#include <drizzled/current_session.h>
36
#include <drizzled/session.h>
38
#include "cslib/CSConfig.h"
41
#include "cslib/CSGlobal.h"
42
#include "cslib/CSException.h"
47
/* Note: 'new' used here is NOT CSObject::new which is a DEBUG define*/
52
void *ms_my_get_thread()
54
THD *thd = current_thd;
60
const char *ms_my_get_mysql_home_path()
62
return drizzled::data_home;
65
bool ms_is_autocommit()
67
return (session_test_options(current_thd, (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) == 0;
71
const char *ms_my_get_mysql_home_path()
73
return mysql_real_data_home;
76
bool ms_is_autocommit()
78
return (thd_test_options(current_thd, (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) == 0;
83
uint64_t ms_my_1970_to_mysql_time(time_t t)
93
gmtime_r(&t, &details);
94
sec = (uint64_t) details.tm_sec;
95
min = (uint64_t) details.tm_min * 100LL;
96
hour = (uint64_t) details.tm_hour * 10000LL;
97
day = (uint64_t) details.tm_mday * 1000000LL;
98
mon = (uint64_t) (details.tm_mon+1) * 100000000LL;
99
year = (uint64_t) (details.tm_year+1900) * 10000000000LL;
101
return year + mon + day + hour + min + sec;