sphinx.5.0.27.diff 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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. @@ -38,6 +38,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. noinst_HEADERS = embedded_priv.h emb_qcache.h
  71. @@ -65,7 +66,7 @@
  72. parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
  73. 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)
  76. libmysqld_a_SOURCES=
  77. # automake misses these
  78. @@ -133,12 +134,16 @@
  79. rm -f $$f; \
  80. @LN_CP_F@ $(top_srcdir)/sql/examples/$$f $$f; \
  81. done; \
  82. + for f in $(sqlsphinxsources); do \
  83. + rm -f $$f; \
  84. + @LN_CP_F@ $(top_srcdir)/sql/sphinx/$$f $$f; \
  85. + done; \
  86. rm -f client_settings.h; \
  87. @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h client_settings.h
  88. clean-local:
  89. - rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \
  90. + rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) $(sqlsphinxsources) | sed "s;\.lo;.c;g"` \
  91. $(top_srcdir)/linked_libmysqld_sources; \
  92. rm -f client_settings.h
  93. diff -B -N -r -u mysql-5.0.22/sql/handler.cc mysql-5.0.22.sx/sql/handler.cc
  94. --- mysql-5.0.22/sql/handler.cc 2006-05-25 10:56:42.000000000 +0200
  95. +++ mysql-5.0.22.sx/sql/handler.cc 2006-06-06 19:49:38.000000000 +0200
  96. @@ -78,6 +78,15 @@
  97. NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  98. HTON_NO_FLAGS };
  99. #endif
  100. +#ifdef HAVE_SPHINX_DB
  101. +#include "sphinx/ha_sphinx.h"
  102. +extern handlerton sphinx_hton;
  103. +#else
  104. +handlerton sphinx_hton = { "SPHINX", SHOW_OPTION_NO, "SPHINX storage engine",
  105. + DB_TYPE_SPHINX_DB, NULL, 0, 0, NULL, NULL,
  106. + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  107. + HTON_NO_FLAGS };
  108. +#endif
  109. #ifdef HAVE_INNOBASE_DB
  110. #include "ha_innodb.h"
  111. extern handlerton innobase_hton;
  112. @@ -147,6 +156,7 @@
  113. &example_hton,
  114. &archive_hton,
  115. &tina_hton,
  116. + &sphinx_hton,
  117. &ndbcluster_hton,
  118. &federated_hton,
  119. &myisammrg_hton,
  120. @@ -345,6 +355,12 @@
  121. return new (alloc) ha_tina(table);
  122. return NULL;
  123. #endif
  124. +#ifdef HAVE_SPHINX_DB
  125. + case DB_TYPE_SPHINX_DB:
  126. + if (have_sphinx_db == SHOW_OPTION_YES)
  127. + return new (alloc) ha_sphinx(table);
  128. + return NULL;
  129. +#endif
  130. #ifdef HAVE_NDBCLUSTER_DB
  131. case DB_TYPE_NDBCLUSTER:
  132. if (have_ndbcluster == SHOW_OPTION_YES)
  133. diff -B -N -r -u mysql-5.0.22/sql/handler.h mysql-5.0.22.sx/sql/handler.h
  134. --- mysql-5.0.22/sql/handler.h 2006-05-25 10:56:55.000000000 +0200
  135. +++ mysql-5.0.22.sx/sql/handler.h 2006-06-06 19:49:38.000000000 +0200
  136. @@ -183,8 +183,9 @@
  137. DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB,
  138. DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER,
  139. DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_CSV_DB,
  140. - DB_TYPE_FEDERATED_DB,
  141. + DB_TYPE_FEDERATED_DB,
  142. DB_TYPE_BLACKHOLE_DB,
  143. + DB_TYPE_SPHINX_DB,
  144. DB_TYPE_DEFAULT // Must be last
  145. };
  146. diff -B -N -r -u mysql-5.0.22/sql/Makefile.am mysql-5.0.22.sx/sql/Makefile.am
  147. --- mysql-5.0.22/sql/Makefile.am 2006-05-25 10:56:41.000000000 +0200
  148. +++ mysql-5.0.22.sx/sql/Makefile.am 2006-06-06 19:49:38.000000000 +0200
  149. @@ -66,6 +66,7 @@
  150. sql_array.h sql_cursor.h \
  151. examples/ha_example.h ha_archive.h \
  152. examples/ha_tina.h ha_blackhole.h \
  153. + sphinx/ha_sphinx.h \
  154. ha_federated.h
  155. mysqld_SOURCES = sql_lex.cc sql_handler.cc \
  156. item.cc item_sum.cc item_buff.cc item_func.cc \
  157. @@ -102,6 +103,7 @@
  158. sp_cache.cc parse_file.cc sql_trigger.cc \
  159. examples/ha_example.cc ha_archive.cc \
  160. examples/ha_tina.cc ha_blackhole.cc \
  161. + sphinx/ha_sphinx.cc \
  162. ha_federated.cc
  163. gen_lex_hash_SOURCES = gen_lex_hash.cc
  164. diff -B -N -r -u mysql-5.0.22/sql/mysqld.cc mysql-5.0.22.sx/sql/mysqld.cc
  165. --- mysql-5.0.22/sql/mysqld.cc 2006-05-25 10:56:41.000000000 +0200
  166. +++ mysql-5.0.22.sx/sql/mysqld.cc 2006-06-06 19:49:38.000000000 +0200
  167. @@ -6420,6 +6420,11 @@
  168. #else
  169. have_csv_db= SHOW_OPTION_NO;
  170. #endif
  171. +#ifdef HAVE_SPHINX_DB
  172. + have_sphinx_db= SHOW_OPTION_YES;
  173. +#else
  174. + have_sphinx_db= SHOW_OPTION_NO;
  175. +#endif
  176. #ifdef HAVE_NDBCLUSTER_DB
  177. have_ndbcluster=SHOW_OPTION_DISABLED;
  178. #else
  179. @@ -7457,6 +7462,7 @@
  180. #undef have_example_db
  181. #undef have_archive_db
  182. #undef have_csv_db
  183. +#undef have_sphinx_db
  184. #undef have_federated_db
  185. #undef have_partition_db
  186. #undef have_blackhole_db
  187. @@ -7467,6 +7473,7 @@
  188. SHOW_COMP_OPTION have_example_db= SHOW_OPTION_NO;
  189. SHOW_COMP_OPTION have_archive_db= SHOW_OPTION_NO;
  190. SHOW_COMP_OPTION have_csv_db= SHOW_OPTION_NO;
  191. +SHOW_COMP_OPTION have_sphinx_db= SHOW_OPTION_NO;
  192. SHOW_COMP_OPTION have_federated_db= SHOW_OPTION_NO;
  193. SHOW_COMP_OPTION have_partition_db= SHOW_OPTION_NO;
  194. SHOW_COMP_OPTION have_blackhole_db= SHOW_OPTION_NO;
  195. diff -B -N -r -u mysql-5.0.22/sql/mysql_priv.h mysql-5.0.22.sx/sql/mysql_priv.h
  196. --- mysql-5.0.22/sql/mysql_priv.h 2006-05-25 10:56:43.000000000 +0200
  197. +++ mysql-5.0.22.sx/sql/mysql_priv.h 2006-06-06 19:49:38.000000000 +0200
  198. @@ -1279,6 +1279,12 @@
  199. #else
  200. extern SHOW_COMP_OPTION have_csv_db;
  201. #endif
  202. +#ifdef HAVE_SPHINX_DB
  203. +extern handlerton sphinx_hton;
  204. +#define have_sphinx_db sphinx_hton.state
  205. +#else
  206. +extern SHOW_COMP_OPTION have_sphinx_db;
  207. +#endif
  208. #ifdef HAVE_FEDERATED_DB
  209. extern handlerton federated_hton;
  210. #define have_federated_db federated_hton.state
  211. diff -B -N -r -u mysql-5.0.22/sql/set_var.cc mysql-5.0.22.sx/sql/set_var.cc
  212. --- mysql-5.0.22/sql/set_var.cc 2006-05-25 10:56:41.000000000 +0200
  213. +++ mysql-5.0.22.sx/sql/set_var.cc 2006-06-06 19:49:38.000000000 +0200
  214. @@ -864,6 +864,7 @@
  215. {"have_compress", (char*) &have_compress, SHOW_HAVE},
  216. {"have_crypt", (char*) &have_crypt, SHOW_HAVE},
  217. {"have_csv", (char*) &have_csv_db, SHOW_HAVE},
  218. + {"have_sphinx", (char*) &have_sphinx_db, SHOW_HAVE},
  219. {"have_dynamic_loading", (char*) &have_dlopen, SHOW_HAVE},
  220. {"have_example_engine", (char*) &have_example_db, SHOW_HAVE},
  221. {"have_federated_engine", (char*) &have_federated_db, SHOW_HAVE},
  222. diff -B -N -r -u mysql-5.0.22/sql/sql_lex.h mysql-5.0.22.sx/sql/sql_lex.h
  223. --- mysql-5.0.22/sql/sql_lex.h 2006-05-25 10:56:41.000000000 +0200
  224. +++ mysql-5.0.22.sx/sql/sql_lex.h 2006-06-06 19:49:38.000000000 +0200
  225. @@ -58,6 +58,7 @@
  226. SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
  227. SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_LOGS, SQLCOM_SHOW_STATUS,
  228. SQLCOM_SHOW_INNODB_STATUS, SQLCOM_SHOW_NDBCLUSTER_STATUS, SQLCOM_SHOW_MUTEX_STATUS,
  229. + SQLCOM_SHOW_SPHINX_STATUS,
  230. SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
  231. SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS,
  232. SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS,
  233. diff -B -N -r -u mysql-5.0.22/sql/sql_parse.cc mysql-5.0.22.sx/sql/sql_parse.cc
  234. --- mysql-5.0.22/sql/sql_parse.cc 2006-05-25 10:56:41.000000000 +0200
  235. +++ mysql-5.0.22.sx/sql/sql_parse.cc 2006-06-06 19:49:38.000000000 +0200
  236. @@ -25,6 +25,9 @@
  237. #ifdef HAVE_INNOBASE_DB
  238. #include "ha_innodb.h"
  239. #endif
  240. +#ifdef HAVE_SPHINX_DB
  241. +#include "sphinx/ha_sphinx.h"
  242. +#endif
  243. #ifdef HAVE_NDBCLUSTER_DB
  244. #include "ha_ndbcluster.h"
  245. @@ -2722,6 +2725,15 @@
  246. break;
  247. }
  248. #endif
  249. +#ifdef HAVE_SPHINX_DB
  250. + case SQLCOM_SHOW_SPHINX_STATUS:
  251. + {
  252. + if (check_global_access(thd, SUPER_ACL))
  253. + goto error;
  254. + res = sphinx_show_status(thd);
  255. + break;
  256. + }
  257. +#endif
  258. #ifdef HAVE_REPLICATION
  259. case SQLCOM_LOAD_MASTER_TABLE:
  260. {
  261. diff -B -N -r -u mysql-5.0.22/sql/sql_yacc.yy mysql-5.0.22.sx/sql/sql_yacc.yy
  262. --- mysql-5.0.22/sql/sql_yacc.yy 2006-05-25 10:56:43.000000000 +0200
  263. +++ mysql-5.0.22.sx/sql/sql_yacc.yy 2006-06-06 19:49:38.000000000 +0200
  264. @@ -6584,6 +6584,9 @@
  265. case DB_TYPE_INNODB:
  266. Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;
  267. break;
  268. + case DB_TYPE_SPHINX_DB:
  269. + Lex->sql_command = SQLCOM_SHOW_SPHINX_STATUS;
  270. + break;
  271. default:
  272. my_error(ER_NOT_SUPPORTED_YET, MYF(0), "STATUS");
  273. YYABORT;