Commit 66002e45 authored by unknown's avatar unknown
Browse files

WL#2575 - Fulltext: Parser plugin for FTS

WL#2763 - MySQL plugin interface: step 1
Manual merge from CNET tree.


include/ft_global.h:
  Default parser added.
include/my_global.h:
  dlopen related code moved from sql_udf.cc into my_global.h
include/myisam.h:
  Added fulltext parser to MI_KEYDEF
libmysqld/Makefile.am:
  Added LIBDIR macro.
mysql-test/r/connect.result:
  Test result fixed: added plugin table
mysql-test/r/information_schema.result:
  Test result fixed: added plugin table.
mysql-test/r/mysqlcheck.result:
  Test result fixed: added plugin table.
mysql-test/r/system_mysql_db.result:
   Test fixed: added plugin table
mysql-test/t/system_mysql_db_fix.test:
   Test fixed: added plugin table
scripts/mysql_create_system_tables.sh:
  Added mysql.plugin table.
scripts/mysql_fix_privilege_tables.sql:
  Added mysql.plugin table.
sql/Makefile.am:
  Added LIBDIR macro.
sql/ha_myisam.cc:
  Pass fulltext parser from sql to myisam layer.
sql/lex.h:
  Plugin related symbols.
sql/mysqld.cc:
  Initialize/deinitialize plugins, pass opt_plugin_dir.
  plugin-dir renamed to plugin_dir.
  plugin_dir is relative to mysql_home now.
sql/set_var.cc:
  plugin_dir added to SHOW VARIABLES.
sql/share/errmsg.txt:
  Plugin related error messages.
sql/sql_class.h:
  Added parser to Key class.
  Hold parser_name instead of plugin in Key class.
sql/sql_lex.h:
  INSTALL/UNINSTALL PLUGIN commands.
sql/sql_parse.cc:
  INSTALL/UNINSTALL PLUGIN commands.
sql/sql_show.cc:
  SHOW CREATE TABLE: output parser name if index was created WITH PARSER.
sql/sql_table.cc:
  Pass fulltext parser from yacc to sql layer.
sql/sql_udf.cc:
  dlopen related code moved into my_global.h.
  Implemented better check for UDF path.
  UDF loads libraries that are under plugin_dir now.
sql/sql_yacc.yy:
  INSTALL/UNINSTALL PLUGIN syntax.
  Added WITH PARSER syntax to CREATE/ALTER TABLE/INDEX.
  opt_fulltext_parser must allocate memory, since it will be used afterwards.
sql/table.cc:
  Save/restore fulltext parser in extra data segment.
  Added DBUG_PRINTs.
storage/myisam/ft_boolean_search.c:
  Split functions so they can be used by fulltext parser.
  Use fulltext parser if specified.
storage/myisam/ft_nlq_search.c:
  Use fulltext parser.
storage/myisam/ft_parser.c:
  Split functions so they can be used by fulltext parser.
  Use fulltext parser if specified.
storage/myisam/ft_static.c:
  Default fulltext parser added.
storage/myisam/ft_update.c:
  Use fulltext parser.
storage/myisam/ftdefs.h:
  FTB_PARAM moved into plugin.h and renamed to MYSQL_FTPARSER_BOOLEAN_INFO.
storage/myisam/mi_open.c:
  Set default parser.
parent dbfe5a96
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ extern ulong ft_min_word_len;
extern ulong ft_max_word_len;
extern ulong ft_query_expansion_limit;
extern char  ft_boolean_syntax[15];
extern struct st_mysql_ftparser ft_default_parser;

int ft_init_stopwords(void);
void ft_free_stopwords(void);
+19 −0
Original line number Diff line number Diff line
@@ -1380,4 +1380,23 @@ do { doubleget_union _tmp; \
#define dlerror() ""
#endif

#ifdef HAVE_DLOPEN
#if defined(__WIN__)
#define dlsym(lib, name) GetProcAddress((HMODULE)lib, name)
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
#define dlclose(lib) FreeLibrary((HMODULE)lib)
#elif !defined(OS2)
#include <dlfcn.h>
#endif
#endif

/* FreeBSD 2.2.2 does not define RTLD_NOW) */
#ifndef RTLD_NOW
#define RTLD_NOW 1
#endif

#ifndef HAVE_DLERROR
#define dlerror() ""
#endif

#endif /* my_global_h */
+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ extern "C" {
#include "keycache.h"
#endif
#include "my_handler.h"
#include <plugin.h>

	/* defines used by myisam-funktions */

@@ -196,6 +197,7 @@ typedef struct st_mi_keydef /* Key definition with open & info */
  uint32 version;			/* For concurrent read/write */

  HA_KEYSEG *seg,*end;
  struct st_mysql_ftparser *parser;     /* Fulltext [pre]parser */
  int (*bin_search)(struct st_myisam_info *info,struct st_mi_keydef *keyinfo,
		    uchar *page,uchar *key,
		    uint key_len,uint comp_flag,uchar * *ret_pos,
+3 −1
Original line number Diff line number Diff line
@@ -20,11 +20,13 @@
MYSQLDATAdir =		$(localstatedir)
MYSQLSHAREdir =		$(pkgdatadir)
MYSQLBASEdir=		$(prefix)
MYSQLLIBdir=            $(libdir)

DEFS =			-DEMBEDDED_LIBRARY -DMYSQL_SERVER \
			-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
			-DDATADIR="\"$(MYSQLDATAdir)\"" \
			-DSHAREDIR="\"$(MYSQLSHAREdir)\""
			-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
			-DLIBDIR="\"$(MYSQLLIBdir)\""
INCLUDES=		@bdb_includes@ \
			-I$(top_builddir)/include -I$(top_srcdir)/include \
			-I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \
+3 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ help_keyword
help_relation
help_topic
host
plugin
proc
procs_priv
tables_priv
@@ -36,6 +37,7 @@ help_keyword
help_relation
help_topic
host
plugin
proc
procs_priv
tables_priv
@@ -71,6 +73,7 @@ help_keyword
help_relation
help_topic
host
plugin
proc
procs_priv
tables_priv
Loading