List:Commits« Previous MessageNext Message »
From:jonas Date:January 9 2006 1:39pm
Subject:bk commit into 5.1 tree (jonas:1.1990)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas 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.1990 06/01/09 14:39:41 jonas@stripped +9 -0
  Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new
  into  perch.ndb.mysql.com:/home/jonas/src/51-dd

  storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
    1.16 06/01/09 14:39:37 jonas@stripped +0 -0
    Auto merged

  sql/sql_parse.cc
    1.487 06/01/09 14:39:37 jonas@stripped +0 -0
    Auto merged

  sql/mysql_priv.h
    1.348 06/01/09 14:39:37 jonas@stripped +0 -0
    Auto merged

  sql/item_xmlfunc.cc
    1.4 06/01/09 14:39:37 jonas@stripped +0 -1
    Auto merged

  sql/handler.h
    1.172 06/01/09 14:39:37 jonas@stripped +0 -0
    Auto merged

  sql/ha_ndbcluster.h
    1.101 06/01/09 14:39:37 jonas@stripped +0 -0
    Auto merged

  sql/ha_ndbcluster.cc
    1.222 06/01/09 14:39:37 jonas@stripped +0 -0
    Auto merged

  sql/ha_federated.cc
    1.48 06/01/09 14:39:37 jonas@stripped +0 -0
    Auto merged

  mysql-test/t/rpl_multi_engine.test
    1.3 06/01/09 14:39:37 jonas@stripped +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:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/51-dd/RESYNC

--- 1.171/sql/handler.h	2006-01-04 16:27:58 +01:00
+++ 1.172/sql/handler.h	2006-01-09 14:39:37 +01:00
@@ -1615,7 +1615,7 @@
 
 inline bool ha_storage_engine_is_enabled(const handlerton *db_type)
 {
-  return (db_type && db_type->create) ? 
+  return (db_type && db_type->create) ?
          (db_type->state == SHOW_OPTION_YES) : FALSE;
 }
 
@@ -1626,7 +1626,6 @@
 
 TYPELIB *ha_known_exts(void);
 int ha_panic(enum ha_panic_function flag);
-int ha_update_statistics();
 void ha_close_connection(THD* thd);
 bool ha_flush_logs(handlerton *db_type);
 void ha_drop_database(char* path);

--- 1.347/sql/mysql_priv.h	2006-01-04 16:27:58 +01:00
+++ 1.348/sql/mysql_priv.h	2006-01-09 14:39:37 +01:00
@@ -292,7 +292,7 @@
 #define OPTION_SETUP_TABLES_DONE        (LL(1) << 30) // intern
 /* If not set then the thread will ignore all warnings with level notes. */
 #define OPTION_SQL_NOTES                (LL(1) << 31) // THD, user
-/* 
+/*
   Force the used temporary table to be a MyISAM table (because we will use
   fulltext functions when reading from it.
 */
@@ -322,7 +322,7 @@
 #define MODE_DB2			2048
 #define MODE_MAXDB			4096
 #define MODE_NO_KEY_OPTIONS             8192
-#define MODE_NO_TABLE_OPTIONS           16384 
+#define MODE_NO_TABLE_OPTIONS           16384
 #define MODE_NO_FIELD_OPTIONS           32768
 #define MODE_MYSQL323                   65536
 #define MODE_MYSQL40                    (MODE_MYSQL323*2)
@@ -513,13 +513,11 @@
 void cleanup_items(Item *item);
 class THD;
 void close_thread_tables(THD *thd, bool locked=0, bool skip_derived=0);
-bool check_one_table_access(THD *thd, ulong privilege,
-			   TABLE_LIST *tables);
+bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables);
 bool check_routine_access(THD *thd,ulong want_access,char *db,char *name,
 			  bool is_proc, bool no_errors);
 bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table);
-bool check_merge_table_access(THD *thd, char *db,
-			      TABLE_LIST *table_list);
+bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list);
 bool check_some_routine_access(THD *thd, const char *db, const char *name, bool is_proc);
 bool multi_update_precheck(THD *thd, TABLE_LIST *tables);
 bool multi_delete_precheck(THD *thd, TABLE_LIST *tables);
@@ -885,6 +883,10 @@
 void append_definer(THD *thd, String *buffer, const LEX_STRING *definer_user,
                     const LEX_STRING *definer_host);
 
+int add_status_vars(SHOW_VAR *list);
+void remove_status_vars(SHOW_VAR *list);
+void init_status_vars();
+void free_status_vars();
 
 /* information schema */
 extern LEX_STRING information_schema_name;
@@ -1270,7 +1272,7 @@
 extern MY_BITMAP temp_pool;
 extern String my_empty_string;
 extern const String my_null_string;
-extern SHOW_VAR init_vars[],status_vars[], internal_vars[];
+extern SHOW_VAR init_vars[], status_vars[], internal_vars[];
 extern struct system_variables global_system_variables;
 extern struct system_variables max_system_variables;
 extern struct system_status_var global_status_var;

--- 1.486/sql/sql_parse.cc	2006-01-04 16:27:59 +01:00
+++ 1.487/sql/sql_parse.cc	2006-01-09 14:39:37 +01:00
@@ -4862,7 +4862,6 @@
   if (thd->one_shot_set && lex->sql_command != SQLCOM_SET_OPTION)
     reset_one_shot_variables(thd);
 
-
   /*
     The return value for ROW_COUNT() is "implementation dependent" if the
     statement is not DELETE, INSERT or UPDATE, but -1 is what JDBC and ODBC
@@ -4874,13 +4873,10 @@
   if (lex->sql_command != SQLCOM_CALL && lex->sql_command != SQLCOM_EXECUTE &&
       uc_update_queries[lex->sql_command]<2)
     thd->row_count_func= -1;
-  goto cleanup;
+  DBUG_RETURN(res || thd->net.report_error);
 
 error:
-  res= 1;
-
-cleanup:
-  DBUG_RETURN(res || thd->net.report_error);
+  DBUG_RETURN(1);
 }
 
 
@@ -5103,7 +5099,7 @@
     the given table list refers to the list for prelocking (contains tables
     of other queries). For simple queries first_not_own_table is 0.
   */
-  for (; tables && tables != first_not_own_table; tables= tables->next_global)
+  for (; tables != first_not_own_table; tables= tables->next_global)
   {
     if (tables->schema_table && 
         (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
@@ -6647,18 +6643,15 @@
 static void refresh_status(void)
 {
   pthread_mutex_lock(&LOCK_status);
-  for (struct show_var_st *ptr=status_vars; ptr->name; ptr++)
-  {
-    if (ptr->type == SHOW_LONG)
+  for (SHOW_VAR *ptr= status_vars; ptr->name; ptr++)
+    if (ptr->type == SHOW_LONG) // note that SHOW_LONG_NOFLUSH variables are not reset
       *(ulong*) ptr->value= 0;
-    else if (ptr->type == SHOW_LONG_STATUS)
-    {
-      THD *thd= current_thd;
-      /* We must update the global status before cleaning up the thread */
-      add_to_status(&global_status_var, &thd->status_var);
-      bzero((char*) &thd->status_var, sizeof(thd->status_var));
-    }
-  }
+
+  /* We must update the global status before cleaning up the thread */
+  THD *thd= current_thd;
+  add_to_status(&global_status_var, &thd->status_var);
+  bzero((char*) &thd->status_var, sizeof(thd->status_var));
+
   /* Reset the counters of all key caches (default and named). */
   process_key_caches(reset_key_cache_counters);
   pthread_mutex_unlock(&LOCK_status);
@@ -7269,7 +7262,7 @@
 
   /* Create and initialize. */
 
-  if (! (definer= (LEX_USER*) thd->alloc(sizeof (LEX_USER))))
+  if (! (definer= (LEX_USER*) thd->alloc(sizeof(LEX_USER))))
     return 0;
 
   definer->user= *user_name;

--- 1.2/mysql-test/t/rpl_multi_engine.test	2005-12-23 05:32:39 +01:00
+++ 1.3/mysql-test/t/rpl_multi_engine.test	2006-01-09 14:39:37 +01:00
@@ -24,6 +24,7 @@
 connection master;
 alter table t1 engine=myisam;
 show create table t1;
+sync_slave_with_master;
 
 connection slave;
 alter table t1 engine=myisam;
@@ -48,6 +49,7 @@
 connection master;
 alter table t1 engine=memory;
 show create table t1;
+sync_slave_with_master;
 
 sync_slave_with_master;
 
@@ -74,6 +76,7 @@
 connection master;
 alter table t1 engine=innodb;
 show create table t1;
+sync_slave_with_master;
 
 connection slave;
 alter table t1 engine=myisam;
@@ -96,6 +99,8 @@
 # cleanup
 connection master;
 DROP TABLE t1;
+# Need to drop mysqltest1 as well so other test will pass.
+DROP DATABASE mysqltest1;
 sync_slave_with_master;
 
 # End of 5.1 test case

--- 1.221/sql/ha_ndbcluster.cc	2006-01-04 16:27:58 +01:00
+++ 1.222/sql/ha_ndbcluster.cc	2006-01-09 14:39:37 +01:00
@@ -226,7 +226,7 @@
   return 0;
 }
 
-struct show_var_st ndb_status_variables[]= {
+SHOW_VAR ndb_status_variables[]= {
   {"cluster_node_id",        (char*) &ndb_cluster_node_id,         SHOW_LONG},
   {"connected_host",         (char*) &ndb_connected_host,      SHOW_CHAR_PTR},
   {"connected_port",         (char*) &ndb_connected_port,          SHOW_LONG},
@@ -372,7 +372,8 @@
   if (ndb)
   {
 #ifndef DBUG_OFF
-    Ndb::Free_list_usage tmp; tmp.m_name= 0;
+    Ndb::Free_list_usage tmp;
+    tmp.m_name= 0;
     while (ndb->get_free_list_usage(&tmp))
     {
       uint leaked= (uint) tmp.m_created - tmp.m_free;
@@ -384,8 +385,8 @@
     }
 #endif
     delete ndb;
+    ndb= NULL;
   }
-  ndb= NULL;
   changed_tables.empty();
 }
 
@@ -3361,6 +3362,10 @@
   if (lock_type != F_UNLCK)
   {
     DBUG_PRINT("info", ("lock_type != F_UNLCK"));
+    if (!thd->transaction.on)
+      m_transaction_on= FALSE;
+    else
+      m_transaction_on= thd->variables.ndb_use_transactions;
     if (!thd_ndb->lock_count++)
     {
       PRINT_OPTION_FLAGS(thd);
@@ -3375,7 +3380,8 @@
           ERR_RETURN(ndb->getNdbError());
         no_uncommitted_rows_reset(thd);
         thd_ndb->stmt= trans;
-        trans_register_ha(thd, FALSE, &ndbcluster_hton);
+        if (m_transaction_on)
+          trans_register_ha(thd, FALSE, &ndbcluster_hton);
       } 
       else 
       { 
@@ -3390,7 +3396,8 @@
             ERR_RETURN(ndb->getNdbError());
           no_uncommitted_rows_reset(thd);
           thd_ndb->all= trans; 
-          trans_register_ha(thd, TRUE, &ndbcluster_hton);
+          if (m_transaction_on)
+            trans_register_ha(thd, TRUE, &ndbcluster_hton);
 
           /*
             If this is the start of a LOCK TABLE, a table look 
@@ -3424,10 +3431,6 @@
     m_ha_not_exact_count= !thd->variables.ndb_use_exact_count;
     m_autoincrement_prefetch= 
       (ha_rows) thd->variables.ndb_autoincrement_prefetch_sz;
-    if (!thd->transaction.on)
-      m_transaction_on= FALSE;
-    else
-      m_transaction_on= thd->variables.ndb_use_transactions;
 
     m_active_trans= thd_ndb->all ? thd_ndb->all : thd_ndb->stmt;
     DBUG_ASSERT(m_active_trans);
@@ -5166,7 +5169,8 @@
   if (g_ndb)
   {
 #ifndef DBUG_OFF
-    Ndb::Free_list_usage tmp; tmp.m_name= 0;
+    Ndb::Free_list_usage tmp;
+    tmp.m_name= 0;
     while (g_ndb->get_free_list_usage(&tmp))
     {
       uint leaked= (uint) tmp.m_created - tmp.m_free;
@@ -5178,10 +5182,9 @@
     }
 #endif
     delete g_ndb;
+    g_ndb= NULL;
   }
-  g_ndb= NULL;
-  if (g_ndb_cluster_connection)
-    delete g_ndb_cluster_connection;
+  delete g_ndb_cluster_connection;
   g_ndb_cluster_connection= NULL;
 
   hash_free(&ndbcluster_open_tables);
@@ -8069,7 +8072,8 @@
   if (get_thd_ndb(thd) && get_thd_ndb(thd)->ndb)
   {
     Ndb* ndb= (get_thd_ndb(thd))->ndb;
-    Ndb::Free_list_usage tmp; tmp.m_name= 0;
+    Ndb::Free_list_usage tmp;
+    tmp.m_name= 0;
     while (ndb->get_free_list_usage(&tmp))
     {
       uint buflen=

--- 1.100/sql/ha_ndbcluster.h	2005-12-22 01:29:11 +01:00
+++ 1.101/sql/ha_ndbcluster.h	2006-01-09 14:39:37 +01:00
@@ -770,7 +770,7 @@
   Ndb *get_ndb();
 };
 
-extern struct show_var_st ndb_status_variables[];
+extern SHOW_VAR ndb_status_variables[];
 
 bool ndbcluster_init(void);
 int ndbcluster_end(ha_panic_function flag);

--- 1.47/sql/ha_federated.cc	2005-12-29 08:19:36 +01:00
+++ 1.48/sql/ha_federated.cc	2006-01-09 14:39:37 +01:00
@@ -2608,8 +2608,7 @@
 {
   DBUG_ENTER("ha_federated::stash_remote_error()");
   remote_error_number= mysql_errno(mysql);
-  my_snprintf(remote_error_buf, sizeof(remote_error_buf), "%s",
-              mysql_error(mysql));
+  strmake(remote_error_buf, mysql_error(mysql), sizeof(remote_error_buf)-1);
   DBUG_RETURN(HA_FEDERATED_ERROR_WITH_REMOTE_SYSTEM);
 }
 
Thread
bk commit into 5.1 tree (jonas:1.1990)jonas9 Jan