1 diff -BNru mysql-5.0.37/config/ac-macros/ha_sphinx.m4 mysql-5.0.37-sphinx/config/ac-macros/ha_sphinx.m4
2 --- mysql-5.0.37/config/ac-macros/ha_sphinx.m4 1969-12-31 16:00:00.000000000 -0800
3 +++ mysql-5.0.37-sphinx/config/ac-macros/ha_sphinx.m4 2007-04-01 15:35:16.000000000 -0700
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],
12 + --with-sphinx-storage-engine
13 + Enable the Sphinx Storage Engine],
14 + [sphinxdb="$withval"],
16 + AC_MSG_CHECKING([for example storage engine])
20 + AC_DEFINE([HAVE_SPHINX_DB], [1], [Builds Sphinx Engine])
21 + AC_MSG_RESULT([yes])
31 +dnl ---------------------------------------------------------------------------
32 +dnl END OF MYSQL_CHECK_EXAMPLE SECTION
33 +dnl ---------------------------------------------------------------------------
35 diff -BNru mysql-5.0.37/configure.in mysql-5.0.37-sphinx/configure.in
36 --- mysql-5.0.37/configure.in 2007-03-05 11:21:13.000000000 -0800
37 +++ mysql-5.0.37-sphinx/configure.in 2007-04-01 15:35:16.000000000 -0700
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)
53 MYSQL_CHECK_BLACKHOLEDB
54 diff -BNru mysql-5.0.37/libmysqld/Makefile.am mysql-5.0.37-sphinx/libmysqld/Makefile.am
55 --- mysql-5.0.37/libmysqld/Makefile.am 2007-03-05 11:21:41.000000000 -0800
56 +++ mysql-5.0.37-sphinx/libmysqld/Makefile.am 2007-04-01 15:35:54.000000000 -0700
58 -I$(top_builddir)/include -I$(top_srcdir)/include \
59 -I$(top_builddir)/sql -I$(top_srcdir)/sql \
60 -I$(top_srcdir)/sql/examples \
61 + -I$(top_srcdir)/sql/sphinx \
62 -I$(top_srcdir)/regex \
63 $(openssl_includes) @ZLIB_INCLUDES@
66 libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
68 sqlexamplessources = ha_example.cc ha_tina.cc
69 +sqlsphinxsources = ha_sphinx.cc
71 noinst_HEADERS = embedded_priv.h emb_qcache.h
74 parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
75 ha_blackhole.cc ha_archive.cc my_user.c
77 -libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
78 +libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) $(sqlsphinxsources)
81 # automake misses these
84 @LN_CP_F@ $(top_srcdir)/sql/examples/$$f $$f; \
86 + for f in $(sqlsphinxsources); do \
88 + @LN_CP_F@ $(top_srcdir)/sql/sphinx/$$f $$f; \
90 rm -f client_settings.h; \
91 @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h client_settings.h
95 - rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \
96 + rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) $(sqlsphinxsources) | sed "s;\.lo;.c;g"` \
97 $(top_srcdir)/linked_libmysqld_sources; \
98 rm -f client_settings.h
100 diff -BNru mysql-5.0.37/sql/handler.cc mysql-5.0.37-sphinx/sql/handler.cc
101 --- mysql-5.0.37/sql/handler.cc 2007-03-05 11:21:13.000000000 -0800
102 +++ mysql-5.0.37-sphinx/sql/handler.cc 2007-04-01 15:35:16.000000000 -0700
104 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
107 +#ifdef HAVE_SPHINX_DB
108 +#include "sphinx/ha_sphinx.h"
109 +extern handlerton sphinx_hton;
111 +handlerton sphinx_hton = { "SPHINX", SHOW_OPTION_NO, "SPHINX storage engine",
112 + DB_TYPE_SPHINX_DB, NULL, 0, 0, NULL, NULL,
113 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
116 #ifdef HAVE_INNOBASE_DB
117 #include "ha_innodb.h"
118 extern handlerton innobase_hton;
128 return new (alloc) ha_tina(table);
131 +#ifdef HAVE_SPHINX_DB
132 + case DB_TYPE_SPHINX_DB:
133 + if (have_sphinx_db == SHOW_OPTION_YES)
134 + return new (alloc) ha_sphinx(table);
137 #ifdef HAVE_NDBCLUSTER_DB
138 case DB_TYPE_NDBCLUSTER:
139 if (have_ndbcluster == SHOW_OPTION_YES)
140 diff -BNru mysql-5.0.37/sql/handler.h mysql-5.0.37-sphinx/sql/handler.h
141 --- mysql-5.0.37/sql/handler.h 2007-03-05 11:21:22.000000000 -0800
142 +++ mysql-5.0.37-sphinx/sql/handler.h 2007-04-01 15:35:16.000000000 -0700
144 DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB,
145 DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER,
146 DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_CSV_DB,
147 - DB_TYPE_FEDERATED_DB,
148 + DB_TYPE_FEDERATED_DB,
149 DB_TYPE_BLACKHOLE_DB,
151 DB_TYPE_DEFAULT // Must be last
154 diff -BNru mysql-5.0.37/sql/Makefile.am mysql-5.0.37-sphinx/sql/Makefile.am
155 --- mysql-5.0.37/sql/Makefile.am 2007-03-05 11:21:40.000000000 -0800
156 +++ mysql-5.0.37-sphinx/sql/Makefile.am 2007-04-01 15:35:16.000000000 -0700
158 sql_array.h sql_cursor.h \
159 examples/ha_example.h ha_archive.h \
160 examples/ha_tina.h ha_blackhole.h \
161 + sphinx/ha_sphinx.h \
163 mysqld_SOURCES = sql_lex.cc sql_handler.cc \
164 item.cc item_sum.cc item_buff.cc item_func.cc \
166 sp_cache.cc parse_file.cc sql_trigger.cc \
167 examples/ha_example.cc ha_archive.cc \
168 examples/ha_tina.cc ha_blackhole.cc \
169 + sphinx/ha_sphinx.cc \
172 gen_lex_hash_SOURCES = gen_lex_hash.cc
173 diff -BNru mysql-5.0.37/sql/mysqld.cc mysql-5.0.37-sphinx/sql/mysqld.cc
174 --- mysql-5.0.37/sql/mysqld.cc 2007-03-05 11:21:11.000000000 -0800
175 +++ mysql-5.0.37-sphinx/sql/mysqld.cc 2007-04-01 15:35:16.000000000 -0700
176 @@ -6542,6 +6542,11 @@
178 have_csv_db= SHOW_OPTION_NO;
180 +#ifdef HAVE_SPHINX_DB
181 + have_sphinx_db= SHOW_OPTION_YES;
183 + have_sphinx_db= SHOW_OPTION_NO;
185 #ifdef HAVE_NDBCLUSTER_DB
186 have_ndbcluster=SHOW_OPTION_DISABLED;
188 @@ -7596,6 +7601,7 @@
189 #undef have_example_db
190 #undef have_archive_db
192 +#undef have_sphinx_db
193 #undef have_federated_db
194 #undef have_partition_db
195 #undef have_blackhole_db
196 @@ -7606,6 +7612,7 @@
197 SHOW_COMP_OPTION have_example_db= SHOW_OPTION_NO;
198 SHOW_COMP_OPTION have_archive_db= SHOW_OPTION_NO;
199 SHOW_COMP_OPTION have_csv_db= SHOW_OPTION_NO;
200 +SHOW_COMP_OPTION have_sphinx_db= SHOW_OPTION_NO;
201 SHOW_COMP_OPTION have_federated_db= SHOW_OPTION_NO;
202 SHOW_COMP_OPTION have_partition_db= SHOW_OPTION_NO;
203 SHOW_COMP_OPTION have_blackhole_db= SHOW_OPTION_NO;
204 diff -BNru mysql-5.0.37/sql/mysql_priv.h mysql-5.0.37-sphinx/sql/mysql_priv.h
205 --- mysql-5.0.37/sql/mysql_priv.h 2007-03-05 11:21:40.000000000 -0800
206 +++ mysql-5.0.37-sphinx/sql/mysql_priv.h 2007-04-01 15:35:16.000000000 -0700
207 @@ -1364,6 +1364,12 @@
209 extern SHOW_COMP_OPTION have_csv_db;
211 +#ifdef HAVE_SPHINX_DB
212 +extern handlerton sphinx_hton;
213 +#define have_sphinx_db sphinx_hton.state
215 +extern SHOW_COMP_OPTION have_sphinx_db;
217 #ifdef HAVE_FEDERATED_DB
218 extern handlerton federated_hton;
219 #define have_federated_db federated_hton.state
220 diff -BNru mysql-5.0.37/sql/set_var.cc mysql-5.0.37-sphinx/sql/set_var.cc
221 --- mysql-5.0.37/sql/set_var.cc 2007-03-05 11:21:24.000000000 -0800
222 +++ mysql-5.0.37-sphinx/sql/set_var.cc 2007-04-01 15:35:16.000000000 -0700
224 {"have_compress", (char*) &have_compress, SHOW_HAVE},
225 {"have_crypt", (char*) &have_crypt, SHOW_HAVE},
226 {"have_csv", (char*) &have_csv_db, SHOW_HAVE},
227 + {"have_sphinx", (char*) &have_sphinx_db, SHOW_HAVE},
228 {"have_dynamic_loading", (char*) &have_dlopen, SHOW_HAVE},
229 {"have_example_engine", (char*) &have_example_db, SHOW_HAVE},
230 {"have_federated_engine", (char*) &have_federated_db, SHOW_HAVE},
231 diff -BNru mysql-5.0.37/sql/sql_lex.h mysql-5.0.37-sphinx/sql/sql_lex.h
232 --- mysql-5.0.37/sql/sql_lex.h 2007-03-05 11:21:05.000000000 -0800
233 +++ mysql-5.0.37-sphinx/sql/sql_lex.h 2007-04-01 15:35:16.000000000 -0700
235 SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
236 SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_LOGS, SQLCOM_SHOW_STATUS,
237 SQLCOM_SHOW_INNODB_STATUS, SQLCOM_SHOW_NDBCLUSTER_STATUS, SQLCOM_SHOW_MUTEX_STATUS,
238 + SQLCOM_SHOW_SPHINX_STATUS,
239 SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
240 SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS,
241 SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS,
242 diff -BNru mysql-5.0.37/sql/sql_parse.cc mysql-5.0.37-sphinx/sql/sql_parse.cc
243 --- mysql-5.0.37/sql/sql_parse.cc 2007-03-05 11:21:40.000000000 -0800
244 +++ mysql-5.0.37-sphinx/sql/sql_parse.cc 2007-04-01 15:35:16.000000000 -0700
246 #ifdef HAVE_INNOBASE_DB
247 #include "ha_innodb.h"
249 +#ifdef HAVE_SPHINX_DB
250 +#include "sphinx/ha_sphinx.h"
253 #ifdef HAVE_NDBCLUSTER_DB
254 #include "ha_ndbcluster.h"
255 @@ -2882,6 +2885,15 @@
259 +#ifdef HAVE_SPHINX_DB
260 + case SQLCOM_SHOW_SPHINX_STATUS:
262 + if (check_global_access(thd, SUPER_ACL))
264 + res = sphinx_show_status(thd);
268 #ifdef HAVE_REPLICATION
269 case SQLCOM_LOAD_MASTER_TABLE:
271 diff -BNru mysql-5.0.37/sql/sql_yacc.yy mysql-5.0.37-sphinx/sql/sql_yacc.yy
272 --- mysql-5.0.37/sql/sql_yacc.yy 2007-03-05 11:21:23.000000000 -0800
273 +++ mysql-5.0.37-sphinx/sql/sql_yacc.yy 2007-04-01 15:35:16.000000000 -0700
274 @@ -7052,6 +7052,9 @@
276 Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;
278 + case DB_TYPE_SPHINX_DB:
279 + Lex->sql_command = SQLCOM_SHOW_SPHINX_STATUS;
282 my_error(ER_NOT_SUPPORTED_YET, MYF(0), "STATUS");