List:Commits« Previous MessageNext Message »
From:Lars Thalmann Date:May 17 2006 12:30pm
Subject:bk commit into 5.1 tree (lars:1.2155)
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.2155 06/05/17 14:30:31 lars@stripped +9 -0
  Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
  into  mysql.com:/users/lthalmann/bk/mysql-5.1-new-rpl

  sql/sql_parse.cc
    1.549 06/05/17 14:30:21 lars@stripped +0 -2
    Manual merge

  sql/sql_class.cc
    1.260 06/05/17 14:30:20 lars@stripped +0 -6
    Manual merge

  sql/sql_base.cc
    1.322 06/05/17 14:30:20 lars@stripped +0 -2
    Manual merge

  sql/set_var.cc
    1.174 06/05/17 14:30:20 lars@stripped +0 -1
    Manual merge

  sql/log.cc
    1.208 06/05/17 14:30:20 lars@stripped +2 -7
    Manual merge

  mysql-test/t/innodb_mysql.test
    1.4 06/05/17 14:30:20 lars@stripped +9 -11
    Manual merge

  mysql-test/r/innodb_mysql.result
    1.4 06/05/17 14:30:20 lars@stripped +8 -8
    Manual merge

  sql/sql_table.cc
    1.334 06/05/17 14:11:35 lars@stripped +0 -0
    Auto merged

  sql/sql_class.h
    1.294 06/05/17 14:11:35 lars@stripped +0 -1
    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:	dl145k.mysql.com
# Root:	/users/lthalmann/bk/mysql-5.1-new-rpl/RESYNC

--- 1.207/sql/log.cc	2006-05-12 11:16:14 +02:00
+++ 1.208/sql/log.cc	2006-05-17 14:30:20 +02:00
@@ -63,11 +63,17 @@
 struct binlog_trx_data {
   bool empty() const
   {
+#ifdef HAVE_ROW_BASED_REPLICATION
     return pending == NULL && my_b_tell(&trans_log) == 0;
+#else
+    return my_b_tell(&trans_log) == 0;
+#endif
   }
   binlog_trx_data() {}
   IO_CACHE trans_log;                         // The transaction cache
+#ifdef HAVE_ROW_BASED_REPLICATION
   Rows_log_event *pending;                // The pending binrows event
+#endif
 };
 
 static const char binlog_hton_name[]= "binlog";
@@ -1095,6 +1101,7 @@
 #endif
     error= mysql_bin_log.write(thd, trans_log, end_ev);
   }
+#ifdef HAVE_ROW_BASED_REPLICATION
   else
   {
 #ifdef HAVE_ROW_BASED_REPLICATION
@@ -1114,6 +1121,7 @@
     transaction cache.
   */
   mysql_bin_log.update_table_map_version();
+#endif
 
   statistic_increment(binlog_cache_use, &LOCK_status);
   if (trans_log->disk_writes != 0)
@@ -2660,6 +2668,7 @@
   engine has registered for the transaction.
  */
 
+#ifdef HAVE_ROW_BASED_REPLICATION
 int THD::binlog_write_table_map(TABLE *table, bool is_trans)
 {
   int error;
@@ -2802,7 +2811,7 @@
 
   DBUG_RETURN(error);
 }
-#endif /*HAVE_ROW_BASED_REPLICATION*/
+#endif /* HAVE_ROW_BASED_REPLICATION */
 
 /*
   Write an event to the binary log
@@ -2835,11 +2844,11 @@
     we are inside a stored function, we do not end the statement since
     this will close all tables on the slave.
   */
+#ifdef HAVE_ROW_BASED_REPLICATION
   bool const end_stmt=
     thd->prelocked_mode && thd->lex->requires_prelocking();
-#ifdef HAVE_ROW_BASED_REPLICATION
   thd->binlog_flush_pending_rows_event(end_stmt);
-#endif /*HAVE_ROW_BASED_REPLICATION*/
+#endif /* HAVE_ROW_BASED_REPLICATION */
 
   pthread_mutex_lock(&LOCK_log);
 
@@ -2890,7 +2899,6 @@
         (binlog_trx_data*) thd->ha_data[binlog_hton.slot];
       IO_CACHE *trans_log= &trx_data->trans_log;
       bool trans_log_in_use= my_b_tell(trans_log) != 0;
-
       if (event_info->get_cache_stmt() && !trans_log_in_use)
         trans_register_ha(thd,
                           (thd->options &

--- 1.321/sql/sql_base.cc	2006-05-12 11:16:14 +02:00
+++ 1.322/sql/sql_base.cc	2006-05-17 14:30:20 +02:00
@@ -1071,7 +1071,7 @@
      */
 #ifdef HAVE_ROW_BASED_REPLICATION
     thd->binlog_flush_pending_rows_event(TRUE);
-#endif /*HAVE_ROW_BASED_REPLICATION*/
+#endif
     mysql_unlock_tables(thd, thd->lock);
     thd->lock=0;
   }

--- 1.259/sql/sql_class.cc	2006-05-16 10:21:26 +02:00
+++ 1.260/sql/sql_class.cc	2006-05-17 14:30:20 +02:00
@@ -200,7 +200,7 @@
    user_time(0), in_sub_stmt(0),
 #ifdef HAVE_ROW_BASED_REPLICATION
    binlog_table_maps(0),
-#endif /*HAVE_ROW_BASED_REPLICATION*/
+#endif
    global_read_lock(0), is_fatal_error(0),
    rand_used(0), time_zone_used(0),
    last_insert_id_used(0), insert_id_used(0), clear_next_insert_id(0),
@@ -2115,7 +2115,9 @@
 
   if ((!lex->requires_prelocking() || is_update_query(lex->sql_command)) &&
       !current_stmt_binlog_row_based)
+  {
     options&= ~OPTION_BIN_LOG;
+  }    
   /* Disable result sets */
   client_capabilities &= ~CLIENT_MULTI_RESULTS;
   in_sub_stmt|= new_state;
@@ -2704,6 +2706,7 @@
       to how you treat this.
     */
   case THD::ROW_QUERY_TYPE:
+#ifdef HAVE_ROW_BASED_REPLICATION
     if (current_stmt_binlog_row_based)
     {
       /*
@@ -2724,6 +2727,7 @@
 #endif /*HAVE_ROW_BASED_REPLICATION*/
       DBUG_RETURN(0);
     }
+#endif
     /* Otherwise, we fall through */
   case THD::STMT_QUERY_TYPE:
     /*
@@ -2732,7 +2736,9 @@
      */
     {
       Query_log_event qinfo(this, query, query_len, is_trans, suppress_use);
+#ifdef HAVE_ROW_BASED_REPLICATION
       qinfo.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F;
+#endif
       /*
         Binlog table maps will be irrelevant after a Query_log_event
         (they are just removed on the slave side) so after the query
@@ -2742,7 +2748,7 @@
       int error= mysql_bin_log.write(&qinfo);
 #ifdef HAVE_ROW_BASED_REPLICATION
       binlog_table_maps= 0;
-#endif /*HAVE_ROW_BASED_REPLICATION*/
+#endif
       DBUG_RETURN(error);
     }
     break;

--- 1.293/sql/sql_class.h	2006-05-12 10:09:25 +02:00
+++ 1.294/sql/sql_class.h	2006-05-17 14:11:35 +02:00
@@ -890,8 +890,10 @@
   /* container for handler's private per-connection data */
   void *ha_data[MAX_HA];
 
-#ifdef HAVE_ROW_BASED_REPLICATION
 #ifndef MYSQL_CLIENT
+  int binlog_setup_trx_data();
+
+#ifdef HAVE_ROW_BASED_REPLICATION
 
   /*
     Public interface to write RBR events to the binlog
@@ -921,7 +923,6 @@
 				      RowsEventT* hint);
   Rows_log_event* binlog_get_pending_rows_event() const;
   void            binlog_set_pending_rows_event(Rows_log_event* ev);
-  int             binlog_setup_trx_data();
   
   my_size_t max_row_length_blob(TABLE* table, const byte *data) const;
   my_size_t max_row_length(TABLE* table, const byte *data) const
@@ -945,8 +946,9 @@
 
 public:
 
-#endif
 #endif /* HAVE_ROW_BASED_REPLICATION */
+#endif /* MYSQL_CLIENT */
+
 #ifndef MYSQL_CLIENT
   enum enum_binlog_query_type {
       /*
@@ -1384,15 +1386,21 @@
   inline void set_current_stmt_binlog_row_based_if_mixed()
   {
     if (variables.binlog_format == BINLOG_FORMAT_MIXED)
-      current_stmt_binlog_row_based= 1;
+      current_stmt_binlog_row_based= TRUE;
   }
   inline void set_current_stmt_binlog_row_based()
   {
-    current_stmt_binlog_row_based= 1;
+    current_stmt_binlog_row_based= TRUE;
   }
+#endif
   inline void reset_current_stmt_binlog_row_based()
   {
-    current_stmt_binlog_row_based= test(variables.binlog_format == BINLOG_FORMAT_ROW);
+#ifdef HAVE_ROW_BASED_REPLICATION
+    current_stmt_binlog_row_based=
+      test(variables.binlog_format == BINLOG_FORMAT_ROW);
+#else
+    current_stmt_binlog_row_based= FALSE;
+#endif
   }
 #endif /*HAVE_ROW_BASED_REPLICATION*/
 };
@@ -1586,7 +1594,9 @@
     {}
   int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
   
+#ifdef HAVE_ROW_BASED_REPLICATION
   void binlog_show_create_table(TABLE **tables, uint count);
+#endif
   void store_values(List<Item> &values);
   void send_error(uint errcode,const char *err);
   bool send_eof();

--- 1.548/sql/sql_parse.cc	2006-05-16 10:21:27 +02:00
+++ 1.549/sql/sql_parse.cc	2006-05-17 14:30:21 +02:00
@@ -2471,7 +2471,7 @@
 #ifdef HAVE_ROW_BASED_REPLICATION
   if (lex->binlog_row_based_if_mixed)
     thd->set_current_stmt_binlog_row_based_if_mixed();
-#endif /*HAVE_ROW_BASED_REPLICATION*/
+#endif
 
   switch (lex->sql_command) {
   case SQLCOM_SELECT:

--- 1.333/sql/sql_table.cc	2006-05-13 02:40:50 +02:00
+++ 1.334/sql/sql_table.cc	2006-05-17 14:11:35 +02:00
@@ -3514,7 +3514,8 @@
            save us from that ?
   */
   table->reginfo.lock_type=TL_WRITE;
-  hooks->prelock(&table, 1);                    // Call prelock hooks
+  if (hooks)
+    hooks->prelock(&table, 1);                  // Call prelock hooks
   if (! ((*lock)= mysql_lock_tables(thd, &table, 1,
                                     MYSQL_LOCK_IGNORE_FLUSH, &not_used)))
   {

--- 1.3/mysql-test/r/innodb_mysql.result	2006-05-06 11:14:49 +02:00
+++ 1.4/mysql-test/r/innodb_mysql.result	2006-05-17 14:30:20 +02:00
@@ -1,4 +1,4 @@
-drop table if exists t1,t2;
+drop table if exists t1,t2,t3;
 create table t1 (
 c_id int(11) not null default '0',
 org_id int(11) default null,
@@ -53,4 +53,10 @@
 c.c_id = 218 and expiredate is null;
 slai_id
 12
-drop table t1, t2;
+create table t3(f1 varchar(800) binary not null, key(f1)) engine = innodb 
+character set utf8 collate utf8_general_ci;
+Warnings:
+Warning	1071	Specified key was too long; max key length is 765 bytes
+insert into t3 values('aaa');
+drop table t1, t2, t3;
+

--- 1.3/mysql-test/t/innodb_mysql.test	2006-05-06 11:14:50 +02:00
+++ 1.4/mysql-test/t/innodb_mysql.test	2006-05-17 14:30:20 +02:00
@@ -1,7 +1,7 @@
 -- source include/have_innodb.inc
 
 --disable_warnings
-drop table if exists t1,t2;
+drop table if exists t1, t2, t3;
 --enable_warnings
 
 # BUG#16798: Uninitialized row buffer reads in ref-or-null optimizer
@@ -55,5 +55,12 @@
    ( si.owner_tbl = 2 and si.owner_id = c.c_id)) 
 where 
   c.c_id = 218 and expiredate is null;
-
 drop table t1, t2;
+
+#
+# Bug#17530: Incorrect key truncation on table creation caused server crash.
+#
+create table t3(f1 varchar(800) binary not null, key(f1)) engine = innodb 
+  character set utf8 collate utf8_general_ci;
+insert into t3 values('aaa');
+drop table t3;

--- 1.173/sql/set_var.cc	2006-05-16 10:21:26 +02:00
+++ 1.174/sql/set_var.cc	2006-05-17 14:30:20 +02:00
@@ -1269,8 +1269,14 @@
     if global or not here.
     And this test will also prevent switching from RBR to RBR (a no-op which
     should not happen too often).
+
+    If we don't have row-based replication compiled in, the variable
+    is always read-only.
   */
-#ifdef HAVE_ROW_BASED_REPLICATION
+#ifndef HAVE_ROW_BASED_REPLICATION
+  my_error(ER_RBR_NOT_AVAILABLE, MYF(0));
+  return 1;
+#else
   if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW) &&
       thd->temporary_tables)
   {
@@ -1297,14 +1303,17 @@
   }
 #endif
   return sys_var_thd_enum::is_readonly();
+#endif
 }
 
+#ifdef HAVE_ROW_BASED_REPLICATION
 void fix_binlog_format_after_update(THD *thd, enum_var_type type)
 {
 #ifdef HAVE_ROW_BASED_REPLICATION
   thd->reset_current_stmt_binlog_row_based();
 #endif /*HAVE_ROW_BASED_REPLICATION*/
 }
+#endif
 
 static void fix_max_binlog_size(THD *thd, enum_var_type type)
 {
Thread
bk commit into 5.1 tree (lars:1.2155)Lars Thalmann17 May