List:Internals« Previous MessageNext Message »
From:svoj Date:October 4 2005 12:27pm
Subject:bk commit into 5.0 tree (svoj:1.2005)
View as plain text  
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.2005 05/10/04 17:27:18 svoj@stripped +4 -0
  WL#2575 - Fulltext: Parser plugin for FTS

  sql/unireg.cc
    1.72 05/10/04 17:27:14 svoj@stripped +6 -3
    connect_string format reverted back to be compatible with 5.0.

  sql/table.cc
    1.195 05/10/04 17:27:14 svoj@stripped +8 -10
    connect_string format reverted back to be compatible with 5.0.

  sql/sql_plugin.h
    1.8 05/10/04 17:27:14 svoj@stripped +2 -1
    plugin_unlock accepts now st_plugin_int instead of LEX_STRING.
    Added plugin_is_ready function, it checks if plugin is in READY state.

  sql/sql_plugin.cc
    1.13 05/10/04 17:27:14 svoj@stripped +14 -4
    plugin_unlock accepts now st_plugin_int instead of LEX_STRING.
    Added plugin_is_ready function, it checks if plugin is in READY state.

# 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.194/sql/table.cc	2005-10-01 12:11:22 +05:00
+++ 1.195/sql/table.cc	2005-10-04 17:27:14 +05:00
@@ -349,7 +349,7 @@
     char *buff, *next_chunk, *buff_end;
     if (!(next_chunk= buff= my_malloc(n_length, MYF(MY_WME))))
       goto err;
-    if (my_pread(file, buff, n_length, record_offset + share->reclength,
+    if (my_pread(file, (byte*)buff, n_length, record_offset + share->reclength,
                  MYF(MY_NABP)))
     {
       my_free(buff, MYF(0));
@@ -357,16 +357,14 @@
     }
     if (share->db_type == DB_TYPE_FEDERATED_DB)
     {
-      share->connect_string.length= strlen(next_chunk);
-      if (! (share->connect_string.str= alloc_root(&outparam->mem_root,
-                                      share->connect_string.length + 1)))
+      share->connect_string.length= uint2korr(buff);
+      if (! (share->connect_string.str= strmake_root(&outparam->mem_root,
+              next_chunk + 2, share->connect_string.length)))
       {
-	my_free(buff, MYF(0));
-	goto err;
+        my_free(buff, MYF(0));
+        goto err;
       }
-      memcpy(share->connect_string.str, next_chunk,
-             share->connect_string.length + 1);
-      next_chunk+= share->connect_string.length + 1;
+      next_chunk+= share->connect_string.length + 2;
     }
     buff_end= buff + n_length;
     keyinfo= outparam->key_info;
@@ -995,7 +993,7 @@
   for (idx= table->s->keys; idx; idx--, key_info++)
   {
     if (key_info->flags & HA_USES_PARSER)
-      plugin_unlock(&key_info->parser->name);
+      plugin_unlock(key_info->parser);
   }
   my_free((char*) table->alias, MYF(MY_ALLOW_ZERO_PTR));
   table->alias= 0;

--- 1.71/sql/unireg.cc	2005-10-01 12:11:22 +05:00
+++ 1.72/sql/unireg.cc	2005-10-04 17:27:14 +05:00
@@ -124,7 +124,7 @@
       create_info->extra_size+= key_info[i].parser->name.length + 1;
   }
   if (create_info->db_type == DB_TYPE_FEDERATED_DB)
-    create_info->extra_size+= create_info->connect_string.length + 1;
+    create_info->extra_size+= create_info->connect_string.length + 2;
 
   if ((file=create_frm(thd, file_name, db, table, reclength, fileinfo,
 		       create_info, keys)) < 0)
@@ -162,8 +162,11 @@
 
   if (create_info->db_type == DB_TYPE_FEDERATED_DB)
   {
-    if (my_write(file, (const byte*)create_info->connect_string.str,
-                 create_info->connect_string.length + 1, MYF(MY_NABP)))
+    char buff[2];
+    int2store(buff, create_info->connect_string.length);
+    if (my_write(file, (const byte*)buff, sizeof(buff), MYF(MY_NABP)) ||
+        my_write(file, (const byte*)create_info->connect_string.str,
+                 create_info->connect_string.length, MYF(MY_NABP)))
       goto err;
   }
   for (i= 0; i < keys; i++)

--- 1.12/sql/sql_plugin.cc	2005-09-29 00:49:18 +05:00
+++ 1.13/sql/sql_plugin.cc	2005-10-04 17:27:14 +05:00
@@ -218,6 +218,18 @@
 }
 
 
+my_bool plugin_is_ready(LEX_STRING *name, int type)
+{
+  my_bool rc= FALSE;
+  DBUG_ENTER("plugin_is_ready");
+  rw_wrlock(&THR_LOCK_plugin);
+  if (plugin_find_internal(name, type))
+    rc= TRUE;
+  rw_unlock(&THR_LOCK_plugin);
+  DBUG_RETURN(rc);
+}
+
+
 struct st_plugin_int *plugin_lock(LEX_STRING *name, int type)
 {
   struct st_plugin_int *rc;
@@ -301,19 +313,17 @@
 }
 
 
-void plugin_unlock(LEX_STRING *name)
+void plugin_unlock(struct st_plugin_int *plugin)
 {
-  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);
+    plugin_del(&plugin->name);
   }
   rw_unlock(&THR_LOCK_plugin);
   DBUG_VOID_RETURN;

--- 1.7/sql/sql_plugin.h	2005-09-27 20:28:00 +05:00
+++ 1.8/sql/sql_plugin.h	2005-10-04 17:27:14 +05:00
@@ -46,8 +46,9 @@
 extern char *opt_plugin_dir;
 extern void plugin_init(void);
 extern void plugin_free(void);
+extern my_bool plugin_is_ready(LEX_STRING *name, int type);
 extern st_plugin_int *plugin_lock(LEX_STRING *name, int type);
-extern void plugin_unlock(LEX_STRING *name);
+extern void plugin_unlock(struct st_plugin_int *plugin);
 extern my_bool mysql_install_plugin(THD *thd, LEX_STRING *name, LEX_STRING *dl);
 extern my_bool mysql_uninstall_plugin(THD *thd, LEX_STRING *name);
 #endif
Thread
bk commit into 5.0 tree (svoj:1.2005)svoj4 Oct