1/* Copyright (C) 2009-2014 Kentoku Shiba
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
15
16#define MYSQL_SERVER 1
17#include <my_global.h>
18#include "spd_environ.h"
19#include "mysql.h"
20#include "spd_udf.h"
21
22extern "C" {
23long long spider_direct_sql(
24 UDF_INIT *initid,
25 UDF_ARGS *args,
26 char *is_null,
27 char *error
28) {
29 return spider_direct_sql_body(initid, args, is_null, error, FALSE);
30}
31
32my_bool spider_direct_sql_init(
33 UDF_INIT *initid,
34 UDF_ARGS *args,
35 char *message
36) {
37 return spider_direct_sql_init_body(initid, args, message, FALSE);
38}
39
40void spider_direct_sql_deinit(
41 UDF_INIT *initid
42) {
43 spider_direct_sql_deinit_body(initid);
44}
45
46#ifndef WITHOUT_SPIDER_BG_SEARCH
47long long spider_bg_direct_sql(
48 UDF_INIT *initid,
49 UDF_ARGS *args,
50 char *is_null,
51 char *error
52) {
53 return spider_direct_sql_bg_end(initid);
54}
55
56my_bool spider_bg_direct_sql_init(
57 UDF_INIT *initid,
58 UDF_ARGS *args,
59 char *message
60) {
61 return spider_direct_sql_init_body(initid, args, message, TRUE);
62}
63
64void spider_bg_direct_sql_deinit(
65 UDF_INIT *initid
66) {
67 spider_direct_sql_deinit_body(initid);
68}
69
70void spider_bg_direct_sql_clear(
71 UDF_INIT *initid,
72 char *is_null,
73 char *error
74) {
75 spider_direct_sql_bg_start(initid);
76}
77
78void spider_bg_direct_sql_add(
79 UDF_INIT *initid,
80 UDF_ARGS *args,
81 char *is_null,
82 char *error
83) {
84 spider_direct_sql_body(initid, args, is_null, error, TRUE);
85}
86#endif
87
88long long spider_ping_table(
89 UDF_INIT *initid,
90 UDF_ARGS *args,
91 char *is_null,
92 char *error
93) {
94 return spider_ping_table_body(initid, args, is_null, error);
95}
96
97my_bool spider_ping_table_init(
98 UDF_INIT *initid,
99 UDF_ARGS *args,
100 char *message
101) {
102 return spider_ping_table_init_body(initid, args, message);
103}
104
105void spider_ping_table_deinit(
106 UDF_INIT *initid
107) {
108 spider_ping_table_deinit_body(initid);
109}
110
111long long spider_flush_table_mon_cache(
112 UDF_INIT *initid,
113 UDF_ARGS *args,
114 char *is_null,
115 char *error
116) {
117 return spider_flush_table_mon_cache_body();
118}
119
120my_bool spider_flush_table_mon_cache_init(
121 UDF_INIT *initid,
122 UDF_ARGS *args,
123 char *message
124) {
125 return FALSE;
126}
127
128void spider_flush_table_mon_cache_deinit(
129 UDF_INIT *initid
130) {
131}
132
133long long spider_copy_tables(
134 UDF_INIT *initid,
135 UDF_ARGS *args,
136 char *is_null,
137 char *error
138) {
139 return spider_copy_tables_body(initid, args, is_null, error);
140}
141
142my_bool spider_copy_tables_init(
143 UDF_INIT *initid,
144 UDF_ARGS *args,
145 char *message
146) {
147 return spider_copy_tables_init_body(initid, args, message);
148}
149
150void spider_copy_tables_deinit(
151 UDF_INIT *initid
152) {
153 spider_copy_tables_deinit_body(initid);
154}
155}
156