List:Internals« Previous MessageNext Message »
From:Mats Kindahl Date:May 6 2005 4:47pm
Subject:bk commit into 5.1 tree (mats:1.1822)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mats. When mats 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.1822 05/05/06 18:47:07 mats@stripped +4 -0
  WL#1012: Not extending buffer with enough extra memory for large rows.

  sql/sql_class.cc
    1.184 05/05/06 18:46:58 mats@stripped +8 -3
    Printing good debug messages.

  sql/log_event.cc
    1.190 05/05/06 18:46:58 mats@stripped +7 -15
    Not allocating enough memory when extending block.
    Debriding code.
    Initializing member variables.

  sql/log.cc
    1.166 05/05/06 18:46:57 mats@stripped +1 -1
    Don't print context for row-level events.

  mysql-test/t/disabled.def
    1.11 05/05/06 18:46:57 mats@stripped +1 -0
    One test disabled.

# 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:	mats
# Host:	romeo.kindahl.net
# Root:	/home/bk/w2325-mysql-5.1

--- 1.165/sql/log.cc	2005-04-26 11:17:21 +02:00
+++ 1.166/sql/log.cc	2005-05-06 18:46:57 +02:00
@@ -1660,7 +1660,7 @@
       of the SQL command
     */
 
-    if (thd)
+    if (!opt_binlog_row_level && thd)
     {
       if (thd->last_insert_id_used)
       {

--- 1.189/sql/log_event.cc	2005-05-06 11:21:57 +02:00
+++ 1.190/sql/log_event.cc	2005-05-06 18:46:58 +02:00
@@ -4946,8 +4946,9 @@
   
   // The cast will work since m_rows_cur <= m_rows_end
   if ((size_t) (m_rows_end - m_rows_cur) < length) {
+    size_t const block_size = 1024;
     ptrdiff_t const old_alloc = m_rows_end - m_rows_buf;
-    ptrdiff_t const new_alloc = old_alloc + 1024;
+    ptrdiff_t const new_alloc = old_alloc + block_size * (length / block_size + block_size - 1);
     ptrdiff_t const cur_size = m_rows_cur - m_rows_buf;
 
     byte* const new_buf = my_realloc(m_rows_buf, new_alloc, MYF(MY_WME));
@@ -4960,6 +4961,7 @@
     }
   }
 
+  DBUG_ASSERT(m_rows_cur + length < m_rows_end);
   memcpy(m_rows_cur, row_data, length);
   m_rows_cur += length;
   DBUG_PRINT("info", ("rows event body is now %lu bytes", 
@@ -4969,15 +4971,6 @@
 
 #ifndef MYSQL_CLIENT
 #ifdef HAVE_REPLICATION
-static char const*
-show_bytes(char const* data, size_t size, char* const buf)
-{
-  char* ptr = buf;
-  while (size-- > 0)
-    ptr += sprintf(ptr, " %0x", (int) (unsigned char) *data++);
-  return buf;
-}
-
 /*
   Unpack a row into a record. The row is assumed to only consist of the fields
   for which the bitset represented by 'arr' and 'bits'; the other parts of the
@@ -5238,7 +5231,7 @@
 Table_map_log_event(const char* buf, uint event_len,
 		    const Format_description_log_event *description_event)
 #ifdef MYSQL_CLIENT
-  : Log_event(buf, description_event)
+  : Log_event(buf, description_event), m_memory(NULL)
 #else
   : Log_event(buf, description_event), m_table(NULL), m_memory(NULL)
 #endif
@@ -5449,10 +5442,9 @@
 write_data_body(IO_CACHE* file)
 {
   DBUG_ENTER("Table_map_log_event::write_data_body(IO_CACHE*)");
-  DBUG_PRINT("info", ("m_dblen = %d; m_dbnam = %s", 
-		      m_dblen, m_dbnam));
-  DBUG_PRINT("info", ("m_tbllen = %d; m_tblnam = %s", 
-		      m_tbllen, m_tblnam));
+  DBUG_PRINT("info", ("m_dblen = %d; m_dbnam = %s", m_dblen, m_dbnam));
+  DBUG_PRINT("info", ("m_tbllen = %d; m_tblnam = %s", m_tbllen, m_tblnam));
+  DBUG_PRINT("info", ("m_colcnt = %d", m_colcnt));
 
   DBUG_ASSERT(m_dbnam != NULL);
   DBUG_ASSERT(m_tblnam != NULL);

--- 1.183/sql/sql_class.cc	2005-04-28 14:27:29 +02:00
+++ 1.184/sql/sql_class.cc	2005-05-06 18:46:58 +02:00
@@ -2067,15 +2067,20 @@
 	 size_t max_size, const byte *record) const
 {
   DBUG_ENTER("THD::pack_row");
-  DBUG_PRINT("enter", ("row_data = %p, max_size = %lu, record = %p", 
+  DBUG_PRINT("enter", ("table=%p %s, row_data=%p, max_size=%lu, record=%p", 
+		       table, table ? table->s->table_name : "",
 		       row_data, max_size, record));
   bzero(row_data, max_size);
 
-  char buf[16];
+
+#ifndef DBUG_OFF
+  char* const buf = my_malloc(3 * table->s->null_bytes + 1, MYF(0));
   DBUG_PRINT("info", ("Copying %d null bytes:%s", 
 		      table->s->null_bytes, 
 		      show_bytes(record, table->s->null_bytes, buf)));
-  
+  my_free(buf, MYF(0));
+#endif
+
   byte *ptr = row_data;
   memcpy(row_data, record, table->s->null_bytes);
   ptr += table->s->null_bytes;

--- 1.10/mysql-test/t/disabled.def	2005-04-29 18:10:42 +02:00
+++ 1.11/mysql-test/t/disabled.def	2005-05-06 18:46:57 +02:00
@@ -19,3 +19,4 @@
 ndb_multi : replication conflict
 rpl_change_master : result mismatch, Mats, Lars check
 rpl_deadlock : result mismatch, Mats, Lars check
+ps_1general : row-based currently allow max 128 cols /Mats
Thread
bk commit into 5.1 tree (mats:1.1822)Mats Kindahl6 May