List:Commits« Previous MessageNext Message »
From:Lars Thalmann Date:December 14 2005 10:37pm
Subject:bk commit into 5.1 tree (lars:1.1964)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of lthalmann. When lthalmann 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.1964 05/12/14 23:36:54 lars@stripped +2 -0
  Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-wl1012-v3
  into  mysql.com:/users/lthalmann/bk/mysql-5.1-wl1012-v3-wl2321-max

  sql/log_event.h
    1.147 05/12/14 23:36:38 lars@stripped +0 -0
    Auto merged

  sql/log_event.cc
    1.202 05/12/14 23:36:36 lars@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:	lars
# Host:	dl145h.mysql.com
# Root:	/users/lthalmann/bk/mysql-5.1-wl1012-v3-wl2321-max/RESYNC

--- 1.201/sql/log_event.cc	2005-12-14 19:58:03 +01:00
+++ 1.202/sql/log_event.cc	2005-12-14 23:36:36 +01:00
@@ -3403,8 +3403,13 @@
   Xid_log_event methods
 **************************************************************************/
 
-#ifndef DBUG_OFF
-my_bool binlog_no_xid;
+#if !defined(DBUG_OFF) && !defined(MYSQL_CLIENT)
+/*
+  This static class member could be removed when mysqltest is made to support
+  a --replace-regex command: then tests which have XIDs in their output can
+  use this command to suppress non-deterministic XID values.
+*/
+my_bool Xid_log_event::show_xid;
 #endif
 
 #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
@@ -3412,7 +3417,9 @@
 {
   char buf[128], *pos;
   pos= strmov(buf, "COMMIT /* xid=");
-  if (!binlog_no_xid)
+#if !defined(DBUG_OFF) && !defined(MYSQL_CLIENT)
+  if (show_xid)
+#endif
     pos= longlong10_to_str(xid, pos, 10);
   pos= strmov(pos, " */");
   protocol->store(buf, (uint) (pos-buf), &my_charset_bin);
@@ -5010,22 +5017,11 @@
 	Rows_log_event member functions
 **************************************************************************/
 
-/*
-  In TABLE_SHARE, "db" and "table_name" are 0-terminated (see this comment in
-  table.cc / alloc_table_share():
-    Use the fact the key is db/0/table_name/0
-  We rely on this to be sure the m_dbnam and m_tblnam members of
-  Rows_log_event and Table_map_log_event are 0-terminated.
-*/
-
 #ifndef MYSQL_CLIENT
 Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
                                MY_BITMAP const *cols, bool is_transactional)
   : Log_event(thd_arg, 0, is_transactional),
-    m_dbnam(tbl_arg->s->db.str), m_dblen(m_dbnam ? tbl_arg->s->db.length : 0),
     m_table(tbl_arg),
-    m_tblnam(tbl_arg->s->table_name.str),
-    m_tbllen(tbl_arg->s->table_name.length), //m_tbl should be LEX_STRING*
     m_table_id(tid),
     m_width(tbl_arg->s->fields),
     m_rows_buf(my_malloc(opt_binlog_rows_event_max_size * sizeof(*m_rows_buf), MYF(MY_WME))),
@@ -5502,6 +5498,7 @@
 }
 #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
 
+#ifndef MYSQL_CLIENT
 bool Rows_log_event::write_data_header(IO_CACHE *file)
 {
   DBUG_ASSERT(m_table_id != ULONG_MAX);
@@ -5528,6 +5525,7 @@
                           no_bytes_in_map(&m_cols)) ||
           my_b_safe_write(file, m_rows_buf, data_size));
 }
+#endif
 
 #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) && defined(DBUG_RBR)
 void Rows_log_event::pack_info(Protocol *protocol)
@@ -5565,6 +5563,16 @@
     m_flags(flags)
 {
   DBUG_ASSERT(m_table_id != ULONG_MAX);
+  /*
+    In TABLE_SHARE, "db" and "table_name" are 0-terminated (see this comment in
+    table.cc / alloc_table_share():
+      Use the fact the key is db/0/table_name/0
+    As we rely on this let's assert it.
+  */
+  DBUG_ASSERT((tbl->s->db.str == 0) ||
+              (tbl->s->db.str[tbl->s->db.length] == 0));
+  DBUG_ASSERT(tbl->s->table_name.str[tbl->s->table_name.length] == 0);
+
 
   m_data_size=  TABLE_MAP_HEADER_LEN;
   m_data_size+= m_dblen + 2;	// Include length and terminating \0

--- 1.146/sql/log_event.h	2005-12-14 19:58:04 +01:00
+++ 1.147/sql/log_event.h	2005-12-14 23:36:38 +01:00
@@ -1204,10 +1204,6 @@
 typedef ulonglong my_xid; // this line is the same as in handler.h
 #endif
 
-#ifndef DBUG_OFF
-extern my_bool binlog_no_xid;
-#endif
-
 class Xid_log_event: public Log_event
 {
  public:
@@ -1231,6 +1227,9 @@
   bool write(IO_CACHE* file);
 #endif
   bool is_valid() const { return 1; }
+#if !defined(DBUG_OFF) && !defined(MYSQL_CLIENT)
+  static my_bool show_xid;
+#endif
 };
 
 /*****************************************************************************
@@ -1458,8 +1457,8 @@
   bool is_valid() const { return block != 0; }
 #ifndef MYSQL_CLIENT
   bool write(IO_CACHE* file);
-#endif
   const char* get_db() { return db; }
+#endif
 };
 
 
@@ -1494,8 +1493,8 @@
   bool is_valid() const { return file_id != 0; }
 #ifndef MYSQL_CLIENT
   bool write(IO_CACHE* file);
-#endif
   const char* get_db() { return db; }
+#endif
 };
 
 
@@ -1529,8 +1528,8 @@
   bool is_valid() const { return file_id != 0; }
 #ifndef MYSQL_CLIENT
   bool write(IO_CACHE* file);
-#endif
   const char* get_db() { return db; }
+#endif
 };
 
 
@@ -1708,8 +1707,8 @@
 #ifndef MYSQL_CLIENT
   virtual bool write_data_header(IO_CACHE *file);
   virtual bool write_data_body(IO_CACHE *file);
-#endif
   virtual const char *get_db() { return m_dbnam; }
+#endif
 
 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   virtual int exec_event(struct st_relay_log_info *rli);
@@ -1821,9 +1820,11 @@
   my_size_t get_width() const       { return m_width; }
   ulong get_table_id() const        { return m_table_id; }
 
+#ifndef MYSQL_CLIENT
   virtual bool write_data_header(IO_CACHE *file);
   virtual bool write_data_body(IO_CACHE *file);
-  virtual const char *get_db() { return m_dbnam; }
+  virtual const char *get_db() { return m_table->s->db.str; }
+#endif
   virtual bool is_valid() const
   {
     /* that's how we check malloc() succeeded */
@@ -1875,14 +1876,9 @@
   virtual int do_add_row_data(byte *data, my_size_t length);
 #endif
 
-  char const *m_dbnam;		/* Database name */
-  my_size_t m_dblen;		/* Length of database name in bytes */
-
 #ifndef MYSQL_CLIENT
   TABLE *m_table;		/* The table the rows belong to */
 #endif
-  char const *m_tblnam;
-  my_size_t   m_tbllen;
   ulong       m_table_id;	/* Table ID */
   MY_BITMAP   m_cols;		/* Bitmap denoting columns available */
   ulong       m_width;          /* The width of the columns bitmap */
Thread
bk commit into 5.1 tree (lars:1.1964)Lars Thalmann14 Dec