]>
Commit | Line | Data |
---|---|---|
377a1ee5 | 1 | diff -B -N -r -u mysql-5.0.22/config/ac-macros/ha_sphinx.m4 mysql-5.0.22.sx/config/ac-macros/ha_sphinx.m4 |
2 | --- mysql-5.0.22/config/ac-macros/ha_sphinx.m4 1970-01-01 01:00:00.000000000 +0100 | |
3 | +++ mysql-5.0.22.sx/config/ac-macros/ha_sphinx.m4 2006-06-06 19:49:38.000000000 +0200 | |
4 | @@ -0,0 +1,30 @@ | |
5 | +dnl --------------------------------------------------------------------------- | |
6 | +dnl Macro: MYSQL_CHECK_EXAMPLEDB | |
7 | +dnl Sets HAVE_SPHINX_DB if --with-sphinx-storage-engine is used | |
8 | +dnl --------------------------------------------------------------------------- | |
9 | +AC_DEFUN([MYSQL_CHECK_SPHINXDB], [ | |
10 | + AC_ARG_WITH([sphinx-storage-engine], | |
11 | + [ | |
12 | + --with-sphinx-storage-engine | |
13 | + Enable the Sphinx Storage Engine], | |
14 | + [sphinxdb="$withval"], | |
15 | + [sphinxdb=no]) | |
16 | + AC_MSG_CHECKING([for example storage engine]) | |
17 | + | |
18 | + case "$sphinxdb" in | |
19 | + yes ) | |
20 | + AC_DEFINE([HAVE_SPHINX_DB], [1], [Builds Sphinx Engine]) | |
21 | + AC_MSG_RESULT([yes]) | |
22 | + [sphinxdb=yes] | |
23 | + ;; | |
24 | + * ) | |
25 | + AC_MSG_RESULT([no]) | |
26 | + [sphinxdb=no] | |
27 | + ;; | |
28 | + esac | |
29 | + | |
30 | +]) | |
31 | +dnl --------------------------------------------------------------------------- | |
32 | +dnl END OF MYSQL_CHECK_EXAMPLE SECTION | |
33 | +dnl --------------------------------------------------------------------------- | |
34 | + | |
35 | diff -B -N -r -u mysql-5.0.22/configure.in mysql-5.0.22.sx/configure.in | |
36 | --- mysql-5.0.22/configure.in 2006-05-25 10:56:45.000000000 +0200 | |
37 | +++ mysql-5.0.22.sx/configure.in 2006-06-06 19:49:38.000000000 +0200 | |
38 | @@ -41,6 +41,7 @@ | |
39 | sinclude(config/ac-macros/ha_berkeley.m4) | |
40 | sinclude(config/ac-macros/ha_blackhole.m4) | |
41 | sinclude(config/ac-macros/ha_example.m4) | |
42 | +sinclude(config/ac-macros/ha_sphinx.m4) | |
43 | sinclude(config/ac-macros/ha_federated.m4) | |
44 | sinclude(config/ac-macros/ha_innodb.m4) | |
45 | sinclude(config/ac-macros/ha_ndbcluster.m4) | |
46 | @@ -2450,6 +2451,7 @@ | |
47 | MYSQL_CHECK_BDB | |
48 | MYSQL_CHECK_INNODB | |
49 | MYSQL_CHECK_EXAMPLEDB | |
50 | +MYSQL_CHECK_SPHINXDB | |
51 | MYSQL_CHECK_ARCHIVEDB | |
52 | MYSQL_CHECK_CSVDB | |
53 | MYSQL_CHECK_BLACKHOLEDB | |
54 | diff -B -N -r -u mysql-5.0.22/libmysqld/Makefile.am mysql-5.0.22.sx/libmysqld/Makefile.am | |
55 | --- mysql-5.0.22/libmysqld/Makefile.am 2006-05-25 10:56:55.000000000 +0200 | |
56 | +++ mysql-5.0.22.sx/libmysqld/Makefile.am 2006-06-06 19:49:38.000000000 +0200 | |
57 | @@ -27,7 +27,7 @@ | |
58 | -DSHAREDIR="\"$(MYSQLSHAREdir)\"" | |
59 | INCLUDES= @bdb_includes@ \ | |
60 | -I$(top_builddir)/include -I$(top_srcdir)/include \ | |
61 | - -I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \ | |
62 | + -I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples -I$(top_srcdir)/sql/sphinx \ | |
63 | -I$(top_srcdir)/regex \ | |
64 | $(openssl_includes) $(yassl_includes) @ZLIB_INCLUDES@ | |
65 | ||
66 | @@ -38,6 +38,7 @@ | |
67 | libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \ | |
68 | my_time.c | |
69 | sqlexamplessources = ha_example.cc ha_tina.cc | |
70 | +sqlsphinxsources = ha_sphinx.cc | |
71 | ||
72 | noinst_HEADERS = embedded_priv.h emb_qcache.h | |
73 | ||
74 | @@ -65,7 +66,7 @@ | |
75 | parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \ | |
76 | ha_blackhole.cc ha_archive.cc my_user.c | |
77 | ||
78 | -libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) | |
79 | +libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) $(sqlsphinxsources) | |
80 | libmysqld_a_SOURCES= | |
81 | ||
82 | # automake misses these | |
83 | @@ -133,12 +134,16 @@ | |
84 | rm -f $$f; \ | |
85 | @LN_CP_F@ $(top_srcdir)/sql/examples/$$f $$f; \ | |
86 | done; \ | |
87 | + for f in $(sqlsphinxsources); do \ | |
88 | + rm -f $$f; \ | |
89 | + @LN_CP_F@ $(top_srcdir)/sql/sphinx/$$f $$f; \ | |
90 | + done; \ | |
91 | rm -f client_settings.h; \ | |
92 | @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h client_settings.h | |
93 | ||
94 | ||
95 | clean-local: | |
96 | - rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \ | |
97 | + rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) $(sqlsphinxsources) | sed "s;\.lo;.c;g"` \ | |
98 | $(top_srcdir)/linked_libmysqld_sources; \ | |
99 | rm -f client_settings.h | |
100 | ||
101 | diff -B -N -r -u mysql-5.0.22/sql/handler.cc mysql-5.0.22.sx/sql/handler.cc | |
102 | --- mysql-5.0.22/sql/handler.cc 2006-05-25 10:56:42.000000000 +0200 | |
103 | +++ mysql-5.0.22.sx/sql/handler.cc 2006-06-06 19:49:38.000000000 +0200 | |
104 | @@ -78,6 +78,15 @@ | |
105 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | |
106 | HTON_NO_FLAGS }; | |
107 | #endif | |
108 | +#ifdef HAVE_SPHINX_DB | |
109 | +#include "sphinx/ha_sphinx.h" | |
110 | +extern handlerton sphinx_hton; | |
111 | +#else | |
112 | +handlerton sphinx_hton = { "SPHINX", SHOW_OPTION_NO, "SPHINX storage engine", | |
113 | + DB_TYPE_SPHINX_DB, NULL, 0, 0, NULL, NULL, | |
114 | + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | |
115 | + HTON_NO_FLAGS }; | |
116 | +#endif | |
117 | #ifdef HAVE_INNOBASE_DB | |
118 | #include "ha_innodb.h" | |
119 | extern handlerton innobase_hton; | |
120 | @@ -147,6 +156,7 @@ | |
121 | &example_hton, | |
122 | &archive_hton, | |
123 | &tina_hton, | |
124 | + &sphinx_hton, | |
125 | &ndbcluster_hton, | |
126 | &federated_hton, | |
127 | &myisammrg_hton, | |
128 | @@ -345,6 +355,12 @@ | |
129 | return new (alloc) ha_tina(table); | |
130 | return NULL; | |
131 | #endif | |
132 | +#ifdef HAVE_SPHINX_DB | |
133 | + case DB_TYPE_SPHINX_DB: | |
134 | + if (have_sphinx_db == SHOW_OPTION_YES) | |
135 | + return new (alloc) ha_sphinx(table); | |
136 | + return NULL; | |
137 | +#endif | |
138 | #ifdef HAVE_NDBCLUSTER_DB | |
139 | case DB_TYPE_NDBCLUSTER: | |
140 | if (have_ndbcluster == SHOW_OPTION_YES) | |
141 | diff -B -N -r -u mysql-5.0.22/sql/handler.h mysql-5.0.22.sx/sql/handler.h | |
142 | --- mysql-5.0.22/sql/handler.h 2006-05-25 10:56:55.000000000 +0200 | |
143 | +++ mysql-5.0.22.sx/sql/handler.h 2006-06-06 19:49:38.000000000 +0200 | |
144 | @@ -183,8 +183,9 @@ | |
145 | DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB, | |
146 | DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER, | |
147 | DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_CSV_DB, | |
148 | - DB_TYPE_FEDERATED_DB, | |
149 | + DB_TYPE_FEDERATED_DB, | |
150 | DB_TYPE_BLACKHOLE_DB, | |
151 | + DB_TYPE_SPHINX_DB, | |
152 | DB_TYPE_DEFAULT // Must be last | |
153 | }; | |
154 | ||
155 | diff -B -N -r -u mysql-5.0.22/sql/Makefile.am mysql-5.0.22.sx/sql/Makefile.am | |
156 | --- mysql-5.0.22/sql/Makefile.am 2006-05-25 10:56:41.000000000 +0200 | |
157 | +++ mysql-5.0.22.sx/sql/Makefile.am 2006-06-06 19:49:38.000000000 +0200 | |
158 | @@ -66,6 +66,7 @@ | |
159 | sql_array.h sql_cursor.h \ | |
160 | examples/ha_example.h ha_archive.h \ | |
161 | examples/ha_tina.h ha_blackhole.h \ | |
162 | + sphinx/ha_sphinx.h \ | |
163 | ha_federated.h | |
164 | mysqld_SOURCES = sql_lex.cc sql_handler.cc \ | |
165 | item.cc item_sum.cc item_buff.cc item_func.cc \ | |
166 | @@ -102,6 +103,7 @@ | |
167 | sp_cache.cc parse_file.cc sql_trigger.cc \ | |
168 | examples/ha_example.cc ha_archive.cc \ | |
169 | examples/ha_tina.cc ha_blackhole.cc \ | |
170 | + sphinx/ha_sphinx.cc \ | |
171 | ha_federated.cc | |
172 | ||
173 | gen_lex_hash_SOURCES = gen_lex_hash.cc | |
174 | diff -B -N -r -u mysql-5.0.22/sql/mysqld.cc mysql-5.0.22.sx/sql/mysqld.cc | |
175 | --- mysql-5.0.22/sql/mysqld.cc 2006-05-25 10:56:41.000000000 +0200 | |
176 | +++ mysql-5.0.22.sx/sql/mysqld.cc 2006-06-06 19:49:38.000000000 +0200 | |
177 | @@ -6420,6 +6420,11 @@ | |
178 | #else | |
179 | have_csv_db= SHOW_OPTION_NO; | |
180 | #endif | |
181 | +#ifdef HAVE_SPHINX_DB | |
182 | + have_sphinx_db= SHOW_OPTION_YES; | |
183 | +#else | |
184 | + have_sphinx_db= SHOW_OPTION_NO; | |
185 | +#endif | |
186 | #ifdef HAVE_NDBCLUSTER_DB | |
187 | have_ndbcluster=SHOW_OPTION_DISABLED; | |
188 | #else | |
189 | @@ -7457,6 +7462,7 @@ | |
190 | #undef have_example_db | |
191 | #undef have_archive_db | |
192 | #undef have_csv_db | |
193 | +#undef have_sphinx_db | |
194 | #undef have_federated_db | |
195 | #undef have_partition_db | |
196 | #undef have_blackhole_db | |
197 | @@ -7467,6 +7473,7 @@ | |
198 | SHOW_COMP_OPTION have_example_db= SHOW_OPTION_NO; | |
199 | SHOW_COMP_OPTION have_archive_db= SHOW_OPTION_NO; | |
200 | SHOW_COMP_OPTION have_csv_db= SHOW_OPTION_NO; | |
201 | +SHOW_COMP_OPTION have_sphinx_db= SHOW_OPTION_NO; | |
202 | SHOW_COMP_OPTION have_federated_db= SHOW_OPTION_NO; | |
203 | SHOW_COMP_OPTION have_partition_db= SHOW_OPTION_NO; | |
204 | SHOW_COMP_OPTION have_blackhole_db= SHOW_OPTION_NO; | |
205 | diff -B -N -r -u mysql-5.0.22/sql/mysql_priv.h mysql-5.0.22.sx/sql/mysql_priv.h | |
206 | --- mysql-5.0.22/sql/mysql_priv.h 2006-05-25 10:56:43.000000000 +0200 | |
207 | +++ mysql-5.0.22.sx/sql/mysql_priv.h 2006-06-06 19:49:38.000000000 +0200 | |
208 | @@ -1279,6 +1279,12 @@ | |
209 | #else | |
210 | extern SHOW_COMP_OPTION have_csv_db; | |
211 | #endif | |
212 | +#ifdef HAVE_SPHINX_DB | |
213 | +extern handlerton sphinx_hton; | |
214 | +#define have_sphinx_db sphinx_hton.state | |
215 | +#else | |
216 | +extern SHOW_COMP_OPTION have_sphinx_db; | |
217 | +#endif | |
218 | #ifdef HAVE_FEDERATED_DB | |
219 | extern handlerton federated_hton; | |
220 | #define have_federated_db federated_hton.state | |
221 | diff -B -N -r -u mysql-5.0.22/sql/set_var.cc mysql-5.0.22.sx/sql/set_var.cc | |
222 | --- mysql-5.0.22/sql/set_var.cc 2006-05-25 10:56:41.000000000 +0200 | |
223 | +++ mysql-5.0.22.sx/sql/set_var.cc 2006-06-06 19:49:38.000000000 +0200 | |
224 | @@ -864,6 +864,7 @@ | |
225 | {"have_compress", (char*) &have_compress, SHOW_HAVE}, | |
226 | {"have_crypt", (char*) &have_crypt, SHOW_HAVE}, | |
227 | {"have_csv", (char*) &have_csv_db, SHOW_HAVE}, | |
228 | + {"have_sphinx", (char*) &have_sphinx_db, SHOW_HAVE}, | |
229 | {"have_dynamic_loading", (char*) &have_dlopen, SHOW_HAVE}, | |
230 | {"have_example_engine", (char*) &have_example_db, SHOW_HAVE}, | |
231 | {"have_federated_engine", (char*) &have_federated_db, SHOW_HAVE}, | |
232 | diff -B -N -r -u mysql-5.0.22/sql/sql_lex.h mysql-5.0.22.sx/sql/sql_lex.h | |
233 | --- mysql-5.0.22/sql/sql_lex.h 2006-05-25 10:56:41.000000000 +0200 | |
234 | +++ mysql-5.0.22.sx/sql/sql_lex.h 2006-06-06 19:49:38.000000000 +0200 | |
235 | @@ -58,6 +58,7 @@ | |
236 | SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS, | |
237 | SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_LOGS, SQLCOM_SHOW_STATUS, | |
238 | SQLCOM_SHOW_INNODB_STATUS, SQLCOM_SHOW_NDBCLUSTER_STATUS, SQLCOM_SHOW_MUTEX_STATUS, | |
239 | + SQLCOM_SHOW_SPHINX_STATUS, | |
240 | SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT, | |
241 | SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS, | |
242 | SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS, | |
243 | diff -B -N -r -u mysql-5.0.22/sql/sql_parse.cc mysql-5.0.22.sx/sql/sql_parse.cc | |
244 | --- mysql-5.0.22/sql/sql_parse.cc 2006-05-25 10:56:41.000000000 +0200 | |
245 | +++ mysql-5.0.22.sx/sql/sql_parse.cc 2006-06-06 19:49:38.000000000 +0200 | |
246 | @@ -25,6 +25,9 @@ | |
247 | #ifdef HAVE_INNOBASE_DB | |
248 | #include "ha_innodb.h" | |
249 | #endif | |
250 | +#ifdef HAVE_SPHINX_DB | |
251 | +#include "sphinx/ha_sphinx.h" | |
252 | +#endif | |
253 | ||
254 | #ifdef HAVE_NDBCLUSTER_DB | |
255 | #include "ha_ndbcluster.h" | |
256 | @@ -2722,6 +2725,15 @@ | |
257 | break; | |
258 | } | |
259 | #endif | |
260 | +#ifdef HAVE_SPHINX_DB | |
261 | + case SQLCOM_SHOW_SPHINX_STATUS: | |
262 | + { | |
263 | + if (check_global_access(thd, SUPER_ACL)) | |
264 | + goto error; | |
265 | + res = sphinx_show_status(thd); | |
266 | + break; | |
267 | + } | |
268 | +#endif | |
269 | #ifdef HAVE_REPLICATION | |
270 | case SQLCOM_LOAD_MASTER_TABLE: | |
271 | { | |
272 | diff -B -N -r -u mysql-5.0.22/sql/sql_yacc.yy mysql-5.0.22.sx/sql/sql_yacc.yy | |
273 | --- mysql-5.0.22/sql/sql_yacc.yy 2006-05-25 10:56:43.000000000 +0200 | |
274 | +++ mysql-5.0.22.sx/sql/sql_yacc.yy 2006-06-06 19:49:38.000000000 +0200 | |
275 | @@ -6584,6 +6584,9 @@ | |
276 | case DB_TYPE_INNODB: | |
277 | Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS; | |
278 | break; | |
279 | + case DB_TYPE_SPHINX_DB: | |
280 | + Lex->sql_command = SQLCOM_SHOW_SPHINX_STATUS; | |
281 | + break; | |
282 | default: | |
283 | my_error(ER_NOT_SUPPORTED_YET, MYF(0), "STATUS"); | |
284 | YYABORT; |