1 --- mysql-5.0.67/config/ac-macros/ha_sphinx.m4 1970-01-01 10:00:00.000000000 +1000
2 +++ mysql-5.0.67-sphinx/config/ac-macros/ha_sphinx.m4 2009-02-14 09:15:48.000000000 +1000
4 +dnl ---------------------------------------------------------------------------
5 +dnl Macro: MYSQL_CHECK_EXAMPLEDB
6 +dnl Sets HAVE_SPHINX_DB if --with-sphinx-storage-engine is used
7 +dnl ---------------------------------------------------------------------------
8 +AC_DEFUN([MYSQL_CHECK_SPHINXDB], [
9 + AC_ARG_WITH([sphinx-storage-engine],
11 + --with-sphinx-storage-engine
12 + Enable the Sphinx Storage Engine],
13 + [sphinxdb="$withval"],
15 + AC_MSG_CHECKING([for example storage engine])
19 + AC_DEFINE([HAVE_SPHINX_DB], [1], [Builds Sphinx Engine])
20 + AC_MSG_RESULT([yes])
30 +dnl ---------------------------------------------------------------------------
31 +dnl END OF MYSQL_CHECK_EXAMPLE SECTION
32 +dnl ---------------------------------------------------------------------------
34 --- mysql-5.0.67/configure.in 2008-08-04 23:19:07.000000000 +1100
35 +++ mysql-5.0.67-sphinx/configure.in 2009-02-14 09:15:48.000000000 +1000
37 sinclude(config/ac-macros/ha_berkeley.m4)
38 sinclude(config/ac-macros/ha_blackhole.m4)
39 sinclude(config/ac-macros/ha_example.m4)
40 +sinclude(config/ac-macros/ha_sphinx.m4)
41 sinclude(config/ac-macros/ha_federated.m4)
42 sinclude(config/ac-macros/ha_innodb.m4)
43 sinclude(config/ac-macros/ha_ndbcluster.m4)
51 MYSQL_CHECK_BLACKHOLEDB
52 --- mysql-5.0.67/libmysqld/Makefile.am 2008-08-04 23:19:18.000000000 +1100
53 +++ mysql-5.0.67-sphinx/libmysqld/Makefile.am 2009-02-14 09:15:48.000000000 +1000
55 -I$(top_builddir)/include -I$(top_srcdir)/include \
56 -I$(top_builddir)/sql -I$(top_srcdir)/sql \
57 -I$(top_srcdir)/sql/examples \
58 + -I$(top_srcdir)/sql/sphinx \
59 -I$(top_srcdir)/regex \
60 $(openssl_includes) @ZLIB_INCLUDES@
63 libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
65 sqlexamplessources = ha_example.cc ha_tina.cc
66 +sqlsphinxsources = ha_sphinx.cc
68 noinst_HEADERS = embedded_priv.h emb_qcache.h
71 parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
72 ha_blackhole.cc ha_archive.cc my_user.c
74 -libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
75 +libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) $(sqlsphinxsources)
78 # automake misses these
81 @LN_CP_F@ $(top_srcdir)/sql/examples/$$f $$f; \
83 + for f in $(sqlsphinxsources); do \
85 + @LN_CP_F@ $(top_srcdir)/sql/sphinx/$$f $$f; \
87 rm -f client_settings.h; \
88 @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h client_settings.h
92 - rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \
93 + rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) $(sqlsphinxsources) | sed "s;\.lo;.c;g"` \
94 $(top_srcdir)/linked_libmysqld_sources; \
95 rm -f client_settings.h
97 --- mysql-5.0.67/sql/handler.cc 2008-08-04 23:20:04.000000000 +1100
98 +++ mysql-5.0.67-sphinx/sql/handler.cc 2009-02-14 09:15:48.000000000 +1000
100 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
103 +#ifdef HAVE_SPHINX_DB
104 +#include "sphinx/ha_sphinx.h"
105 +extern handlerton sphinx_hton;
107 +handlerton sphinx_hton = { "SPHINX", SHOW_OPTION_NO, "SPHINX storage engine",
108 + DB_TYPE_SPHINX_DB, NULL, 0, 0, NULL, NULL,
109 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
112 #ifdef HAVE_INNOBASE_DB
113 #include "ha_innodb.h"
114 extern handlerton innobase_hton;
124 return new (alloc) ha_tina(table);
127 +#ifdef HAVE_SPHINX_DB
128 + case DB_TYPE_SPHINX_DB:
129 + if (have_sphinx_db == SHOW_OPTION_YES)
130 + return new (alloc) ha_sphinx(table);
133 #ifdef HAVE_NDBCLUSTER_DB
134 case DB_TYPE_NDBCLUSTER:
135 if (have_ndbcluster == SHOW_OPTION_YES)
136 --- mysql-5.0.67/sql/handler.h 2008-08-04 23:20:04.000000000 +1100
137 +++ mysql-5.0.67-sphinx/sql/handler.h 2009-02-14 09:15:48.000000000 +1000
139 DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB,
140 DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER,
141 DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_CSV_DB,
142 - DB_TYPE_FEDERATED_DB,
143 + DB_TYPE_FEDERATED_DB,
144 DB_TYPE_BLACKHOLE_DB,
146 DB_TYPE_DEFAULT // Must be last
149 --- mysql-5.0.67/sql/Makefile.am 2008-08-04 23:20:02.000000000 +1100
150 +++ mysql-5.0.67-sphinx/sql/Makefile.am 2009-02-14 09:23:28.000000000 +1000
152 sql_array.h sql_cursor.h \
153 examples/ha_example.h ha_archive.h \
154 examples/ha_tina.h ha_blackhole.h \
155 + sphinx/ha_sphinx.h \
157 mysqld_SOURCES = sql_lex.cc sql_handler.cc \
158 item.cc item_sum.cc item_buff.cc item_func.cc \
160 sp_cache.cc parse_file.cc sql_trigger.cc \
161 examples/ha_example.cc ha_archive.cc \
162 examples/ha_tina.cc ha_blackhole.cc \
163 + sphinx/ha_sphinx.cc \
166 gen_lex_hash_SOURCES = gen_lex_hash.cc
168 udf_example_la_SOURCES= udf_example.c
169 udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
171 +pkglib_LTLIBRARIES = sphinx/sphinx.la
172 +sphinx_sphinx_la_SOURCES = sphinx/snippets_udf.cc
173 +sphinx_sphinx_la_LDFLAGS = -module
176 # Don't update the files from bitkeeper
178 --- mysql-5.0.67/sql/mysqld.cc 2008-08-04 23:20:07.000000000 +1100
179 +++ mysql-5.0.67-sphinx/sql/mysqld.cc 2009-02-14 09:15:48.000000000 +1000
181 #include <sys/prctl.h>
184 +#ifdef HAVE_SPHINX_DB
185 +#include "sphinx/ha_sphinx.h"
188 #ifdef HAVE_INNOBASE_DB
189 #define OPT_INNODB_DEFAULT 1
191 @@ -6633,6 +6637,13 @@
192 {"Threads_running", (char*) &thread_running, SHOW_INT_CONST},
193 {"Uptime", (char*) 0, SHOW_STARTTIME},
194 {"Uptime_since_flush_status",(char*) 0, SHOW_FLUSHTIME},
195 +#ifdef HAVE_SPHINX_DB
196 + {"sphinx_total", (char *)sphinx_showfunc_total, SHOW_SPHINX_FUNC},
197 + {"sphinx_total_found", (char *)sphinx_showfunc_total_found, SHOW_SPHINX_FUNC},
198 + {"sphinx_time", (char *)sphinx_showfunc_time, SHOW_SPHINX_FUNC},
199 + {"sphinx_word_count", (char *)sphinx_showfunc_word_count, SHOW_SPHINX_FUNC},
200 + {"sphinx_words", (char *)sphinx_showfunc_words, SHOW_SPHINX_FUNC},
202 {NullS, NullS, SHOW_LONG}
205 @@ -6875,6 +6886,11 @@
207 have_csv_db= SHOW_OPTION_NO;
209 +#ifdef HAVE_SPHINX_DB
210 + have_sphinx_db= SHOW_OPTION_YES;
212 + have_sphinx_db= SHOW_OPTION_NO;
214 #ifdef HAVE_NDBCLUSTER_DB
215 have_ndbcluster=SHOW_OPTION_DISABLED;
217 @@ -7983,6 +7999,7 @@
218 #undef have_example_db
219 #undef have_archive_db
221 +#undef have_sphinx_db
222 #undef have_federated_db
223 #undef have_partition_db
224 #undef have_blackhole_db
225 @@ -7993,6 +8010,7 @@
226 SHOW_COMP_OPTION have_example_db= SHOW_OPTION_NO;
227 SHOW_COMP_OPTION have_archive_db= SHOW_OPTION_NO;
228 SHOW_COMP_OPTION have_csv_db= SHOW_OPTION_NO;
229 +SHOW_COMP_OPTION have_sphinx_db= SHOW_OPTION_NO;
230 SHOW_COMP_OPTION have_federated_db= SHOW_OPTION_NO;
231 SHOW_COMP_OPTION have_partition_db= SHOW_OPTION_NO;
232 SHOW_COMP_OPTION have_blackhole_db= SHOW_OPTION_NO;
233 --- mysql-5.0.67/sql/mysql_priv.h 2008-08-04 23:20:07.000000000 +1100
234 +++ mysql-5.0.67-sphinx/sql/mysql_priv.h 2009-02-14 09:15:48.000000000 +1000
235 @@ -1439,6 +1439,12 @@
237 extern SHOW_COMP_OPTION have_csv_db;
239 +#ifdef HAVE_SPHINX_DB
240 +extern handlerton sphinx_hton;
241 +#define have_sphinx_db sphinx_hton.state
243 +extern SHOW_COMP_OPTION have_sphinx_db;
245 #ifdef HAVE_FEDERATED_DB
246 extern handlerton federated_hton;
247 #define have_federated_db federated_hton.state
248 --- mysql-5.0.67/sql/set_var.cc 2008-08-04 23:20:08.000000000 +1100
249 +++ mysql-5.0.67-sphinx/sql/set_var.cc 2009-02-14 09:15:48.000000000 +1000
251 {"have_compress", (char*) &have_compress, SHOW_HAVE},
252 {"have_crypt", (char*) &have_crypt, SHOW_HAVE},
253 {"have_csv", (char*) &have_csv_db, SHOW_HAVE},
254 + {"have_sphinx", (char*) &have_sphinx_db, SHOW_HAVE},
255 {"have_dynamic_loading", (char*) &have_dlopen, SHOW_HAVE},
256 {"have_example_engine", (char*) &have_example_db, SHOW_HAVE},
257 {"have_federated_engine", (char*) &have_federated_db, SHOW_HAVE},
258 --- mysql-5.0.67/sql/sql_lex.h 2008-08-04 23:20:10.000000000 +1100
259 +++ mysql-5.0.67-sphinx/sql/sql_lex.h 2009-02-14 09:15:48.000000000 +1000
261 SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
262 SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_LOGS, SQLCOM_SHOW_STATUS,
263 SQLCOM_SHOW_INNODB_STATUS, SQLCOM_SHOW_NDBCLUSTER_STATUS, SQLCOM_SHOW_MUTEX_STATUS,
264 + SQLCOM_SHOW_SPHINX_STATUS,
265 SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
266 SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS,
267 SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS,
268 --- mysql-5.0.67/sql/sql_parse.cc 2008-08-04 23:20:10.000000000 +1100
269 +++ mysql-5.0.67-sphinx/sql/sql_parse.cc 2009-02-14 09:15:48.000000000 +1000
271 #ifdef HAVE_INNOBASE_DB
272 #include "ha_innodb.h"
274 +#ifdef HAVE_SPHINX_DB
275 +#include "sphinx/ha_sphinx.h"
278 #ifdef HAVE_NDBCLUSTER_DB
279 #include "ha_ndbcluster.h"
280 @@ -3006,6 +3009,15 @@
284 +#ifdef HAVE_SPHINX_DB
285 + case SQLCOM_SHOW_SPHINX_STATUS:
287 + if (check_global_access(thd, SUPER_ACL))
289 + res = sphinx_show_status(thd);
293 #ifdef HAVE_REPLICATION
294 case SQLCOM_LOAD_MASTER_TABLE:
296 --- mysql-5.0.67/sql/sql_yacc.yy 2008-08-04 23:20:12.000000000 +1100
297 +++ mysql-5.0.67-sphinx/sql/sql_yacc.yy 2009-02-14 09:15:48.000000000 +1000
298 @@ -7393,6 +7393,9 @@
300 Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;
302 + case DB_TYPE_SPHINX_DB:
303 + Lex->sql_command = SQLCOM_SHOW_SPHINX_STATUS;
306 my_error(ER_NOT_SUPPORTED_YET, MYF(0), "STATUS");
308 --- mysql-5.0.67/sql/structs.h 2008-08-04 23:20:12.000000000 +1100
309 +++ mysql-5.0.67-sphinx/sql/structs.h 2009-02-14 09:15:48.000000000 +1000
311 SHOW_SSL_CTX_SESS_TIMEOUTS, SHOW_SSL_CTX_SESS_CACHE_FULL,
312 SHOW_SSL_GET_CIPHER_LIST,
313 #endif /* HAVE_OPENSSL */
314 +#ifdef HAVE_SPHINX_DB
317 SHOW_NET_COMPRESSION,
318 SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING, SHOW_SLAVE_RETRIED_TRANS,
319 SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_CONST_LONG, SHOW_KEY_CACHE_LONGLONG,
320 --- mysql-5.0.67/sql/sql_show.cc 2008-08-04 23:20:11.000000000 +1100
321 +++ mysql-5.0.67-sphinx/sql/sql_show.cc 2009-02-14 09:15:48.000000000 +1000
322 @@ -1473,6 +1473,16 @@
323 value= (char*) ((sys_var*) value)->value_ptr(thd, value_type,
326 + #ifdef HAVE_SPHINX_DB
327 + else if (show_type == SHOW_SPHINX_FUNC)
330 + ((int (*)(THD *, SHOW_VAR *, char *))value)(thd, &var, buff);
333 + show_type = var.type;
335 + #endif /* HAVE_SPHINX_DB */