Below is the list of changes that have just been committed into a local
5.0 repository of svoj. When svoj does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1914 05/09/27 17:12:03 svoj@stripped +1 -0
WL#2575 - Fulltext: Parser plugin for FTS
- UNINSTALL PLUGIN handler.
sql/sql_plugin.cc
1.12 05/09/27 17:11:59 svoj@stripped +61 -14
UNINSTALL PLUGIN handler.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: svoj
# Host: svoj-laptop.mysql.com
# Root: /home/svoj/devel/mysql/CNET/mysql-5.0
--- 1.11/sql/sql_plugin.cc 2005-09-27 16:14:11 +05:00
+++ 1.12/sql/sql_plugin.cc 2005-09-27 17:11:59 +05:00
@@ -242,19 +242,6 @@
}
-void plugin_release(LEX_STRING *name)
-{
- struct st_plugin_int *plugin;
- DBUG_ENTER("plugin_release");
- rw_wrlock(&THR_LOCK_plugin);
- plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN);
- DBUG_ASSERT(plugin && plugin->ref_count);
- plugin->ref_count--;
- rw_unlock(&THR_LOCK_plugin);
- DBUG_VOID_RETURN;
-}
-
-
static my_bool plugin_add(LEX_STRING *name, LEX_STRING *dl, int report)
{
struct st_plugin_int tmp;
@@ -326,6 +313,25 @@
}
+void plugin_release(LEX_STRING *name)
+{
+ struct st_plugin_int *plugin;
+ DBUG_ENTER("plugin_release");
+ rw_wrlock(&THR_LOCK_plugin);
+ plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN);
+ DBUG_ASSERT(plugin && plugin->ref_count);
+ plugin->ref_count--;
+ if (plugin->state == PLUGIN_IS_DELETED && ! plugin->ref_count)
+ {
+ if (plugin->plugin->deinit)
+ plugin->plugin->deinit();
+ plugin_del(name);
+ }
+ rw_unlock(&THR_LOCK_plugin);
+ DBUG_VOID_RETURN;
+}
+
+
static void plugin_call_initializer(void)
{
uint i;
@@ -524,5 +530,46 @@
my_bool mysql_uninstall_plugin(THD *thd, LEX_STRING *name)
{
- return FALSE;
+ TABLE *table;
+ TABLE_LIST tables;
+ struct st_plugin_int *plugin;
+ DBUG_ENTER("mysql_uninstall_plugin");
+ rw_wrlock(&THR_LOCK_plugin);
+ if (! (plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))
+ {
+ my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "Plugin", name->str);
+ goto err;
+ }
+ if (plugin->ref_count)
+ plugin->state= PLUGIN_IS_DELETED;
+ else
+ {
+ if (plugin->plugin->deinit)
+ plugin->plugin->deinit();
+ plugin_del(name);
+ }
+ bzero(&tables, sizeof(tables));
+ tables.db= (char *)"mysql";
+ tables.table_name= tables.alias= (char *)"plugin";
+ if (! (table= open_ltable(thd, &tables, TL_WRITE)))
+ goto err;
+ table->field[0]->store(name->str, name->length, system_charset_info);
+ table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
+ if (! table->file->index_read_idx(table->record[0], 0,
+ (byte *)table->field[0]->ptr,
+ table->key_info[0].key_length,
+ HA_READ_KEY_EXACT))
+ {
+ int error;
+ if ((error= table->file->delete_row(table->record[0])))
+ {
+ table->file->print_error(error, MYF(0));
+ goto err;
+ }
+ }
+ rw_unlock(&THR_LOCK_plugin);
+ DBUG_RETURN(FALSE);
+err:
+ rw_unlock(&THR_LOCK_plugin);
+ DBUG_RETURN(TRUE);
}
| Thread |
|---|
| • bk commit into 5.0 tree (svoj:1.1914) | svoj | 27 Sep |