List:Commits« Previous MessageNext Message »
From:tomas Date:January 5 2006 8:26am
Subject:bk commit into 5.1 tree (tomas:1.1991)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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.1991 06/01/05 09:25:50 tomas@stripped +3 -0
  post merge fixes

  sql/ha_ndbcluster_binlog.cc
    1.4 06/01/05 09:25:43 tomas@stripped +52 -25
    post merge fixes

  sql/ha_ndbcluster.cc
    1.233 06/01/05 09:25:43 tomas@stripped +2 -2
    post merge fixes

  mysql-test/t/ndb_database.test
    1.3 06/01/05 09:25:43 tomas@stripped +1 -1
    post merge fixes

# 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:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-wl2325-repl

--- 1.232/sql/ha_ndbcluster.cc	2006-01-04 16:39:14 +01:00
+++ 1.233/sql/ha_ndbcluster.cc	2006-01-05 09:25:43 +01:00
@@ -5060,7 +5060,7 @@
                                          ndb_binlog_thread_running > 0 &&
                                          !is_prefix(elmt.name,
                                                     tmp_file_prefix),
-                                         share, FALSE);
+                                         share, TRUE);
           pthread_mutex_unlock(&LOCK_open);
         }
         else
@@ -5200,7 +5200,7 @@
         pthread_mutex_lock(&LOCK_open);
         ndbcluster_create_binlog_setup(ndb, name, db, file_name,
                                        !is_prefix(file_name, tmp_file_prefix),
-                                       share, FALSE);
+                                       share, TRUE);
         pthread_mutex_unlock(&LOCK_open);
         pthread_mutex_lock(&ndbcluster_mutex);
       }

--- 1.2/mysql-test/t/ndb_database.test	2005-07-28 02:21:45 +02:00
+++ 1.3/mysql-test/t/ndb_database.test	2006-01-05 09:25:43 +01:00
@@ -19,7 +19,7 @@
 create database mysqltest;
 
 connection server2;
-create database mysqltest;
+create database if not exists mysqltest;
 create table mysqltest.t1 (a int primary key, b int) engine=ndb;
 use mysqltest;
 show tables;

--- 1.3/sql/ha_ndbcluster_binlog.cc	2006-01-04 16:03:13 +01:00
+++ 1.4/sql/ha_ndbcluster_binlog.cc	2006-01-05 09:25:43 +01:00
@@ -129,8 +129,8 @@
               "reclength: %d  rec_buff_length: %d  record[0]: %lx  "
               "record[1]: %lx",
               info,
-              table->s->db,
-              table->s->table_name,
+              table->s->db.str,
+              table->s->table_name.str,
               table->s->fields,
               table->s->reclength,
               table->s->rec_buff_length,
@@ -228,38 +228,61 @@
 */
 void ndbcluster_binlog_init_share(NDB_SHARE *share)
 {
+  THD *thd= current_thd;
   MEM_ROOT *mem_root= &share->mem_root;
 
   share->op= 0;
   share->table= 0;
   while (ndb_binlog_thread_running > 0)
   {
+    TABLE_SHARE *table_share= 
+      (TABLE_SHARE *) my_malloc(sizeof(*table_share), MYF(MY_WME));
     TABLE *table= (TABLE*) my_malloc(sizeof(*table), MYF(MY_WME));
-    int r;
-    if ((r= openfrm(current_thd, share->key, "", 0, (uint) READ_ALL,
-                    0, table)))
-    {
-      sql_print_error("Unable to open frm for %s, frmerror=%d",
-                      share->key, r);
-      DBUG_PRINT("error", ("openfrm failed %d", r));
+    int error;
+
+    init_tmp_table_share(table_share, share->db, 0, share->table_name, 
+                         share->key);
+    if ((error= open_table_def(thd, table_share, 0)))
+    {
+      sql_print_error("Unable to get table share for %s, error=%d",
+                      share->key, error);
+      DBUG_PRINT("error", ("open_table_def failed %d", error));
+      my_free((gptr) table_share, MYF(0));
+      table_share= 0;
+      my_free((gptr) table, MYF(0));
+      table= 0;
+      break;
+    }
+    if ((error= open_table_from_share(thd, table_share, "", 0, 
+                                      (uint) READ_ALL, 0, table)))
+    {
+      sql_print_error("Unable to open table for %s, error=%d(%d)",
+                      share->key, error, my_errno);
+      DBUG_PRINT("error", ("open_table_from_share failed %d", error));
+      my_free((gptr) table_share, MYF(0));
+      table_share= 0;
       my_free((gptr) table, MYF(0));
       table= 0;
       break;
     }
+    assign_new_table_id(table);
     if (!table->record[1] || table->record[1] == table->record[0])
     {
       table->record[1]= alloc_root(&table->mem_root,
                                    table->s->rec_buff_length);
     }
     table->in_use= injector_thd;
-    
-    table->s->db= share->db;
-    table->s->table_name= share->table_name;
-    
+        
+    table->s->db.str= share->db;
+    table->s->db.length= strlen(share->db);
+    table->s->table_name.str= share->table_name;
+    table->s->table_name.length= strlen(share->table_name);
+ 
+    share->table_share= table_share;
     share->table= table;
-
+#ifndef DBUG_OFF
     dbug_print_table("table", table);
-
+#endif
     /*
       ! do not touch the contents of the table
       it may be in use by the injector thread
@@ -440,7 +463,7 @@
       if (share->table)
         DBUG_PRINT("share",
                    ("table->s->db.table_name: %s.%s",
-                    share->table->s->db, share->table->s->table_name));
+                    share->table->s->db.str, share->table->s->table_name.str));
       if (share->state != NSS_DROPPED && !--share->use_count)
         real_free_share(&share);
       else
@@ -1179,10 +1202,10 @@
   if (pOp->getEventType() != NDBEVENT::TE_CLUSTER_FAILURE &&
       pOp->getReqNodeId() != g_ndb_cluster_connection->node_id())
   {
-    ndb->setDatabaseName(share->table->s->db);
+    ndb->setDatabaseName(share->table->s->db.str);
     ha_ndbcluster::invalidate_dictionary_cache(share->table,
                                                ndb,
-                                               share->table->s->table_name,
+                                               share->table->s->table_name.str,
                                                TRUE);
     remote_drop_table= 1;
   }
@@ -1337,8 +1360,10 @@
       break;
     case NDBEVENT::TE_ALTER:
       /* do the rename of the table in the share */
-      share->table->s->db= share->db;
-      share->table->s->table_name= share->table_name;
+      share->table->s->db.str= share->db;
+      share->table->s->db.length= strlen(share->db);
+      share->table->s->table_name.str= share->table_name;
+      share->table->s->table_name.length= strlen(share->table_name);
       ndb_handle_schema_change(thd, ndb, pOp, share);
       break;
     case NDBEVENT::TE_CLUSTER_FAILURE:
@@ -1609,7 +1634,7 @@
   {
     /*
       ToDo make sanity check of share so that the table is actually the same
-      I.e. we need to do openfrm in this case
+      I.e. we need to do open file from frm in this case
       Currently awaiting this to be fixed in the 4.1 tree in the general
       case
     */
@@ -2099,12 +2124,14 @@
   case NDBEVENT::TE_ALTER:
     /* ToDo: remove printout */
     sql_print_information("NDB Binlog: rename table %s%s/%s -> %s.",
-                          share_prefix, share->table->s->db,
-                          share->table->s->table_name,
+                          share_prefix, share->table->s->db.str,
+                          share->table->s->table_name.str,
                           share->key);
     /* do the rename of the table in the share */
-    share->table->s->db= share->db;
-    share->table->s->table_name= share->table_name;
+    share->table->s->db.str= share->db;
+    share->table->s->db.length= strlen(share->db);
+    share->table->s->table_name.str= share->table_name;
+    share->table->s->table_name.length= strlen(share->table_name);
     goto drop_alter_common;
   case NDBEVENT::TE_DROP:
     if (apply_status_share == share)
Thread
bk commit into 5.1 tree (tomas:1.1991)tomas5 Jan