diff options
author | unknown <svoj@poseidon.ndb.mysql.com> | 2005-11-06 16:16:18 +0100 |
---|---|---|
committer | unknown <svoj@poseidon.ndb.mysql.com> | 2005-11-06 16:16:18 +0100 |
commit | df33aacd87ff08c27fd371a0bb348fe3986e6f95 (patch) | |
tree | 0c9f1805d1951780ff34fb797c8fec0193020aab /sql | |
parent | 2bddb0766473270f43e70bed16f3223255fee4a9 (diff) | |
parent | 3e5508909f7b7bebabfca5711e5778927279be19 (diff) | |
download | mariadb-git-df33aacd87ff08c27fd371a0bb348fe3986e6f95.tar.gz |
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new
Diffstat (limited to 'sql')
-rw-r--r-- | sql/Makefile.am | 2 | ||||
-rw-r--r-- | sql/ha_myisam.cc | 9 | ||||
-rw-r--r-- | sql/lex.h | 6 | ||||
-rw-r--r-- | sql/mysqld.cc | 21 | ||||
-rw-r--r-- | sql/set_var.cc | 1 | ||||
-rw-r--r-- | sql/share/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/sql_class.h | 6 | ||||
-rw-r--r-- | sql/sql_lex.h | 1 | ||||
-rw-r--r-- | sql/sql_parse.cc | 9 | ||||
-rw-r--r-- | sql/sql_show.cc | 6 | ||||
-rw-r--r-- | sql/sql_table.cc | 2 | ||||
-rw-r--r-- | sql/sql_udf.cc | 51 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 67 | ||||
-rw-r--r-- | sql/table.cc | 12 |
14 files changed, 146 insertions, 51 deletions
diff --git a/sql/Makefile.am b/sql/Makefile.am index f1d43c9c660..5516f3b6964 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -19,6 +19,7 @@ MYSQLDATAdir = $(localstatedir) MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir= $(prefix) +MYSQLLIBdir= $(pkglibdir) INCLUDES = @ZLIB_INCLUDES@ \ @bdb_includes@ @innodb_includes@ @ndbcluster_includes@ \ -I$(top_builddir)/include -I$(top_srcdir)/include \ @@ -116,6 +117,7 @@ DEFS = -DMYSQL_SERVER \ -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ + -DLIBDIR="\"$(MYSQLLIBdir)\"" \ @DEFS@ BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 03ef362c0d4..d786dd75148 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -280,6 +280,7 @@ err: int ha_myisam::open(const char *name, int mode, uint test_if_locked) { + uint i; if (!(file=mi_open(name, mode, test_if_locked))) return (my_errno ? my_errno : -1); @@ -292,6 +293,14 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) int_table_flags|=HA_REC_NOT_IN_SEQ; if (file->s->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)) int_table_flags|=HA_HAS_CHECKSUM; + + for (i= 0; i < table->s->keys; i++) + { + struct st_plugin_int *parser= table->key_info[i].parser; + if (table->key_info[i].flags & HA_USES_PARSER) + file->s->keyinfo[i].parser= + (struct st_mysql_ftparser *)parser->plugin->info; + } return (0); } diff --git a/sql/lex.h b/sql/lex.h index 9b8f94f61bf..a610a628ef4 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -246,6 +246,7 @@ static SYMBOL symbols[] = { { "INSENSITIVE", SYM(INSENSITIVE_SYM)}, { "INSERT", SYM(INSERT)}, { "INSERT_METHOD", SYM(INSERT_METHOD)}, + { "INSTALL", SYM(INSTALL_SYM)}, { "INT", SYM(INT_SYM)}, { "INT1", SYM(TINYINT)}, { "INT2", SYM(SMALLINT)}, @@ -370,6 +371,7 @@ static SYMBOL symbols[] = { { "OUTER", SYM(OUTER)}, { "OUTFILE", SYM(OUTFILE)}, { "PACK_KEYS", SYM(PACK_KEYS_SYM)}, + { "PARSER", SYM(PARSER_SYM)}, { "PARTIAL", SYM(PARTIAL)}, #ifdef HAVE_PARTITION_DB { "PARTITION", SYM(PARTITION_SYM)}, @@ -377,6 +379,7 @@ static SYMBOL symbols[] = { { "PARTITIONS", SYM(PARTITIONS_SYM)}, { "PASSWORD", SYM(PASSWORD)}, { "PHASE", SYM(PHASE_SYM)}, + { "PLUGIN", SYM(PLUGIN_SYM)}, { "POINT", SYM(POINT_SYM)}, { "POLYGON", SYM(POLYGON)}, { "PRECISION", SYM(PRECISION)}, @@ -454,7 +457,7 @@ static SYMBOL symbols[] = { { "SNAPSHOT", SYM(SNAPSHOT_SYM)}, { "SMALLINT", SYM(SMALLINT)}, { "SOME", SYM(ANY_SYM)}, - { "SONAME", SYM(UDF_SONAME_SYM)}, + { "SONAME", SYM(SONAME_SYM)}, { "SOUNDS", SYM(SOUNDS_SYM)}, { "SPATIAL", SYM(SPATIAL_SYM)}, { "SPECIFIC", SYM(SPECIFIC_SYM)}, @@ -525,6 +528,7 @@ static SYMBOL symbols[] = { { "UNIQUE", SYM(UNIQUE_SYM)}, { "UNKNOWN", SYM(UNKNOWN_SYM)}, { "UNLOCK", SYM(UNLOCK_SYM)}, + { "UNINSTALL", SYM(UNINSTALL_SYM)}, { "UNSIGNED", SYM(UNSIGNED)}, { "UNTIL", SYM(UNTIL_SYM)}, { "UPDATE", SYM(UPDATE_SYM)}, diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9bf6ce3fb46..37cfdba1937 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1072,10 +1072,13 @@ void clean_up(bool print_message) lex_free(); /* Free some memory */ set_var_free(); free_charsets(); -#ifdef HAVE_DLOPEN if (!opt_noacl) + { +#ifdef HAVE_DLOPEN udf_free(); #endif + plugin_free(); + } (void) ha_panic(HA_PANIC_CLOSE); /* close all tables and logs */ if (tc_log) tc_log->close(); @@ -3413,10 +3416,13 @@ we force server id to 2, but this MySQL server will not act as a slave."); if (!opt_noacl) (void) grant_init(); -#ifdef HAVE_DLOPEN if (!opt_noacl) + { + plugin_init(); +#ifdef HAVE_DLOPEN udf_init(); #endif + } if (opt_bootstrap) /* If running with bootstrap, do not start replication. */ opt_skip_slave_start= 1; /* @@ -4574,7 +4580,8 @@ enum options_mysqld OPT_TIMED_MUTEXES, OPT_OLD_STYLE_USER_LIMITS, OPT_LOG_SLOW_ADMIN_STATEMENTS, - OPT_TABLE_LOCK_WAIT_TIMEOUT + OPT_TABLE_LOCK_WAIT_TIMEOUT, + OPT_PLUGIN_DIR }; @@ -5724,6 +5731,10 @@ The minimum value for this variable is 4096.", (gptr*) &global_system_variables.optimizer_search_depth, (gptr*) &max_system_variables.optimizer_search_depth, 0, GET_ULONG, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0}, + {"plugin_dir", OPT_PLUGIN_DIR, + "Directory for plugins.", + (gptr*) &opt_plugin_dir_ptr, (gptr*) &opt_plugin_dir_ptr, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE, "The size of the buffer that is allocated when preloading indexes", (gptr*) &global_system_variables.preload_buff_size, @@ -7215,6 +7226,10 @@ static void fix_paths(void) (void) my_load_path(mysql_home,mysql_home,""); // Resolve current dir (void) my_load_path(mysql_real_data_home,mysql_real_data_home,mysql_home); (void) my_load_path(pidfile_name,pidfile_name,mysql_real_data_home); + strmake(opt_plugin_dir, get_relative_path(LIBDIR), + sizeof(opt_plugin_dir) - 1); + opt_plugin_dir_ptr= opt_plugin_dir; + (void) my_load_path(opt_plugin_dir, opt_plugin_dir_ptr, mysql_home); char *sharedir=get_relative_path(SHAREDIR); if (test_if_hard_path(sharedir)) diff --git a/sql/set_var.cc b/sql/set_var.cc index ec543d3ec9b..a8cd7235c53 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -781,6 +781,7 @@ struct show_var_st init_vars[]= { {sys_optimizer_search_depth.name,(char*) &sys_optimizer_search_depth, SHOW_SYS}, {"pid_file", (char*) pidfile_name, SHOW_CHAR}, + {"plugin_dir", (char*) opt_plugin_dir, SHOW_CHAR}, {"port", (char*) &mysqld_port, SHOW_INT}, {sys_preload_buff_size.name, (char*) &sys_preload_buff_size, SHOW_SYS}, {"protocol_version", (char*) &protocol_version, SHOW_INT}, diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index ded1c5e5f56..c9504ba980f 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -3006,7 +3006,7 @@ ER_CANT_FIND_DL_ENTRY cze "Nemohu naj-Bt funkci '%-.64s' v knihovn'" dan "Kan ikke finde funktionen '%-.64s' i bibliotek'" nla "Kan functie '%-.64s' niet in library vinden" - eng "Can't find function '%-.64s' in library'" + eng "Can't find symbol '%-.64s' in library'" jps "function '%-.64s' Cu[Ɍt鎖ł܂", est "Ei leia funktsiooni '%-.64s' antud teegis" fre "Impossible de trouver la fonction '%-.64s' dans la bibliothque'" @@ -3018,7 +3018,7 @@ ER_CANT_FIND_DL_ENTRY kor "̹ '%-.64s' Լ ã ϴ." por "No pode encontrar a funo '%-.64s' na biblioteca" rum "Nu pot gasi functia '%-.64s' in libraria" - rus " '%-.64s' " + rus " '%-.64s' " serbian "Ne mogu da pronadjem funkciju '%-.64s' u biblioteci" slo "Nemem njs funkciu '%-.64s' v kninici'" spa "No puedo encontrar funcin '%-.64s' en libraria'" diff --git a/sql/sql_class.h b/sql/sql_class.h index 0a34de11528..2efcc620914 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -413,11 +413,13 @@ public: List<key_part_spec> columns; const char *name; bool generated; + LEX_STRING *parser_name; Key(enum Keytype type_par, const char *name_arg, enum ha_key_alg alg_par, - bool generated_arg, List<key_part_spec> &cols) + bool generated_arg, List<key_part_spec> &cols, + LEX_STRING *parser_arg= 0) :type(type_par), algorithm(alg_par), columns(cols), name(name_arg), - generated(generated_arg) + generated(generated_arg), parser_name(parser_arg) {} ~Key() {} /* Equality comparison of keys (ignoring name) */ diff --git a/sql/sql_lex.h b/sql/sql_lex.h index c9868be0d82..f164bb6809b 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -91,6 +91,7 @@ enum enum_sql_command { SQLCOM_CREATE_TRIGGER, SQLCOM_DROP_TRIGGER, SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE, SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER, + SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN, /* This should be the last !!! */ SQLCOM_END diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 939961ab7e8..4c5f0018bb5 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4780,6 +4780,15 @@ end_with_restore_list: case SQLCOM_XA_RECOVER: res= mysql_xa_recover(thd); break; + case SQLCOM_INSTALL_PLUGIN: + if (! (res= mysql_install_plugin(thd, &thd->lex->comment, + &thd->lex->ident))) + send_ok(thd); + break; + case SQLCOM_UNINSTALL_PLUGIN: + if (! (res= mysql_uninstall_plugin(thd, &thd->lex->comment))) + send_ok(thd); + break; default: DBUG_ASSERT(0); /* Impossible */ send_ok(thd); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index d06b09f9793..568a0a56eda 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -948,6 +948,12 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet) } } packet->append(')'); + if (key_info->parser) + { + packet->append(" WITH PARSER ", 13); + append_identifier(thd, packet, key_info->parser->name.str, + key_info->parser->name.length); + } } /* diff --git a/sql/sql_table.cc b/sql/sql_table.cc index a990cf777d6..dacc614cd80 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1087,6 +1087,8 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, break; case Key::FULLTEXT: key_info->flags= HA_FULLTEXT; + if ((key_info->parser_name= key->parser_name)) + key_info->flags|= HA_USES_PARSER; break; case Key::SPATIAL: #ifdef HAVE_SPATIAL diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 726dcbb3541..2b98bbdaa9e 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -38,36 +38,10 @@ #ifdef HAVE_DLOPEN extern "C" { -#if defined(__WIN__) - void* dlsym(void* lib,const char* name) - { - return GetProcAddress((HMODULE)lib,name); - } - void* dlopen(const char* libname,int unused) - { - return LoadLibraryEx(libname,NULL,0); - } - void dlclose(void* lib) - { - FreeLibrary((HMODULE)lib); - } - -#elif !defined(OS2) -#include <dlfcn.h> -#endif - #include <stdarg.h> #include <hash.h> } -#ifndef RTLD_NOW -#define RTLD_NOW 1 // For FreeBSD 2.2.2 -#endif - -#ifndef HAVE_DLERROR -#define dlerror() "" -#endif - static bool initialized = 0; static MEM_ROOT mem; static HASH udf_hash; @@ -194,8 +168,10 @@ void udf_init() This is done to ensure that only approved dll from the system directories are used (to make this even remotely secure). */ - if (strchr(dl_name, '/') || - IF_WIN(strchr(dl_name, '\\'),0) || + if (my_strchr(files_charset_info, dl_name, + dl_name + strlen(dl_name), '/') || + IF_WIN(my_strchr(files_charset_info, dl_name, + dl_name + strlen(dl_name), '\\'),0) || strlen(name.str) > NAME_LEN) { sql_print_error("Invalid row in mysql.func table for function '%.64s'", @@ -214,10 +190,13 @@ void udf_init() void *dl = find_udf_dl(tmp->dl); if (dl == NULL) { - if (!(dl = dlopen(tmp->dl, RTLD_NOW))) + char dlpath[FN_REFLEN]; + strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", tmp->dl, + NullS); + if (!(dl= dlopen(dlpath, RTLD_NOW))) { /* Print warning to log */ - sql_print_error(ER(ER_CANT_OPEN_LIBRARY), tmp->dl,errno,dlerror()); + sql_print_error(ER(ER_CANT_OPEN_LIBRARY), dlpath, errno, dlerror()); /* Keep the udf in the hash so that we can remove it later */ continue; } @@ -412,7 +391,9 @@ int mysql_create_function(THD *thd,udf_func *udf) This is done to ensure that only approved dll from the system directories are used (to make this even remotely secure). */ - if (strchr(udf->dl, '/') || IF_WIN(strchr(udf->dl, '\\'),0)) + if (my_strchr(files_charset_info, udf->dl, udf->dl + strlen(udf->dl), '/') || + IF_WIN(strchr(files_charset_info, udf->dl, + udf->dl + strlen(udf->dl), '\\'),0)) { my_message(ER_UDF_NO_PATHS, ER(ER_UDF_NO_PATHS), MYF(0)); DBUG_RETURN(1); @@ -431,12 +412,14 @@ int mysql_create_function(THD *thd,udf_func *udf) } if (!(dl = find_udf_dl(udf->dl))) { - if (!(dl = dlopen(udf->dl, RTLD_NOW))) + char dlpath[FN_REFLEN]; + strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", udf->dl, NullS); + if (!(dl = dlopen(dlpath, RTLD_NOW))) { DBUG_PRINT("error",("dlopen of %s failed, error: %d (%s)", - udf->dl,errno,dlerror())); + dlpath, errno, dlerror())); my_error(ER_CANT_OPEN_LIBRARY, MYF(0), - udf->dl, errno, dlerror()); + dlpath, errno, dlerror()); goto err; } new_dl=1; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 7945bca1faa..11f8192809f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -335,6 +335,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token INSENSITIVE_SYM %token INSERT %token INSERT_METHOD +%token INSTALL_SYM %token INTERVAL_SYM %token INTO %token INT_SYM @@ -470,12 +471,14 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token OUTFILE %token OUT_SYM %token PACK_KEYS_SYM +%token PARSER_SYM %token PARTIAL %token PARTITION_SYM %token PARTITIONS_SYM %token PASSWORD %token PARAM_MARKER %token PHASE_SYM +%token PLUGIN_SYM %token POINTFROMTEXT %token POINT_SYM %token POLYFROMTEXT @@ -560,6 +563,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token SLAVE %token SMALLINT %token SNAPSHOT_SYM +%token SONAME_SYM %token SOUNDS_SYM %token SPATIAL_SYM %token SPECIFIC_SYM @@ -621,13 +625,13 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token TYPES_SYM %token TYPE_SYM %token UDF_RETURNS_SYM -%token UDF_SONAME_SYM %token ULONGLONG_NUM %token UNCOMMITTED_SYM %token UNDEFINED_SYM %token UNDERSCORE_CHARSET %token UNDO_SYM %token UNICODE_SYM +%token UNINSTALL_SYM %token UNION_SYM %token UNIQUE_SYM %token UNIQUE_USERS @@ -696,7 +700,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); sp_opt_label BIN_NUM label_ident %type <lex_str_ptr> - opt_table_alias + opt_table_alias opt_fulltext_parser %type <table> table_ident table_ident_nodb references xid @@ -844,7 +848,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); statement sp_suid opt_view_list view_list or_replace algorithm sp_c_chistics sp_a_chistics sp_chistic sp_c_chistic xa load_data opt_field_or_var_spec fields_or_vars opt_load_data_set_spec - view_user view_suid + install uninstall view_user view_suid partition_entry END_OF_INPUT @@ -906,6 +910,7 @@ statement: | handler | help | insert + | install | kill | load | lock @@ -930,6 +935,7 @@ statement: | slave | start | truncate + | uninstall | unlock | update | use @@ -1187,11 +1193,15 @@ create: lex->col_list.empty(); lex->change=NullS; } - '(' key_list ')' + '(' key_list ')' opt_fulltext_parser { LEX *lex=Lex; - - lex->key_list.push_back(new Key($2,$4.str, $5, 0, lex->col_list)); + if ($2 != Key::FULLTEXT && $12) + { + yyerror(ER(ER_SYNTAX_ERROR)); + YYABORT; + } + lex->key_list.push_back(new Key($2,$4.str,$5,0,lex->col_list,$12)); lex->col_list.empty(); } | CREATE DATABASE opt_if_not_exists ident @@ -1382,7 +1392,7 @@ sp_name: ; create_function_tail: - RETURNS_SYM udf_type UDF_SONAME_SYM TEXT_STRING_sys + RETURNS_SYM udf_type SONAME_SYM TEXT_STRING_sys { LEX *lex=Lex; lex->sql_command = SQLCOM_CREATE_FUNCTION; @@ -3302,10 +3312,15 @@ column_def: ; key_def: - key_type opt_ident key_alg '(' key_list ')' + key_type opt_ident key_alg '(' key_list ')' opt_fulltext_parser { LEX *lex=Lex; - lex->key_list.push_back(new Key($1,$2, $3, 0, lex->col_list)); + if ($1 != Key::FULLTEXT && $7) + { + yyerror(ER(ER_SYNTAX_ERROR)); + YYABORT; + } + lex->key_list.push_back(new Key($1,$2, $3, 0, lex->col_list, $7)); lex->col_list.empty(); /* Alloced by sql_alloc */ } | opt_constraint constraint_key_type opt_ident key_alg '(' key_list ')' @@ -3340,6 +3355,20 @@ key_def: } ; +opt_fulltext_parser: + /* empty */ { $$= (LEX_STRING *)0; } + | WITH PARSER_SYM IDENT_sys + { + if (plugin_is_ready(&$3, MYSQL_FTPARSER_PLUGIN)) + $$= (LEX_STRING *)sql_memdup(&$3, sizeof(LEX_STRING)); + else + { + my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), $3.str); + YYABORT; + } + } + ; + opt_check_constraint: /* empty */ | check_constraint @@ -8153,10 +8182,13 @@ keyword: | FLUSH_SYM {} | HANDLER_SYM {} | HELP_SYM {} + | INSTALL_SYM {} | LANGUAGE_SYM {} | NO_SYM {} | OPEN_SYM {} + | PARSER_SYM {} | PARTITION_SYM {} + | PLUGIN_SYM {} | PREPARE_SYM {} | REPAIR {} | RESET_SYM {} @@ -8166,10 +8198,12 @@ keyword: | SECURITY_SYM {} | SIGNED_SYM {} | SLAVE {} + | SONAME_SYM {} | START_SYM {} | STOP_SYM {} | TRUNCATE_SYM {} | UNICODE_SYM {} + | UNINSTALL_SYM {} | XA_SYM {} ; @@ -9732,4 +9766,19 @@ opt_migrate: | FOR_SYM MIGRATE_SYM { Lex->xa_opt=XA_FOR_MIGRATE; } ; +install: + INSTALL_SYM PLUGIN_SYM IDENT_sys SONAME_SYM TEXT_STRING_sys + { + LEX *lex= Lex; + lex->sql_command= SQLCOM_INSTALL_PLUGIN; + lex->comment= $3; + lex->ident= $5; + }; +uninstall: + UNINSTALL_SYM PLUGIN_SYM IDENT_sys + { + LEX *lex= Lex; + lex->sql_command= SQLCOM_UNINSTALL_PLUGIN; + lex->comment= $3; + }; diff --git a/sql/table.cc b/sql/table.cc index a163f671d01..39792b405c6 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -323,6 +323,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, if (! (share->connect_string.str= strmake_root(&outparam->mem_root, next_chunk + 2, share->connect_string.length))) { + DBUG_PRINT("EDS", ("strmake_root failed for connect_string")); my_free(buff, MYF(0)); goto err; } @@ -1064,9 +1065,20 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, int closefrm(register TABLE *table) { int error=0; + uint idx; + KEY *key_info; DBUG_ENTER("closefrm"); if (table->db_stat) error=table->file->close(); + key_info= table->key_info; + for (idx= table->s->keys; idx; idx--, key_info++) + { + if (key_info->flags & HA_USES_PARSER) + { + plugin_unlock(key_info->parser); + key_info->flags= 0; + } + } my_free((char*) table->alias, MYF(MY_ALLOW_ZERO_PTR)); table->alias= 0; if (table->field) |