List:Internals« Previous MessageNext Message »
From:kent Date:May 28 2005 3:12pm
Subject:bk commit into 5.1 tree (kent:1.1891)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mysqldev. When mysqldev 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.1891 05/05/28 15:12:24 kent@stripped +3 -0
  sql_class.h, sql_class.cc, log_event.h:
    Changes for HP-UX C++

  sql/sql_class.h
    1.245 05/05/28 15:11:57 kent@stripped +2 -6
    Changes for HP-UX C++

  sql/sql_class.cc
    1.193 05/05/28 15:11:57 kent@stripped +25 -22
    Changes for HP-UX C++

  sql/log_event.h
    1.121 05/05/28 15:11:56 kent@stripped +24 -0
    Changes for HP-UX C++

# 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:	kent
# Host:	production.mysql.com
# Root:	/data0/mysqldev/alcatel/mysql-5.1-wl2325

--- 1.120/sql/log_event.h	2005-05-25 18:55:57 +02:00
+++ 1.121/sql/log_event.h	2005-05-28 15:11:56 +02:00
@@ -1963,6 +1963,14 @@
 #ifndef MYSQL_CLIENT
   Write_rows_log_event(THD*, TABLE*, ulong table_id, 
 		       MY_BITMAP const* cols, bool is_transactional);
+
+  static Rows_log_event* 
+    Create(THD* thd, TABLE* table, ulong tid, MY_BITMAP const* cols, 
+	   bool is_trans)
+  {
+    return new Write_rows_log_event(thd,table,tid,cols,is_trans);
+  }
+	
 #endif
   Write_rows_log_event(const char* buf, uint event_len, 
                        const Format_description_log_event *description_event);
@@ -2009,6 +2017,14 @@
 #ifndef MYSQL_CLIENT
   Update_rows_log_event(THD*, TABLE*, ulong table_id, 
 			MY_BITMAP const* cols, bool is_transactional);
+
+  static Rows_log_event* 
+    Create(THD* thd, TABLE* table, ulong tid, MY_BITMAP const* cols, 
+	   bool is_trans)
+  {
+    return new Update_rows_log_event(thd,table,tid,cols,is_trans);
+  }
+	
 #endif
   Update_rows_log_event(const char* buf, uint event_len, 
 			const Format_description_log_event *description_event);
@@ -2059,6 +2075,14 @@
 #ifndef MYSQL_CLIENT
   Delete_rows_log_event(THD*, TABLE*, ulong, 
 			MY_BITMAP const* cols, bool is_transactional);
+
+  static Rows_log_event* 
+    Create(THD* thd, TABLE* table, ulong tid, MY_BITMAP const* cols, 
+	   bool is_trans)
+  {
+    return new Delete_rows_log_event(thd,table,tid,cols,is_trans);
+  }
+	
   virtual ~Delete_rows_log_event();
 #endif
   Delete_rows_log_event(const char* buf, uint event_len, 

--- 1.192/sql/sql_class.cc	2005-05-26 16:22:15 +02:00
+++ 1.193/sql/sql_class.cc	2005-05-28 15:11:57 +02:00
@@ -28,6 +28,7 @@
 
 #include "mysql_priv.h"
 #include "my_bitmap.h"
+#include "log_event.h"
 #include <m_ctype.h>
 #include <sys/stat.h>
 #include <thr_alarm.h>
@@ -1856,19 +1857,19 @@
  */
 
 template <class RowsEventT>
-Rows_log_event* THD::
-prepare_pending(TABLE* table, uint32 server_id, 
+Rows_log_event* 
+prepare_pending(THD* thd, TABLE* table, uint32 server_id, 
 		MY_BITMAP const* cols, size_t colcnt, 
                 size_t needed, bool is_transactional) 
 {
   // Fetch the type code for the RowsEventT template parameter
   int const type_code= RowsEventT::TYPE_CODE;
-  DBUG_ENTER("THD::prepare_pending<RowsEventT>(TABLE*, ...)");
+  DBUG_ENTER("prepare_pending<RowsEventT>(THD*, TABLE*, ...)");
   DBUG_PRINT("enter", ("table=%p (%s), type_code=%d, needed=%d", 
 		       table, table->s->table_name,
 		       type_code, needed));
 
-  Rows_log_event* pending= get_pending_event();
+  Rows_log_event* pending= thd->get_pending_event();
 
   if (pending) 
   {
@@ -1889,7 +1890,7 @@
   // event. Also check if the table provided is mapped: if it is not,
   // then we have switched to writing to a new table.
   bool was_mapped = false;
-  ulong const table_id= get_table_id(table);
+  ulong const table_id= thd->get_table_id(table);
   if (!pending ||
       pending->server_id != server_id || 
       pending->get_table_id() != table_id ||
@@ -1897,13 +1898,13 @@
       pending->get_data_size() + needed > opt_binlog_rows_event_max_size || 
       pending->get_width() != colcnt ||
       !bitmap_cmp(pending->get_cols(), cols) || 
-      !(was_mapped= is_table_mapped(table))) 
+      !(was_mapped= thd->is_table_mapped(table))) 
   {
     // If not, flush the event and create a new RowsEventT.
     Rows_log_event* const 
-	ev = new RowsEventT(this, table, table_id, cols, is_transactional);
+	ev = RowsEventT::Create(thd, table, table_id, cols, is_transactional);
     ev->server_id = server_id; // I don't like this, it's too easy to forget. 
-    if (!ev->write_to_binlog() || flush_and_set_pending_event(ev)) {
+    if (!ev->write_to_binlog() || thd->flush_and_set_pending_event(ev)) {
       delete ev;
       DBUG_RETURN(NULL);
     }
@@ -1912,7 +1913,7 @@
     // to write a map for it: unless the table was previously mapped,
     // of course.
     if (!was_mapped)
-      write_table_map(table, is_transactional);
+      thd->write_table_map(table, is_transactional);
     DBUG_RETURN(ev);
   }
   DBUG_RETURN(pending);
@@ -1923,18 +1924,18 @@
   compiling option.
 */
 
-template Rows_log_event* THD::
-prepare_pending<Write_rows_log_event>(TABLE*, uint32, 
+template Rows_log_event* 
+prepare_pending<Write_rows_log_event>(THD*, TABLE*, uint32, 
                                       MY_BITMAP const*, size_t colcnt, 
                                       size_t, bool);
 
-template Rows_log_event* THD::
-prepare_pending<Delete_rows_log_event>(TABLE*, uint32, 
+template Rows_log_event* 
+prepare_pending<Delete_rows_log_event>(THD*, TABLE*, uint32, 
                                        MY_BITMAP const*, size_t colcnt, 
                                        size_t, bool);
 
-template Rows_log_event* THD::
-prepare_pending<Update_rows_log_event>(TABLE*, uint32, 
+template Rows_log_event* 
+prepare_pending<Update_rows_log_event>(THD*, TABLE*, uint32, 
                                        MY_BITMAP const*, size_t colcnt, 
                                        size_t, bool);
 
@@ -2132,8 +2133,8 @@
   size_t const len= pack_row(table, cols, row_data, max_len, record);
 
   Rows_log_event* const
-    ev= thd->prepare_pending<Write_rows_log_event>(table, server_id, cols, 
-						   colcnt, len, is_trans);
+    ev= prepare_pending<Write_rows_log_event>(thd, table, server_id, cols, 
+					      colcnt, len, is_trans);
 
   if (ev)
   {
@@ -2192,10 +2193,10 @@
 				    after_maxlen, after_record);
   
   Rows_log_event* const
-    ev= thd->prepare_pending<Update_rows_log_event>(table, server_id, 
-                                                    cols, colcnt,
-						    before_size + after_size,
-                                                    is_trans);
+    ev= prepare_pending<Update_rows_log_event>(thd, table, server_id, 
+					       cols, colcnt,
+					       before_size + after_size,
+					       is_trans);
 
   if (likely(ev != 0))
   {
@@ -2228,6 +2229,8 @@
   if (!opt_binlog_row_level || !mysql_bin_log.is_open())
     DBUG_RETURN(0);
 
+  THD* const thd = current_thd;
+
   /* 
      Pack records into format for transfer. We are allocating more
      memory than needed, but that doesn't matter.
@@ -2240,7 +2243,7 @@
   size_t const len= pack_row(table, cols, row_data, max_len, record);
 
   Rows_log_event* const
-    ev= prepare_pending<Delete_rows_log_event>(table, server_id, 
+    ev= prepare_pending<Delete_rows_log_event>(thd, table, server_id, 
                                                cols, colcnt,
 					       len, is_trans);
 

--- 1.244/sql/sql_class.h	2005-05-26 16:22:15 +02:00
+++ 1.245/sql/sql_class.h	2005-05-28 15:11:57 +02:00
@@ -1094,7 +1094,9 @@
 
   void set_server_id(uint32 sid) { server_id = sid; }
 
+#if 0
 private:
+#endif
   /*
     Member functions to handle pending event for row-level logging.
   */
@@ -1103,12 +1105,6 @@
   int             set_pending_event(Rows_log_event* ev)
     { transaction.m_pending_rows_event= ev; return 0; }
   int             flush_and_set_pending_event(Rows_log_event*);
-
-  template <class RowsEventT>
-    Rows_log_event* 
-      prepare_pending(TABLE* table, uint32 server_id, 
-		      MY_BITMAP const* cols, size_t width,
-                      size_t needed, bool is_transactional);
 
   size_t max_row_length_blob(TABLE* table, const byte *data) const;
   size_t max_row_length(TABLE* table, const byte *data) const
Thread
bk commit into 5.1 tree (kent:1.1891)kent28 May