]> git.pld-linux.org Git - packages/mysql.git/blob - mysql-sphinx.patch
- expire-logs-days sample
[packages/mysql.git] / mysql-sphinx.patch
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
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 -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
38 @@ -45,6 +45,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 @@ -2532,6 +2533,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 -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
57 @@ -29,6 +29,7 @@
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@
64  
65 @@ -39,6 +40,7 @@
66  libmysqlsources =      errmsg.c get_password.c libmysql.c client.c pack.c \
67                          my_time.c
68  sqlexamplessources =   ha_example.cc ha_tina.cc
69 +sqlsphinxsources =     ha_sphinx.cc
70  
71  noinst_HEADERS =       embedded_priv.h emb_qcache.h
72  
73 @@ -67,7 +69,7 @@
74         parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
75         ha_blackhole.cc ha_archive.cc my_user.c
76  
77 -libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
78 +libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) $(sqlsphinxsources)
79  libmysqld_a_SOURCES=
80  
81  # automake misses these
82 @@ -147,12 +149,16 @@
83             rm -f $$f; \
84             @LN_CP_F@ $(top_srcdir)/sql/examples/$$f $$f; \
85           done; \
86 +         for f in $(sqlsphinxsources); do \
87 +           rm -f $$f; \
88 +           @LN_CP_F@ $(top_srcdir)/sql/sphinx/$$f $$f; \
89 +         done; \
90           rm -f client_settings.h; \
91           @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h client_settings.h
92  
93  
94  clean-local:
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
99  
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
103 @@ -77,6 +77,15 @@
104    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
105    HTON_NO_FLAGS };
106  #endif
107 +#ifdef HAVE_SPHINX_DB
108 +#include "sphinx/ha_sphinx.h"
109 +extern handlerton sphinx_hton;
110 +#else
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,
114 +  HTON_NO_FLAGS };
115 +#endif
116  #ifdef HAVE_INNOBASE_DB
117  #include "ha_innodb.h"
118  extern handlerton innobase_hton;
119 @@ -146,6 +155,7 @@
120    &example_hton,
121    &archive_hton,
122    &tina_hton,
123 +  &sphinx_hton,
124    &ndbcluster_hton,
125    &federated_hton,
126    &myisammrg_hton,
127 @@ -346,6 +356,12 @@
128        return new (alloc) ha_tina(table);
129      return NULL;
130  #endif
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);
135 +    return NULL;
136 +#endif
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
143 @@ -184,8 +184,9 @@
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,
150 +  DB_TYPE_SPHINX_DB,
151    DB_TYPE_DEFAULT // Must be last
152  };
153  
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
157 @@ -67,6 +67,7 @@
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 \
162                         ha_federated.h
163  mysqld_SOURCES =       sql_lex.cc sql_handler.cc \
164                         item.cc item_sum.cc item_buff.cc item_func.cc \
165 @@ -104,6 +105,7 @@
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 \
170                         ha_federated.cc
171  
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 @@
177  #else
178    have_csv_db= SHOW_OPTION_NO;
179  #endif
180 +#ifdef HAVE_SPHINX_DB
181 +  have_sphinx_db= SHOW_OPTION_YES;
182 +#else
183 +  have_sphinx_db= SHOW_OPTION_NO;
184 +#endif
185  #ifdef HAVE_NDBCLUSTER_DB
186    have_ndbcluster=SHOW_OPTION_DISABLED;
187  #else
188 @@ -7596,6 +7601,7 @@
189  #undef have_example_db
190  #undef have_archive_db
191  #undef have_csv_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 @@
208  #else
209  extern SHOW_COMP_OPTION have_csv_db;
210  #endif
211 +#ifdef HAVE_SPHINX_DB
212 +extern handlerton sphinx_hton;
213 +#define have_sphinx_db sphinx_hton.state
214 +#else
215 +extern SHOW_COMP_OPTION have_sphinx_db;
216 +#endif
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
223 @@ -868,6 +868,7 @@
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
234 @@ -57,6 +57,7 @@
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
245 @@ -24,6 +24,9 @@
246  #ifdef HAVE_INNOBASE_DB
247  #include "ha_innodb.h"
248  #endif
249 +#ifdef HAVE_SPHINX_DB
250 +#include "sphinx/ha_sphinx.h"
251 +#endif
252  
253  #ifdef HAVE_NDBCLUSTER_DB
254  #include "ha_ndbcluster.h"
255 @@ -2882,6 +2885,15 @@
256        break;
257      }
258  #endif
259 +#ifdef HAVE_SPHINX_DB
260 +  case SQLCOM_SHOW_SPHINX_STATUS:
261 +    {
262 +      if (check_global_access(thd, SUPER_ACL))
263 +       goto error;
264 +      res = sphinx_show_status(thd);
265 +      break;
266 +    }
267 +#endif
268  #ifdef HAVE_REPLICATION
269    case SQLCOM_LOAD_MASTER_TABLE:
270    {
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 @@
275             case DB_TYPE_INNODB:
276               Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;
277               break;
278 +           case DB_TYPE_SPHINX_DB:
279 +             Lex->sql_command = SQLCOM_SHOW_SPHINX_STATUS;
280 +             break;
281             default:
282               my_error(ER_NOT_SUPPORTED_YET, MYF(0), "STATUS");
283               YYABORT;
This page took 0.059774 seconds and 3 git commands to generate.