List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:October 20 2010 1:02pm
Subject:bzr push into mysql-5.1-telco-7.0 branch (magnus.blaudd:3880 to 3881)
View as plain text  
 3881 Magnus Blåudd	2010-10-20 [merge]
      Merge

    modified:
      client/mysqlbinlog.cc
      sql/field.cc
      sql/field.h
      sql/ha_ndbcluster.cc
      sql/log_event.cc
      sql/log_event.h
      sql/mysqld.cc
      sql/set_var.cc
      sql/slave.cc
      sql/slave.h
      sql/sql_class.cc
      sql/sql_class.h
      storage/ndb/include/logger/SysLogHandler.hpp
      storage/ndb/src/common/logger/CMakeLists.txt
      storage/ndb/src/common/logger/SysLogHandler.cpp
 3880 Jonas Oreland	2010-10-20 [merge]
      ndb - merge 63 to 70

    modified:
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc	2010-10-18 13:46:27 +0000
+++ b/client/mysqlbinlog.cc	2010-10-20 11:10:46 +0000
@@ -104,8 +104,10 @@ static ulonglong rec_count= 0;
 static short binlog_flags = 0; 
 static MYSQL* mysql = NULL;
 static const char* dirname_for_local_load= 0;
+#ifndef MCP_BUG52305
 uint opt_server_id_bits = 0;
 ulong opt_server_id_mask = 0;
+#endif
 
 /**
   Pointer to the Format_description_log_event of the currently active binlog.
@@ -1157,12 +1159,14 @@ that may lead to an endless loop.",
    "Used to reserve file descriptors for use by this program.",
    &open_files_limit, &open_files_limit, 0, GET_ULONG,
    REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0},
+#ifndef MCP_BUG52305
   {"server-id-bits", 255,
    "Set number of significant bits in ServerId",
    (uchar**) &opt_server_id_bits,
    (uchar**) &opt_server_id_bits,
    /* Default + Max 32 bits, minimum 7 bits */
    0, GET_UINT, REQUIRED_ARG, 32, 7, 32, 0, 0, 0},
+#endif
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 
@@ -2061,8 +2065,10 @@ int main(int argc, char** argv)
   if (opt_base64_output_mode == BASE64_OUTPUT_UNSPEC)
     opt_base64_output_mode= BASE64_OUTPUT_AUTO;
 
+#ifndef MCP_BUG52305
   opt_server_id_mask = (opt_server_id_bits == 32)?
     ~ ulong(0) : (1 << opt_server_id_bits) -1;
+#endif
 
   my_set_max_open_files(open_files_limit);
 

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2010-10-12 11:54:35 +0000
+++ b/sql/field.cc	2010-10-20 12:33:24 +0000
@@ -7254,11 +7254,6 @@ uint32 Field_varstring::data_length()
   return length_bytes == 1 ? (uint32) *ptr : uint2korr(ptr);
 }
 
-uint32 Field_varstring::used_length()
-{
-  return length_bytes == 1 ? 1 + (uint32) (uchar) *ptr : 2 + uint2korr(ptr);
-}
-
 /*
   Functions to create a packed row.
   Here the number of length bytes are depending on the given max_length

=== modified file 'sql/field.h'
--- a/sql/field.h	2010-06-16 12:04:53 +0000
+++ b/sql/field.h	2010-10-20 12:33:24 +0000
@@ -185,12 +185,6 @@ public:
     For varstrings, this does _not_ include the length bytes.
   */
   virtual uint32 data_length() { return pack_length(); }
-  /*
-    used_length() returns the number of bytes actually used to store the data
-    of the field. So for a varstring it includes both lenght byte(s) and
-    string data, and anything after data_length() bytes are unused.
-  */
-  virtual uint32 used_length() { return pack_length(); }
   virtual uint32 sort_length() const { return pack_length(); }
 
   /**
@@ -1619,7 +1613,6 @@ public:
   uint packed_col_length(const uchar *to, uint length);
   uint max_packed_col_length(uint max_length);
   uint32 data_length();
-  uint32 used_length();
   uint size_of() const { return sizeof(*this); }
   enum_field_types real_type() const { return MYSQL_TYPE_VARCHAR; }
   bool has_charset(void) const

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2010-10-15 08:56:18 +0000
+++ b/sql/ha_ndbcluster.cc	2010-10-20 12:33:24 +0000
@@ -1062,6 +1062,24 @@ bool ha_ndbcluster::get_error_message(in
 }
 
 
+/*
+  field_used_length() returns the number of bytes actually used to
+  store the data of the field. So for a varstring it includes both
+  length byte(s) and string data, and anything after data_length()
+  bytes are unused.
+*/
+static
+uint32 field_used_length(const Field* field)
+{
+ if (field->type() == MYSQL_TYPE_VARCHAR)
+ {
+   const Field_varstring* f = static_cast<const Field_varstring*>(field);
+   return f->length_bytes + const_cast<Field_varstring*>(f)->data_length();
+                            // ^ no 'data_length() const'
+ }
+ return field->pack_length();
+}
+
 
 /**
   Check if MySQL field type forces var part in ndb storage
@@ -1679,7 +1697,7 @@ int ha_ndbcluster::check_default_values(
               
               value= value >> 1;
             }
-            Uint32 defaultLen = field->used_length();
+            Uint32 defaultLen = field_used_length(field);
             defaultLen = ((defaultLen + 3) & ~(Uint32)0x7);
             defaults_aligned= (0 == memcmp(ndb_default, 
                                            out, 
@@ -4984,7 +5002,7 @@ void ha_ndbcluster::unpack_record(uchar 
         if (!field->is_null())
         {
           /* Only copy actually used bytes of varstrings. */
-          uint32 actual_length= field->used_length();
+          uint32 actual_length= field_used_length(field);
           uchar *src_ptr= field->ptr;
           field->move_field_offset(dst_offset - src_offset);
           field->set_notnull();
@@ -5055,7 +5073,7 @@ static void get_default_value(void *def_
         if (!field->is_null())
         {
           /* Only copy actually used bytes of varstrings. */
-          uint32 actual_length= field->used_length();
+          uint32 actual_length= field_used_length(field);
           uchar *src_ptr= field->ptr;
           field->set_notnull();
           memcpy(def_val, src_ptr, actual_length);
@@ -6912,7 +6930,7 @@ static int create_ndb_column(THD *thd,
             /* For bit columns, default length is rounded up to 
                nearest word, ensuring all data sent
             */
-            Uint32 defaultLen = field->used_length();
+            Uint32 defaultLen = field_used_length(field);
             if(field->type() == MYSQL_TYPE_BIT)
               defaultLen = ((defaultLen + 3) /4) * 4;
             col.setDefaultValue(buf, defaultLen);

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2010-10-12 14:53:28 +0000
+++ b/sql/log_event.cc	2010-10-20 11:10:46 +0000
@@ -665,9 +665,12 @@ const char* Log_event::get_type_str()
 Log_event::Log_event(THD* thd_arg, uint16 flags_arg, bool using_trans)
   :log_pos(0), temp_buf(0), exec_time(0), flags(flags_arg), thd(thd_arg)
 {
-  unmasked_server_id= server_id= thd->server_id;
+  server_id= thd->server_id;
   when=		thd->start_time;
   cache_stmt=	using_trans;
+#ifndef MCP_BUG52305
+  unmasked_server_id= server_id;
+#endif
 }
 
 
@@ -682,13 +685,17 @@ Log_event::Log_event()
   :temp_buf(0), exec_time(0), flags(0), cache_stmt(0),
    thd(0)
 {
-  unmasked_server_id= server_id= ::server_id;
+  server_id= ::server_id;
   /*
     We can't call my_time() here as this would cause a call before
     my_init() is called
   */
   when=		0;
   log_pos=	0;
+
+#ifndef MCP_BUG52305
+  unmasked_server_id= server_id;
+#endif
 }
 #endif /* !MYSQL_CLIENT */
 
@@ -705,6 +712,7 @@ Log_event::Log_event(const char* buf,
   thd = 0;
 #endif
   when = uint4korr(buf);
+#ifndef MCP_BUG52305
   unmasked_server_id = uint4korr(buf + SERVER_ID_OFFSET);
   /* 
      Mask out any irrelevant parts of the server_id
@@ -714,6 +722,7 @@ Log_event::Log_event(const char* buf,
 #else
   server_id = unmasked_server_id;
 #endif
+#endif
   data_written= uint4korr(buf + EVENT_LEN_OFFSET);
   if (description_event->binlog_version==1)
   {

=== modified file 'sql/log_event.h'
--- a/sql/log_event.h	2010-10-12 14:53:28 +0000
+++ b/sql/log_event.h	2010-10-20 11:10:46 +0000
@@ -932,12 +932,14 @@ public:
   */
   uint32 server_id;
 
+#ifndef MCP_BUG52305
   /*
     The server id read from the Binlog.  server_id above has
     lowest bits of this only according to the value of
     opt_server_id_bits
   */
   uint32 unmasked_server_id;
+#endif
 
   /**
     Some 16 flags. See the definitions above for LOG_EVENT_TIME_F,

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-10-12 14:53:28 +0000
+++ b/sql/mysqld.cc	2010-10-20 11:10:46 +0000
@@ -492,8 +492,10 @@ handlerton *partition_hton;
 ulong opt_ndb_wait_setup;
 int(*ndb_wait_setup_func)(ulong)= 0;
 #endif
+#ifndef MCP_BUG52305
 uint opt_server_id_bits= 0;
 ulong opt_server_id_mask= 0;
+#endif
 my_bool opt_readonly, use_temp_pool, relay_log_purge;
 my_bool opt_sync_frm, opt_allow_suspicious_udfs;
 my_bool opt_secure_auth= 0;
@@ -3950,8 +3952,6 @@ with --log-bin instead.");
   DBUG_ASSERT((uint)global_system_variables.binlog_format <=
               array_elements(binlog_format_names)-1);
 
-  opt_server_id_mask = ~ulong(0);
-
 #ifdef HAVE_REPLICATION
   if (opt_log_slave_updates && replicate_same_server_id)
   {
@@ -3961,6 +3961,11 @@ using --replicate-same-server-id in conj
 server.");
     unireg_abort(1);
   }
+#endif
+
+#ifndef MCP_BUG52305
+  opt_server_id_mask = ~ulong(0);
+#ifdef HAVE_REPLICATION
   opt_server_id_mask = (opt_server_id_bits == 32)?
     ~ ulong(0) : (1 << opt_server_id_bits) -1;
   if (server_id != (server_id & opt_server_id_mask))
@@ -3971,6 +3976,7 @@ server-id-bits configured.");
     unireg_abort(1);
   }
 #endif
+#endif
 
   if (opt_bin_log)
   {
@@ -6266,12 +6272,14 @@ each time the SQL thread starts.",
    "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.",
    &myisam_recover_options_str, &myisam_recover_options_str, 0,
    GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+#ifndef MCP_BUG52305
   {"server-id-bits", 255,
    "Set number of significant bits in ServerId",
    &opt_server_id_bits,
    &opt_server_id_bits,
    /* Default + Max 32 bits, minimum 7 bits */
    0, GET_UINT, REQUIRED_ARG, 32, 7, 32, 0, 0, 0},
+#endif
   {"new", 'n', "Use very new possible 'unsafe' functions.",
    &global_system_variables.new_mode,
    &max_system_variables.new_mode,
@@ -6438,8 +6446,12 @@ thread is in the relay logs.",
    &opt_secure_file_priv, &opt_secure_file_priv, 0,
    GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"server-id",	OPT_SERVER_ID,
+#ifndef MCP_BUG52305
    "Uniquely identifies the server instance in the community of replication partners.  "
    "Max value is limited by opt-server-id-bits if set.",
+#else
+   "Uniquely identifies the server instance in the community of replication partners.",
+#endif
    &server_id, &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, UINT_MAX32,
    0, 0, 0},
   {"set-variable", 'O',

=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc	2010-10-12 14:53:28 +0000
+++ b/sql/set_var.cc	2010-10-20 11:10:46 +0000
@@ -65,7 +65,9 @@
 
 #include "events.h"
 
+#ifndef MCP_BUG52305
 extern uint opt_server_id_bits;
+#endif
 
 extern CHARSET_INFO *character_set_filesystem;
 
@@ -697,9 +699,11 @@ static sys_var_thd_bool
 sys_engine_condition_pushdown(&vars, "engine_condition_pushdown",
 			      &SV::engine_condition_pushdown);
 
+#ifndef MCP_BUG52305
 static sys_var_const
 sys_server_id_bits(&vars, "server_id_bits", OPT_GLOBAL, SHOW_INT, 
                    (uchar*) &opt_server_id_bits);
+#endif
 
 /* Time/date/datetime formats */
 

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2010-10-18 10:53:03 +0000
+++ b/sql/slave.cc	2010-10-20 11:10:46 +0000
@@ -2244,11 +2244,12 @@ int apply_event_and_update_pos(Log_event
     log (remember that now the relay log starts with its Format_desc,
     has a Rotate etc).
   */
-
+#ifndef MCP_BUG52305
   /* 
      Set the unmasked and actual server ids from the event 
    */
   thd->unmasked_server_id = ev->unmasked_server_id;
+#endif
   thd->server_id = ev->server_id; // use the original server id for logging
   thd->set_time();                            // time the query
   thd->lex->current_select= 0;
@@ -3996,12 +3997,14 @@ static int queue_event(Master_info* mi,c
 
 #ifndef MCP_BUG47037
   s_id= uint4korr(buf + SERVER_ID_OFFSET);
+#ifndef MCP_BUG52305
   /*
     If server_id_bits option is set we need to mask out irrelevant bits
     when checking server_id, but we still put the full unmasked server_id
     into the Relay log so that it can be accessed when applying the event
   */
   s_id&= opt_server_id_mask;
+#endif
   if ((s_id == ::server_id && !mi->rli.replicate_same_server_id) ||
       /*
         the following conjunction deals with IGNORE_SERVER_IDS, if set

=== modified file 'sql/slave.h'
--- a/sql/slave.h	2010-10-18 10:53:03 +0000
+++ b/sql/slave.h	2010-10-20 11:10:46 +0000
@@ -226,7 +226,9 @@ extern char *report_host, *report_passwo
 extern my_bool master_ssl;
 extern char *master_ssl_ca, *master_ssl_capath, *master_ssl_cert;
 extern char *master_ssl_cipher, *master_ssl_key;
+#ifndef MCP_BUG52305
 extern ulong opt_server_id_mask;
+#endif
 
 extern I_List<THD> threads;
 

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2010-10-12 14:53:28 +0000
+++ b/sql/sql_class.cc	2010-10-20 11:10:46 +0000
@@ -719,7 +719,10 @@ THD::THD()
   /* Variables with default values */
   proc_info="login";
   where= THD::DEFAULT_WHERE;
-  unmasked_server_id = server_id = ::server_id;
+  server_id = ::server_id;
+#ifndef MCP_BUG52305
+  unmasked_server_id = server_id;
+#endif
   slave_net = 0;
   command=COM_CONNECT;
   *scramble= '\0';

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2010-10-12 14:53:28 +0000
+++ b/sql/sql_class.h	2010-10-20 11:10:46 +0000
@@ -1414,7 +1414,9 @@ public:
     first byte of the packet in do_command()
   */
   enum enum_server_command command;
+#ifndef MCP_BUG52305
   uint32     unmasked_server_id;
+#endif
   uint32     server_id;
   uint32     file_id;			// for LOAD DATA INFILE
   /* remote (peer) port */

=== modified file 'storage/ndb/include/logger/SysLogHandler.hpp'
--- a/storage/ndb/include/logger/SysLogHandler.hpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/include/logger/SysLogHandler.hpp	2010-10-19 15:03:27 +0000
@@ -20,9 +20,8 @@
 #define SYSLOGHANDLER_H
 
 #include "LogHandler.hpp"
-#ifndef NDB_WIN32
+
 #include <syslog.h>
-#endif
 
 /**
  * Logs messages to syslog. The default identity is 'NDB'. 

=== modified file 'storage/ndb/src/common/logger/CMakeLists.txt'
--- a/storage/ndb/src/common/logger/CMakeLists.txt	2010-04-07 09:14:43 +0000
+++ b/storage/ndb/src/common/logger/CMakeLists.txt	2010-10-19 15:03:27 +0000
@@ -21,5 +21,6 @@ ADD_LIBRARY(ndblogger STATIC
             LogHandlerList.cpp
             LogHandler.cpp
             ConsoleLogHandler.cpp
+	    SysLogHandler.cpp
             EventLogHandler.cpp
             FileLogHandler.cpp)

=== modified file 'storage/ndb/src/common/logger/SysLogHandler.cpp'
--- a/storage/ndb/src/common/logger/SysLogHandler.cpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/common/logger/SysLogHandler.cpp	2010-10-19 15:03:27 +0000
@@ -16,6 +16,8 @@
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 */
 
+#ifndef _WIN32
+
 #include "SysLogHandler.hpp"
 
 #include <syslog.h>
@@ -167,3 +169,5 @@ SysLogHandler::setFacility(const BaseStr
   setErrorStr("Invalid syslog facility name");
   return false;
 }
+
+#endif

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (magnus.blaudd:3880 to 3881) Magnus Blåudd20 Oct