1/* -*- c-basic-offset: 2 -*- */
2/*
3 Copyright(C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library 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 GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18*/
19
20#ifndef MRN_MYSQL_H_
21#define MRN_MYSQL_H_
22
23#ifdef HAVE_CONFIG_H
24# include <my_global.h>
25/* We need to undefine them because my_config.h defines them. :< */
26# undef VERSION
27# undef PACKAGE
28# undef PACKAGE_BUGREPORT
29# undef PACKAGE_NAME
30# undef PACKAGE_STRING
31# undef PACKAGE_TARNAME
32# undef PACKAGE_VERSION
33#endif
34
35#include <mrn_version.h>
36
37#ifdef FORCE_FAST_MUTEX_DISABLED
38# ifdef MY_PTHREAD_FASTMUTEX
39# undef MY_PTHREAD_FASTMUTEX
40# endif
41#endif
42
43#define MYSQL_SERVER 1
44#include <mysql_version.h>
45
46#ifdef MARIADB_BASE_VERSION
47# define MRN_MARIADB_P 1
48#endif
49
50#include <sql_const.h>
51#include <sql_class.h>
52#if (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID < 80002)
53# include <probes_mysql.h>
54#endif
55#include <sql_partition.h>
56#include <rpl_filter.h>
57
58#define MRN_MESSAGE_BUFFER_SIZE 1024
59
60#define MRN_DBUG_ENTER_FUNCTION() DBUG_ENTER(__FUNCTION__)
61
62#if !defined(DBUG_OFF) && !defined(_lint)
63# define MRN_DBUG_ENTER_METHOD() \
64 char method_name[MRN_MESSAGE_BUFFER_SIZE]; \
65 method_name[0] = '\0'; \
66 strcat(method_name, MRN_CLASS_NAME); \
67 strcat(method_name, "::"); \
68 strcat(method_name, __FUNCTION__); \
69 DBUG_ENTER(method_name)
70#else
71# define MRN_DBUG_ENTER_METHOD() MRN_DBUG_ENTER_FUNCTION()
72#endif
73
74#endif /* MRN_MYSQL_H_ */
75