"Fossies" - the Fresh Open Source Software Archive

Member "sphinx-2.2.11-release/mysqlse/sphinx.5.0.91.diff" (19 Jul 2016, 13903 Bytes) of package /linux/www/sphinx-2.2.11-release.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 diff -r 319c65835581 CMakeLists.txt
    2 --- a/CMakeLists.txt    Sun Jun 20 15:15:01 2010 +0400
    3 +++ b/CMakeLists.txt    Sun Jun 20 15:59:31 2010 +0400
    4 @@ -70,6 +70,10 @@
    5    ADD_DEFINITIONS(-DHAVE_INNOBASE_DB)
    6  ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
    7  
    8 +IF(WITH_SPHINX_STORAGE_ENGINE)
    9 +  ADD_DEFINITIONS(-DHAVE_SPHINX_DB)
   10 +ENDIF(WITH_SPHINX_STORAGE_ENGINE)
   11 +
   12  SET(localstatedir "C:\\mysql\\data")
   13  CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-huge.cnf.sh
   14                 ${CMAKE_SOURCE_DIR}/support-files/my-huge.ini @ONLY)
   15 diff -r 319c65835581 configure.in
   16 --- a/configure.in  Sun Jun 20 15:15:01 2010 +0400
   17 +++ b/configure.in  Sun Jun 20 15:59:31 2010 +0400
   18 @@ -60,6 +60,7 @@
   19  sinclude(config/ac-macros/ha_berkeley.m4)
   20  sinclude(config/ac-macros/ha_blackhole.m4)
   21  sinclude(config/ac-macros/ha_example.m4)
   22 +sinclude(config/ac-macros/ha_sphinx.m4)
   23  sinclude(config/ac-macros/ha_federated.m4)
   24  sinclude(config/ac-macros/ha_innodb.m4)
   25  sinclude(config/ac-macros/ha_ndbcluster.m4)
   26 @@ -2696,6 +2697,7 @@
   27  MYSQL_CHECK_BDB
   28  MYSQL_CHECK_INNODB
   29  MYSQL_CHECK_EXAMPLEDB
   30 +MYSQL_CHECK_SPHINXDB
   31  MYSQL_CHECK_ARCHIVEDB
   32  MYSQL_CHECK_CSVDB
   33  MYSQL_CHECK_BLACKHOLEDB
   34 diff -r 319c65835581 libmysqld/Makefile.am
   35 --- a/libmysqld/Makefile.am Sun Jun 20 15:15:01 2010 +0400
   36 +++ b/libmysqld/Makefile.am Sun Jun 20 15:59:31 2010 +0400
   37 @@ -29,6 +29,7 @@
   38             -I$(top_builddir)/include -I$(top_srcdir)/include \
   39             -I$(top_builddir)/sql -I$(top_srcdir)/sql \
   40             -I$(top_srcdir)/sql/examples \
   41 +           -I$(top_srcdir)/sql/sphinx \
   42             -I$(top_srcdir)/regex \
   43             $(openssl_includes) @ZLIB_INCLUDES@
   44  
   45 @@ -39,6 +40,7 @@
   46  libmysqlsources =  errmsg.c get_password.c libmysql.c client.c pack.c \
   47                          my_time.c
   48  sqlexamplessources =   ha_example.cc ha_tina.cc
   49 +sqlsphinxsources = ha_sphinx.cc
   50  
   51  noinst_HEADERS =   embedded_priv.h emb_qcache.h
   52  
   53 @@ -67,7 +69,7 @@
   54     parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
   55     ha_blackhole.cc ha_archive.cc my_user.c
   56  
   57 -libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
   58 +libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) $(sqlsphinxsources)
   59  libmysqld_a_SOURCES=
   60  
   61  # automake misses these
   62 @@ -147,12 +149,16 @@
   63         rm -f $$f; \
   64         @LN_CP_F@ $(top_srcdir)/sql/examples/$$f $$f; \
   65       done; \
   66 +     for f in $(sqlsphinxsources); do \
   67 +       rm -f $$f; \
   68 +       @LN_CP_F@ $(top_srcdir)/sql/sphinx/$$f $$f; \
   69 +     done; \
   70       rm -f client_settings.h; \
   71       @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h client_settings.h
   72  
   73  
   74  clean-local:
   75 -   rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \
   76 +   rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) $(sqlsphinxsources) | sed "s;\.lo;.c;g"` \
   77            $(top_srcdir)/linked_libmysqld_sources; \
   78     rm -f client_settings.h
   79  
   80 diff -r 319c65835581 sql/CMakeLists.txt
   81 --- a/sql/CMakeLists.txt    Sun Jun 20 15:15:01 2010 +0400
   82 +++ b/sql/CMakeLists.txt    Sun Jun 20 15:59:31 2010 +0400
   83 @@ -50,6 +50,7 @@
   84                 filesort.cc gstream.cc ha_blackhole.cc 
   85                 ha_archive.cc ha_heap.cc ha_myisam.cc ha_myisammrg.cc
   86                 ha_innodb.cc ha_federated.cc ha_berkeley.cc
   87 +               sphinx/ha_sphinx.cc
   88                 handler.cc hash_filo.cc hash_filo.h 
   89                 hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc 
   90                 item_create.cc item_func.cc item_geofunc.cc item_row.cc 
   91 diff -r 319c65835581 sql/Makefile.am
   92 --- a/sql/Makefile.am   Sun Jun 20 15:15:01 2010 +0400
   93 +++ b/sql/Makefile.am   Sun Jun 20 15:59:31 2010 +0400
   94 @@ -68,6 +68,7 @@
   95             sql_array.h sql_cursor.h \
   96             examples/ha_example.h ha_archive.h \
   97             examples/ha_tina.h ha_blackhole.h  \
   98 +           sphinx/ha_sphinx.h \
   99             ha_federated.h
  100  mysqld_SOURCES =   sql_lex.cc sql_handler.cc \
  101             item.cc item_sum.cc item_buff.cc item_func.cc \
  102 @@ -105,6 +106,7 @@
  103             sp_cache.cc parse_file.cc sql_trigger.cc \
  104             examples/ha_example.cc ha_archive.cc \
  105             examples/ha_tina.cc ha_blackhole.cc \
  106 +           sphinx/ha_sphinx.cc \
  107             ha_federated.cc
  108  
  109  gen_lex_hash_SOURCES = gen_lex_hash.cc
  110 @@ -175,6 +177,10 @@
  111  udf_example_la_SOURCES= udf_example.c
  112  udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
  113  
  114 +pkglib_LTLIBRARIES = sphinx/sphinx.la
  115 +sphinx_sphinx_la_SOURCES = sphinx/snippets_udf.cc
  116 +sphinx_sphinx_la_LDFLAGS = -module
  117 +
  118  
  119  # Don't update the files from bitkeeper
  120  %::SCCS/s.%
  121 diff -r 319c65835581 sql/handler.cc
  122 --- a/sql/handler.cc    Sun Jun 20 15:15:01 2010 +0400
  123 +++ b/sql/handler.cc    Sun Jun 20 15:59:31 2010 +0400
  124 @@ -77,6 +77,15 @@
  125    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  126    HTON_NO_FLAGS };
  127  #endif
  128 +#ifdef HAVE_SPHINX_DB
  129 +#include "sphinx/ha_sphinx.h"
  130 +extern handlerton sphinx_hton;
  131 +#else
  132 +handlerton sphinx_hton = { "SPHINX", SHOW_OPTION_NO, "SPHINX storage engine",
  133 +  DB_TYPE_SPHINX_DB, NULL, 0, 0, NULL, NULL,
  134 +  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  135 +  HTON_NO_FLAGS };
  136 +#endif
  137  #ifdef HAVE_INNOBASE_DB
  138  #include "ha_innodb.h"
  139  extern handlerton innobase_hton;
  140 @@ -141,6 +150,7 @@
  141    &example_hton,
  142    &archive_hton,
  143    &tina_hton,
  144 +  &sphinx_hton,
  145    &ndbcluster_hton,
  146    &federated_hton,
  147    &myisammrg_hton,
  148 @@ -342,6 +352,12 @@
  149        return new (alloc) ha_tina(table);
  150      return NULL;
  151  #endif
  152 +#ifdef HAVE_SPHINX_DB
  153 +  case DB_TYPE_SPHINX_DB:
  154 +    if (have_sphinx_db == SHOW_OPTION_YES)
  155 +      return new (alloc) ha_sphinx(table);
  156 +    return NULL;
  157 +#endif
  158  #ifdef HAVE_NDBCLUSTER_DB
  159    case DB_TYPE_NDBCLUSTER:
  160      if (have_ndbcluster == SHOW_OPTION_YES)
  161 diff -r 319c65835581 sql/handler.h
  162 --- a/sql/handler.h Sun Jun 20 15:15:01 2010 +0400
  163 +++ b/sql/handler.h Sun Jun 20 15:59:31 2010 +0400
  164 @@ -186,8 +186,9 @@
  165    DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB,
  166    DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER,
  167    DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_CSV_DB,
  168 -  DB_TYPE_FEDERATED_DB,
  169 +  DB_TYPE_FEDERATED_DB, 
  170    DB_TYPE_BLACKHOLE_DB,
  171 +  DB_TYPE_SPHINX_DB,
  172    DB_TYPE_DEFAULT // Must be last
  173  };
  174  
  175 diff -r 319c65835581 sql/mysql_priv.h
  176 --- a/sql/mysql_priv.h  Sun Jun 20 15:15:01 2010 +0400
  177 +++ b/sql/mysql_priv.h  Sun Jun 20 15:59:31 2010 +0400
  178 @@ -1462,6 +1462,12 @@
  179  #else
  180  extern SHOW_COMP_OPTION have_csv_db;
  181  #endif
  182 +#ifdef HAVE_SPHINX_DB
  183 +extern handlerton sphinx_hton;
  184 +#define have_sphinx_db sphinx_hton.state
  185 +#else
  186 +extern SHOW_COMP_OPTION have_sphinx_db;
  187 +#endif
  188  #ifdef HAVE_FEDERATED_DB
  189  extern handlerton federated_hton;
  190  #define have_federated_db federated_hton.state
  191 diff -r 319c65835581 sql/mysqld.cc
  192 --- a/sql/mysqld.cc Sun Jun 20 15:15:01 2010 +0400
  193 +++ b/sql/mysqld.cc Sun Jun 20 15:59:31 2010 +0400
  194 @@ -36,6 +36,10 @@
  195  #include <sys/prctl.h>
  196  #endif
  197  
  198 +#ifdef HAVE_SPHINX_DB
  199 +#include "sphinx/ha_sphinx.h"
  200 +#endif
  201 +
  202  #ifdef HAVE_INNOBASE_DB
  203  #define OPT_INNODB_DEFAULT 1
  204  #else
  205 @@ -6721,6 +6725,13 @@
  206  #ifdef COMMUNITY_SERVER
  207    {"Uptime_since_flush_status",(char*) 0,                       SHOW_FLUSHTIME},
  208  #endif
  209 +#ifdef HAVE_SPHINX_DB
  210 +   {"sphinx_total",            (char *)sphinx_showfunc_total,       SHOW_SPHINX_FUNC},
  211 +   {"sphinx_total_found",      (char *)sphinx_showfunc_total_found, SHOW_SPHINX_FUNC},
  212 +   {"sphinx_time",             (char *)sphinx_showfunc_time,        SHOW_SPHINX_FUNC},
  213 +   {"sphinx_word_count",       (char *)sphinx_showfunc_word_count,  SHOW_SPHINX_FUNC},
  214 +   {"sphinx_words",            (char *)sphinx_showfunc_words,       SHOW_SPHINX_FUNC},
  215 +#endif
  216    {NullS, NullS, SHOW_LONG}
  217  };
  218  
  219 @@ -6964,6 +6975,11 @@
  220  #else
  221    have_csv_db= SHOW_OPTION_NO;
  222  #endif
  223 +#ifdef HAVE_SPHINX_DB
  224 +  have_sphinx_db= SHOW_OPTION_YES;
  225 +#else
  226 +  have_sphinx_db= SHOW_OPTION_NO;
  227 +#endif
  228  #ifdef HAVE_NDBCLUSTER_DB
  229    have_ndbcluster=SHOW_OPTION_DISABLED;
  230  #else
  231 @@ -8087,6 +8103,7 @@
  232  #undef have_example_db
  233  #undef have_archive_db
  234  #undef have_csv_db
  235 +#undef have_sphinx_db
  236  #undef have_federated_db
  237  #undef have_partition_db
  238  #undef have_blackhole_db
  239 @@ -8097,6 +8114,7 @@
  240  SHOW_COMP_OPTION have_example_db= SHOW_OPTION_NO;
  241  SHOW_COMP_OPTION have_archive_db= SHOW_OPTION_NO;
  242  SHOW_COMP_OPTION have_csv_db= SHOW_OPTION_NO;
  243 +SHOW_COMP_OPTION have_sphinx_db= SHOW_OPTION_NO;
  244  SHOW_COMP_OPTION have_federated_db= SHOW_OPTION_NO;
  245  SHOW_COMP_OPTION have_partition_db= SHOW_OPTION_NO;
  246  SHOW_COMP_OPTION have_blackhole_db= SHOW_OPTION_NO;
  247 diff -r 319c65835581 sql/set_var.cc
  248 --- a/sql/set_var.cc    Sun Jun 20 15:15:01 2010 +0400
  249 +++ b/sql/set_var.cc    Sun Jun 20 15:59:31 2010 +0400
  250 @@ -913,6 +913,7 @@
  251    {"have_profiling",          (char*) &have_profiling,             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 diff -r 319c65835581 sql/sql_lex.h
  259 --- a/sql/sql_lex.h Sun Jun 20 15:15:01 2010 +0400
  260 +++ b/sql/sql_lex.h Sun Jun 20 15:59:31 2010 +0400
  261 @@ -57,6 +57,7 @@
  262    SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
  263    SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_LOGS, SQLCOM_SHOW_STATUS,
  264    SQLCOM_SHOW_INNODB_STATUS, SQLCOM_SHOW_NDBCLUSTER_STATUS, SQLCOM_SHOW_MUTEX_STATUS,
  265 +  SQLCOM_SHOW_SPHINX_STATUS,
  266    SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
  267    SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS,
  268    SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS,
  269 diff -r 319c65835581 sql/sql_parse.cc
  270 --- a/sql/sql_parse.cc  Sun Jun 20 15:15:01 2010 +0400
  271 +++ b/sql/sql_parse.cc  Sun Jun 20 15:59:31 2010 +0400
  272 @@ -24,6 +24,9 @@
  273  #ifdef HAVE_INNOBASE_DB
  274  #include "ha_innodb.h"
  275  #endif
  276 +#ifdef HAVE_SPHINX_DB
  277 +#include "sphinx/ha_sphinx.h"
  278 +#endif
  279  
  280  #ifdef HAVE_NDBCLUSTER_DB
  281  #include "ha_ndbcluster.h"
  282 @@ -3166,6 +3169,15 @@
  283        break;
  284      }
  285  #endif
  286 +#ifdef HAVE_SPHINX_DB
  287 +  case SQLCOM_SHOW_SPHINX_STATUS:
  288 +    {
  289 +      if (check_global_access(thd, SUPER_ACL))
  290 +   goto error;
  291 +      res = sphinx_show_status(thd);
  292 +      break;
  293 +    }
  294 +#endif
  295  #ifdef HAVE_REPLICATION
  296    case SQLCOM_LOAD_MASTER_TABLE:
  297    {
  298 diff -r 319c65835581 sql/sql_show.cc
  299 --- a/sql/sql_show.cc   Sun Jun 20 15:15:01 2010 +0400
  300 +++ b/sql/sql_show.cc   Sun Jun 20 15:59:31 2010 +0400
  301 @@ -1500,6 +1500,16 @@
  302            value= (char*) var->value_ptr(thd, value_type, &null_lex_str);
  303            charset= var->charset(thd);
  304          }
  305 +       #ifdef HAVE_SPHINX_DB
  306 +       else if (show_type == SHOW_SPHINX_FUNC)
  307 +       {
  308 +           SHOW_VAR var;
  309 +           ((int (*)(THD *, SHOW_VAR *, char *))value)(thd, &var, buff);
  310 +
  311 +           value = var.value;
  312 +           show_type = var.type;
  313 +       }
  314 +       #endif /* HAVE_SPHINX_DB */
  315  
  316          pos= end= buff;
  317          switch (show_type) {
  318 diff -r 319c65835581 sql/sql_yacc.yy
  319 --- a/sql/sql_yacc.yy   Sun Jun 20 15:15:01 2010 +0400
  320 +++ b/sql/sql_yacc.yy   Sun Jun 20 15:59:31 2010 +0400
  321 @@ -8342,6 +8342,9 @@
  322         case DB_TYPE_INNODB:
  323           Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;
  324           break;
  325 +       case DB_TYPE_SPHINX_DB:
  326 +         Lex->sql_command = SQLCOM_SHOW_SPHINX_STATUS;
  327 +         break;
  328         default:
  329           my_error(ER_NOT_SUPPORTED_YET, MYF(0), "STATUS");
  330           MYSQL_YYABORT;
  331 diff -r 319c65835581 sql/sql_yacc.cc
  332 --- a/sql/sql_yacc.cc   Sun Jun 20 15:15:01 2010 +0400
  333 +++ b/sql/sql_yacc.cc   Sun Jun 20 15:59:31 2010 +0400
  334 @@ -27003,6 +27003,9 @@
  335         case DB_TYPE_INNODB:
  336           Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;
  337           break;
  338 +       case DB_TYPE_SPHINX_DB:
  339 +         Lex->sql_command = SQLCOM_SHOW_SPHINX_STATUS;
  340 +         break;
  341         default:
  342           my_error(ER_NOT_SUPPORTED_YET, MYF(0), "STATUS");
  343           MYSQL_YYABORT;
  344 diff -r 319c65835581 sql/structs.h
  345 --- a/sql/structs.h Sun Jun 20 15:15:01 2010 +0400
  346 +++ b/sql/structs.h Sun Jun 20 15:59:31 2010 +0400
  347 @@ -194,6 +194,9 @@
  348    SHOW_SSL_CTX_SESS_TIMEOUTS, SHOW_SSL_CTX_SESS_CACHE_FULL,
  349    SHOW_SSL_GET_CIPHER_LIST,
  350  #endif /* HAVE_OPENSSL */
  351 +#ifdef HAVE_SPHINX_DB
  352 +  SHOW_SPHINX_FUNC,
  353 +#endif
  354    SHOW_NET_COMPRESSION,
  355    SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING, SHOW_SLAVE_RETRIED_TRANS,
  356    SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_CONST_LONG, SHOW_KEY_CACHE_LONGLONG,
  357 diff -r 319c65835581 win/configure.js
  358 --- a/win/configure.js  Sun Jun 20 15:15:01 2010 +0400
  359 +++ b/win/configure.js  Sun Jun 20 15:59:31 2010 +0400
  360 @@ -45,6 +45,7 @@
  361              case "WITH_EXAMPLE_STORAGE_ENGINE":
  362              case "WITH_FEDERATED_STORAGE_ENGINE":
  363              case "WITH_INNOBASE_STORAGE_ENGINE":
  364 +            case "WITH_SPHINX_STORAGE_ENGINE":
  365              case "__NT__":
  366              case "DISABLE_GRANT_OPTIONS":
  367              case "EMBED_MANIFESTS":
  368 --- mysql-5.0.67/config/ac-macros/ha_sphinx.m4  1970-01-01 10:00:00.000000000 +1000
  369 +++ mysql-5.0.67-sphinx/config/ac-macros/ha_sphinx.m4   2009-02-14 09:15:48.000000000 +1000
  370 @@ -0,0 +1,30 @@
  371 +dnl ---------------------------------------------------------------------------
  372 +dnl Macro: MYSQL_CHECK_EXAMPLEDB
  373 +dnl Sets HAVE_SPHINX_DB if --with-sphinx-storage-engine is used
  374 +dnl ---------------------------------------------------------------------------
  375 +AC_DEFUN([MYSQL_CHECK_SPHINXDB], [
  376 +  AC_ARG_WITH([sphinx-storage-engine],
  377 +              [
  378 +  --with-sphinx-storage-engine
  379 +                          Enable the Sphinx Storage Engine],
  380 +              [sphinxdb="$withval"],
  381 +              [sphinxdb=no])
  382 +  AC_MSG_CHECKING([for example storage engine])
  383 +
  384 +  case "$sphinxdb" in
  385 +    yes )
  386 +      AC_DEFINE([HAVE_SPHINX_DB], [1], [Builds Sphinx Engine])
  387 +      AC_MSG_RESULT([yes])
  388 +      [sphinxdb=yes]
  389 +      ;;
  390 +    * )
  391 +      AC_MSG_RESULT([no])
  392 +      [sphinxdb=no]
  393 +      ;;
  394 +  esac
  395 +
  396 +])
  397 +dnl ---------------------------------------------------------------------------
  398 +dnl END OF MYSQL_CHECK_EXAMPLE SECTION
  399 +dnl ---------------------------------------------------------------------------
  400 +