#At file:///home/msvensson/mysql/7.0/ based on revid:magnus.blaudd@stripped
4206 Magnus Blåudd 2011-02-21
ndb
- markup backport of wl5151 with MCP tags
- remove uneccessary change to include/my_bitmap.h(which aren't in
5.5 or trunk) by backporting the code to check if a particular bit is
set from trunk
modified:
include/my_bitmap.h
sql/mysql_priv.h
sql/mysqld.cc
sql/rpl_utility.cc
sql/rpl_utility.h
sql/set_var.cc
sql/set_var.h
sql/sql_class.h
=== modified file 'include/my_bitmap.h'
--- a/include/my_bitmap.h 2010-10-12 11:54:35 +0000
+++ b/include/my_bitmap.h 2011-02-21 11:38:36 +0000
@@ -162,22 +162,6 @@ static inline my_bool bitmap_cmp(const M
#define bitmap_set_all(MAP) \
(memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP))))
-/**
- check, set and clear a bit of interest of an integer.
-
- If the bit is out of range @retval -1. Otherwise
- bit_is_set @return 0 or 1 reflecting the bit is set or not;
- bit_do_set @return 1 (bit is set 1)
- bit_do_clear @return 0 (bit is cleared to 0)
-*/
-
-#define bit_is_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
- (((I) & (ULL(1) << (B))) == 0 ? 0 : 1) : -1)
-#define bit_do_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
- ((I) |= (ULL(1) << (B)), 1) : -1)
-#define bit_do_clear(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
- ((I) &= ~(ULL(1) << (B)), 0) : -1)
-
#ifdef __cplusplus
}
#endif
=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h 2010-10-22 14:13:23 +0000
+++ b/sql/mysql_priv.h 2011-02-21 11:38:36 +0000
@@ -1992,7 +1992,9 @@ extern my_bool opt_sql_bin_update, opt_s
extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern ulong slave_exec_mode_options;
+#ifndef MCP_WL5151
extern ulong slave_type_conversions_options;
+#endif
extern my_bool opt_readonly, lower_case_file_system;
extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
extern my_bool opt_secure_auth;
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2010-11-10 14:32:49 +0000
+++ b/sql/mysqld.cc 2011-02-21 11:38:36 +0000
@@ -547,8 +547,10 @@ static const char *slave_exec_mode_str=
#ifndef MCP_WL3733
my_bool slave_allow_batching;
#endif
+#ifndef MCP_WL5151
ulong slave_type_conversions_options;
const char *slave_type_conversions_default= "";
+#endif
ulong thread_cache_size=0, thread_pool_size= 0;
ulong binlog_cache_size=0;
ulonglong max_binlog_cache_size=0;
@@ -5834,7 +5836,9 @@ enum options_mysqld
#endif /* defined(ENABLED_DEBUG_SYNC) */
OPT_OLD_MODE,
OPT_SLAVE_EXEC_MODE,
+#ifndef MCP_WL5151
OPT_SLAVE_TYPE_CONVERSIONS,
+#endif
OPT_GENERAL_LOG_FILE,
OPT_SLOW_QUERY_LOG_FILE,
OPT_IGNORE_BUILTIN_INNODB,
@@ -6530,6 +6534,7 @@ thread is in the relay logs.",
"not stop for operations that are idempotent. In STRICT mode, replication "
"will stop on any unexpected difference between the master and the slave.",
&slave_exec_mode_str, &slave_exec_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#ifndef MCP_WL5151
{"slave-type-conversions", OPT_SLAVE_TYPE_CONVERSIONS,
"Set of slave type conversions that are enabled. Legal values are:"
" ALL_LOSSY to enable lossy conversions and"
@@ -6540,6 +6545,7 @@ thread is in the relay logs.",
&slave_type_conversions_default,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
+#endif
{"slow-query-log", OPT_SLOW_LOG,
"Enable/disable slow query log.", &opt_slow_log,
&opt_slow_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -7899,6 +7905,7 @@ static int mysql_init_variables(void)
&slave_exec_mode_typelib,
NULL,
&error);
+#ifndef MCP_WL5151
/* Slave type conversions */
slave_type_conversions_options= 0;
slave_type_conversions_options=
@@ -7906,6 +7913,7 @@ static int mysql_init_variables(void)
&slave_type_conversions_typelib,
NULL,
&error);
+#endif
/* Default mode string must not yield a error. */
DBUG_ASSERT(!error);
if (error)
@@ -8143,6 +8151,7 @@ mysqld_get_one_option(int optid,
if (error)
return 1;
break;
+#ifndef MCP_WL5151
case OPT_SLAVE_TYPE_CONVERSIONS:
slave_type_conversions_options= (uint)
find_bit_type_or_exit(argument, &slave_type_conversions_typelib, "", &error);
@@ -8150,6 +8159,7 @@ mysqld_get_one_option(int optid,
return 1;
break;
#endif
+#endif
case OPT_SAFEMALLOC_MEM_LIMIT:
#if !defined(DBUG_OFF) && defined(SAFEMALLOC)
sf_malloc_mem_limit = atoi(argument);
=== modified file 'sql/rpl_utility.cc'
--- a/sql/rpl_utility.cc 2011-01-14 14:02:55 +0000
+++ b/sql/rpl_utility.cc 2011-02-21 11:38:36 +0000
@@ -341,6 +341,11 @@ uint32 table_def::calc_field_size(uint c
}
+/*
+ MCP NOTE! untagged changes in rpl_utility.h and rpl_utility are
+ part of backport "WL#5151 Conversion between different types when
+ replicating"
+*/
/**
*/
void show_sql_type(enum_field_types type, uint16 metadata, String *str)
@@ -518,10 +523,12 @@ void show_sql_type(enum_field_types type
bool is_conversion_ok(int order, Relay_log_info *rli)
{
DBUG_ENTER("is_conversion_ok");
- bool allow_non_lossy=
- bit_is_set(slave_type_conversions_options, SLAVE_TYPE_CONVERSIONS_ALL_NON_LOSSY);
- bool allow_lossy=
- bit_is_set(slave_type_conversions_options, SLAVE_TYPE_CONVERSIONS_ALL_LOSSY);
+ bool allow_non_lossy, allow_lossy;
+
+ allow_non_lossy = slave_type_conversions_options &
+ (ULL(1) << SLAVE_TYPE_CONVERSIONS_ALL_NON_LOSSY);
+ allow_lossy= slave_type_conversions_options &
+ (ULL(1) << SLAVE_TYPE_CONVERSIONS_ALL_LOSSY);
DBUG_PRINT("enter", ("order: %d, flags:%s%s", order,
allow_non_lossy ? " ALL_NON_LOSSY" : "",
=== modified file 'sql/rpl_utility.h'
--- a/sql/rpl_utility.h 2010-06-16 12:04:53 +0000
+++ b/sql/rpl_utility.h 2011-02-21 11:38:36 +0000
@@ -41,6 +41,11 @@ class Relay_log_info;
class table_def
{
public:
+/*
+ MCP NOTE! untagged changes in rpl_utility.h and rpl_utility are
+ part of backport "WL#5151 Conversion between different types when
+ replicating"
+*/
/**
Constructor.
=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc 2010-10-22 09:17:16 +0000
+++ b/sql/set_var.cc 2011-02-21 11:38:36 +0000
@@ -87,6 +87,7 @@ TYPELIB delay_key_write_typelib=
delay_key_write_type_names, NULL
};
+#ifndef MPC_WL5151
/**
SLAVE_TYPE_CONVERSIONS variable.
@@ -113,6 +114,7 @@ TYPELIB slave_type_conversions_typelib=
slave_type_conversions_type_name,
slave_type_conversions_type_length
};
+#endif
static const char *slave_exec_mode_names[]= { "STRICT", "IDEMPOTENT", NullS };
static unsigned int slave_exec_mode_names_len[]= { sizeof("STRICT") - 1,
@@ -614,11 +616,13 @@ static sys_var_bool_ptr sys_slav
&slave_allow_batching);
#endif
#endif
+#ifndef MPC_WL5151
static sys_var_set slave_type_conversions(&vars,
"slave_type_conversions",
&slave_type_conversions_options,
&slave_type_conversions_typelib,
0);
+#endif
static sys_var_long_ptr sys_slow_launch_time(&vars, "slow_launch_time",
&slow_launch_time);
=== modified file 'sql/set_var.h'
--- a/sql/set_var.h 2010-10-12 11:54:35 +0000
+++ b/sql/set_var.h 2011-02-21 11:38:36 +0000
@@ -35,7 +35,9 @@ typedef struct my_locale_st MY_LOCALE;
extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib,
optimizer_switch_typelib, slave_exec_mode_typelib;
+#ifndef MCP_WL5151
extern TYPELIB slave_type_conversions_typelib;
+#endif
typedef int (*sys_check_func)(THD *, set_var *);
typedef bool (*sys_update_func)(THD *, set_var *);
=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h 2011-02-02 09:15:56 +0000
+++ b/sql/sql_class.h 2011-02-21 11:38:36 +0000
@@ -86,13 +86,16 @@ enum enum_ha_read_modes { RFIRST, RNEXT,
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE };
enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
DELAY_KEY_WRITE_ALL };
+
#define SLAVE_EXEC_MODE_STRICT (1U << 0)
#define SLAVE_EXEC_MODE_IDEMPOTENT (1U << 1)
+#ifndef MCP_WL5151
enum enum_slave_type_conversions {
SLAVE_TYPE_CONVERSIONS_ALL_LOSSY,
SLAVE_TYPE_CONVERSIONS_ALL_NON_LOSSY,
SLAVE_TYPE_CONVERSIONS_COUNT
};
+#endif
enum enum_mark_columns
{ MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE};
Attachment: [text/bzr-bundle] bzr/magnus.blaudd@oracle.com-20110221113836-j4y60i0o10an3rl7.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4206) | Magnus Blåudd | 21 Feb |