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
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 -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
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 -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
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@
67 libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
69 sqlexamplessources = ha_example.cc ha_tina.cc
70 +sqlsphinxsources = ha_sphinx.cc
72 noinst_HEADERS = embedded_priv.h emb_qcache.h
75 parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
76 ha_blackhole.cc ha_archive.cc my_user.c
78 -libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
79 +libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) $(sqlsphinxsources)
82 # automake misses these
85 @LN_CP_F@ $(top_srcdir)/sql/examples/$$f $$f; \
87 + for f in $(sqlsphinxsources); do \
89 + @LN_CP_F@ $(top_srcdir)/sql/sphinx/$$f $$f; \
91 rm -f client_settings.h; \
92 @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h client_settings.h
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
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
105 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
108 +#ifdef HAVE_SPHINX_DB
109 +#include "sphinx/ha_sphinx.h"
110 +extern handlerton sphinx_hton;
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,
117 #ifdef HAVE_INNOBASE_DB
118 #include "ha_innodb.h"
119 extern handlerton innobase_hton;
129 return new (alloc) ha_tina(table);
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);
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
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,
152 DB_TYPE_DEFAULT // Must be last
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
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 \
164 mysqld_SOURCES = sql_lex.cc sql_handler.cc \
165 item.cc item_sum.cc item_buff.cc item_func.cc \
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 \
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 @@
179 have_csv_db= SHOW_OPTION_NO;
181 +#ifdef HAVE_SPHINX_DB
182 + have_sphinx_db= SHOW_OPTION_YES;
184 + have_sphinx_db= SHOW_OPTION_NO;
186 #ifdef HAVE_NDBCLUSTER_DB
187 have_ndbcluster=SHOW_OPTION_DISABLED;
189 @@ -7457,6 +7462,7 @@
190 #undef have_example_db
191 #undef have_archive_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 @@
210 extern SHOW_COMP_OPTION have_csv_db;
212 +#ifdef HAVE_SPHINX_DB
213 +extern handlerton sphinx_hton;
214 +#define have_sphinx_db sphinx_hton.state
216 +extern SHOW_COMP_OPTION have_sphinx_db;
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
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
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
247 #ifdef HAVE_INNOBASE_DB
248 #include "ha_innodb.h"
250 +#ifdef HAVE_SPHINX_DB
251 +#include "sphinx/ha_sphinx.h"
254 #ifdef HAVE_NDBCLUSTER_DB
255 #include "ha_ndbcluster.h"
256 @@ -2722,6 +2725,15 @@
260 +#ifdef HAVE_SPHINX_DB
261 + case SQLCOM_SHOW_SPHINX_STATUS:
263 + if (check_global_access(thd, SUPER_ACL))
265 + res = sphinx_show_status(thd);
269 #ifdef HAVE_REPLICATION
270 case SQLCOM_LOAD_MASTER_TABLE:
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 @@
277 Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;
279 + case DB_TYPE_SPHINX_DB:
280 + Lex->sql_command = SQLCOM_SHOW_SPHINX_STATUS;
283 my_error(ER_NOT_SUPPORTED_YET, MYF(0), "STATUS");