List:Commits« Previous MessageNext Message »
From:msvensson Date:February 7 2006 5:12pm
Subject:bk commit into 5.1 tree (msvensson:1.2083)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of msvensson. When msvensson 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.2083 06/02/07 18:12:23 msvensson@neptunus.(none) +2 -0
  Merge neptunus.(none):/home/msvensson/mysql/bug15302/my51-bug15302
  into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new

  sql/sql_db.cc
    1.127 06/02/07 18:12:16 msvensson@neptunus.(none) +0 -0
    Auto merged

  client/mysqltest.c
    1.178 06/02/07 18:12:16 msvensson@neptunus.(none) +0 -0
    Auto merged

# 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:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/mysql-5.1-new/RESYNC

--- 1.126/sql/sql_db.cc	2006-01-31 12:53:34 +01:00
+++ 1.127/sql/sql_db.cc	2006-02-07 18:12:16 +01:00
@@ -287,7 +287,7 @@
 }
 
 
-/* 
+/*
   Load database options file
 
   load_db_opt()
@@ -313,68 +313,72 @@
 
   bzero((char*) create,sizeof(*create));
   create->default_table_charset= thd->variables.collation_server;
-  
+
   /* Check if options for this database are already in the hash */
   if (!get_dbopt(path, create))
-    DBUG_RETURN(0);	   
-  
+    DBUG_RETURN(0);
+
   /* Otherwise, load options from the .opt file */
-  if ((file=my_open(path, O_RDONLY | O_SHARE, MYF(0))) >= 0)
-  {
-    IO_CACHE cache;
-    init_io_cache(&cache, file, IO_SIZE, READ_CACHE, 0, 0, MYF(0));
+  if ((file=my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0)
+    goto err1;
 
-    while ((int) (nbytes= my_b_gets(&cache, (char*) buf, sizeof(buf))) > 0)
+  IO_CACHE cache;
+  if (init_io_cache(&cache, file, IO_SIZE, READ_CACHE, 0, 0, MYF(0)))
+    goto err2;
+
+  while ((int) (nbytes= my_b_gets(&cache, (char*) buf, sizeof(buf))) > 0)
+  {
+    char *pos= buf+nbytes-1;
+    /* Remove end space and control characters */
+    while (pos > buf && !my_isgraph(&my_charset_latin1, pos[-1]))
+      pos--;
+    *pos=0;
+    if ((pos= strchr(buf, '=')))
     {
-      char *pos= buf+nbytes-1;
-      /* Remove end space and control characters */
-      while (pos > buf && !my_isgraph(&my_charset_latin1, pos[-1]))
-	pos--;
-      *pos=0;
-      if ((pos= strchr(buf, '=')))
+      if (!strncmp(buf,"default-character-set", (pos-buf)))
       {
-	if (!strncmp(buf,"default-character-set", (pos-buf)))
-	{
-          /*
-             Try character set name, and if it fails 
-             try collation name, probably it's an old
-             4.1.0 db.opt file, which didn't have
-             separate default-character-set and
-             default-collation commands.
-          */
-	  if (!(create->default_table_charset=
-		get_charset_by_csname(pos+1, MY_CS_PRIMARY, MYF(0))) &&
-              !(create->default_table_charset=
-                get_charset_by_name(pos+1, MYF(0))))
-	  {
-	    sql_print_error("Error while loading database options: '%s':",path);
-	    sql_print_error(ER(ER_UNKNOWN_CHARACTER_SET),pos+1);
-            create->default_table_charset= default_charset_info;
-	  }
-	}
-	else if (!strncmp(buf,"default-collation", (pos-buf)))
-	{
-	  if (!(create->default_table_charset= get_charset_by_name(pos+1,
-								   MYF(0))))
-	  {
-	    sql_print_error("Error while loading database options: '%s':",path);
-	    sql_print_error(ER(ER_UNKNOWN_COLLATION),pos+1);
-            create->default_table_charset= default_charset_info;
-	  }
-	}
+        /*
+           Try character set name, and if it fails
+           try collation name, probably it's an old
+           4.1.0 db.opt file, which didn't have
+           separate default-character-set and
+           default-collation commands.
+        */
+        if (!(create->default_table_charset=
+        get_charset_by_csname(pos+1, MY_CS_PRIMARY, MYF(0))) &&
+            !(create->default_table_charset=
+              get_charset_by_name(pos+1, MYF(0))))
+        {
+          sql_print_error("Error while loading database options: '%s':",path);
+          sql_print_error(ER(ER_UNKNOWN_CHARACTER_SET),pos+1);
+          create->default_table_charset= default_charset_info;
+        }
+      }
+      else if (!strncmp(buf,"default-collation", (pos-buf)))
+      {
+        if (!(create->default_table_charset= get_charset_by_name(pos+1,
+                                                           MYF(0))))
+        {
+          sql_print_error("Error while loading database options: '%s':",path);
+          sql_print_error(ER(ER_UNKNOWN_COLLATION),pos+1);
+          create->default_table_charset= default_charset_info;
+        }
       }
     }
-    end_io_cache(&cache);
-    my_close(file,MYF(0));
-    /*
-      Put the loaded value into the hash.
-      Note that another thread could've added the same
-      entry to the hash after we called get_dbopt(),
-      but it's not an error, as put_dbopt() takes this
-      possibility into account.
-    */
-    error= put_dbopt(path, create);
   }
+  /*
+    Put the loaded value into the hash.
+    Note that another thread could've added the same
+    entry to the hash after we called get_dbopt(),
+    but it's not an error, as put_dbopt() takes this
+    possibility into account.
+  */
+  error= put_dbopt(path, create);
+
+  end_io_cache(&cache);
+err2:
+  my_close(file,MYF(0));
+err1:
   DBUG_RETURN(error);
 }
 
@@ -503,7 +507,7 @@
       query_length= thd->query_length;
     }
 
-    ha_binlog_log_query(thd, LOGCOM_CREATE_DB,
+    ha_binlog_log_query(thd, 0, LOGCOM_CREATE_DB,
                         query, query_length,
                         db, "");
 
@@ -581,7 +585,7 @@
     thd->variables.collation_database= thd->db_charset;
   }
 
-  ha_binlog_log_query(thd, LOGCOM_ALTER_DB,
+  ha_binlog_log_query(thd, 0, LOGCOM_ALTER_DB,
                       thd->query, thd->query_length,
                       db, "");
 
Thread
bk commit into 5.1 tree (msvensson:1.2083)msvensson7 Feb