4118 Magnus Blåudd 2011-01-14
ndb
- thd->command renamed to thd->m_command and accessor function added
in 5.6
- write 'thd_set_command' to bridge the gap
modified:
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_glue.h
4117 Magnus Blåudd 2011-01-14
ndb
- adapt to Relay_log_info changes in 5.6
- Master_info's rli member returns Relay_log_info*
- Relay_log_info members are protected and must be accessed
using accessor functions
- Write ifdefs locally, since the patch then is well
isolated
modified:
sql/ha_ndbcluster.cc
4116 Magnus Blåudd 2011-01-14
ndb
- slave.h renamed to rpl_slave.h in 5.6
modified:
sql/ha_ndbcluster_binlog.cc
4115 Magnus Blåudd 2011-01-14
ndb
- Rename COND to Item, the COND typedef is gone in 5.6
modified:
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.h
sql/ha_ndbcluster_cond.cc
sql/ha_ndbcluster_cond.h
4114 Magnus Blåudd 2011-01-14
ndb
- my_defaults_extra_file is const char* from 5.6
modified:
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
4113 Magnus Blåudd 2011-01-14
ndb
- remove need for MAX_XXX values in mysql server enums,
ll the values that can be expected to be handled
by condition pushdown are hardcoded. Only when asking
for "is this type supported/expected?" can we expect "any"
value for the type. This means the 'expecting' functions should return
false for any type values it does not know about.
- Since we know the max values for bitmask at compile time, use
fixed size buffers to remove the need for extra mallocs when creating
Ndb_expect_stack
- revert the additiotn of MAX_XXX values on the three enums
modified:
include/mysql.h.pp
include/mysql_com.h
sql/ha_ndbcluster_cond.h
sql/item.h
sql/rpl_utility.cc
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2010-12-22 16:23:32 +0000
+++ b/sql/ha_ndbcluster.cc 2011-01-14 14:25:18 +0000
@@ -267,7 +267,7 @@ static int ndbcluster_alter_tablespace(h
static int ndbcluster_fill_files_table(handlerton *hton,
THD *thd,
TABLE_LIST *tables,
- COND *cond);
+ Item *cond);
#if MYSQL_VERSION_ID >= 50501
/**
@@ -283,7 +283,7 @@ static int ndbcluster_fill_files_table(h
*/
static int
ndbcluster_fill_is_table(handlerton *hton, THD *thd, TABLE_LIST *tables,
- COND *cond, enum enum_schema_tables schema_table_idx)
+ Item *cond, enum enum_schema_tables schema_table_idx)
{
if (schema_table_idx == SCH_FILES)
return ndbcluster_fill_files_table(hton, thd, tables, cond);
@@ -6319,20 +6319,42 @@ static int ndbcluster_update_apply_statu
r|= op->setValue(1u, (Uint64)0);
DBUG_ASSERT(r == 0);
}
+#if MYSQL_VERSION_ID < 50600
+ const char* group_master_log_name =
+ active_mi->rli.group_master_log_name;
+ const Uint64 group_master_log_pos =
+ (Uint64)active_mi->rli.group_master_log_pos;
+ const Uint64 future_event_relay_log_pos =
+ (Uint64)active_mi->rli.future_event_relay_log_pos;
+ const Uint64 group_relay_log_pos =
+ (Uint64)active_mi->rli.group_relay_log_pos;
+#else
+ /*
+ - Master_info's rli member returns Relay_log_info*
+ - Relay_log_info members are protected and must be accessed
+ using accessor functions
+ */
+ const char* group_master_log_name =
+ active_mi->rli->get_group_master_log_name();
+ const Uint64 group_master_log_pos =
+ (Uint64)active_mi->rli->get_group_master_log_pos();
+ const Uint64 future_event_relay_log_pos =
+ (Uint64)active_mi->rli->get_future_event_relay_log_pos();
+ const Uint64 group_relay_log_pos =
+ (Uint64)active_mi->rli->get_group_relay_log_pos();
+#endif
// log_name
char tmp_buf[FN_REFLEN];
ndb_pack_varchar(ndbtab->getColumn(2u), tmp_buf,
- active_mi->rli.group_master_log_name,
- strlen(active_mi->rli.group_master_log_name));
+ group_master_log_name, strlen(group_master_log_name));
r|= op->setValue(2u, tmp_buf);
DBUG_ASSERT(r == 0);
// start_pos
- r|= op->setValue(3u, (Uint64)active_mi->rli.group_master_log_pos);
+ r|= op->setValue(3u, group_master_log_pos);
DBUG_ASSERT(r == 0);
// end_pos
- r|= op->setValue(4u, (Uint64)active_mi->rli.group_master_log_pos +
- ((Uint64)active_mi->rli.future_event_relay_log_pos -
- (Uint64)active_mi->rli.group_relay_log_pos));
+ r|= op->setValue(4u, group_master_log_pos +
+ (future_event_relay_log_pos - group_relay_log_pos));
DBUG_ASSERT(r == 0);
return 0;
}
@@ -12758,8 +12780,8 @@ ndb_util_thread_fail:
the scan for evaluation (and thus not saved on stack)
*/
const
-COND*
-ha_ndbcluster::cond_push(const COND *cond)
+Item*
+ha_ndbcluster::cond_push(const Item *cond)
{
DBUG_ENTER("cond_push");
if (!m_cond)
@@ -12769,7 +12791,7 @@ ha_ndbcluster::cond_push(const COND *con
my_errno= HA_ERR_OUT_OF_MEM;
DBUG_RETURN(NULL);
}
- DBUG_EXECUTE("where",print_where((COND *)cond, m_tabname, QT_ORDINARY););
+ DBUG_EXECUTE("where",print_where((Item *)cond, m_tabname, QT_ORDINARY););
DBUG_RETURN(m_cond->cond_push(cond, table, (NDBTAB *)m_table));
}
@@ -14295,7 +14317,7 @@ bool ha_ndbcluster::get_no_parts(const c
static int ndbcluster_fill_files_table(handlerton *hton,
THD *thd,
TABLE_LIST *tables,
- COND *cond)
+ Item *cond)
{
TABLE* table= tables->table;
Ndb *ndb= check_ndb_in_thd(thd);
=== modified file 'sql/ha_ndbcluster.h'
--- a/sql/ha_ndbcluster.h 2010-12-22 11:13:45 +0000
+++ b/sql/ha_ndbcluster.h 2011-01-14 14:15:54 +0000
@@ -540,7 +540,7 @@ static void set_tabname(const char *path
=, !=, >, >=, <, <=, like, "not like", "is null", and "is not null".
Negated conditions are supported by NOT which generate NAND/NOR groups.
*/
- const COND *cond_push(const COND *cond);
+ const Item *cond_push(const Item *cond);
/*
Pop the top condition from the condition stack of the handler instance.
SYNOPSIS
=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc 2010-11-16 14:05:31 +0000
+++ b/sql/ha_ndbcluster_binlog.cc 2011-01-14 14:27:09 +0000
@@ -24,7 +24,11 @@
#include "rpl_injector.h"
#include "rpl_filter.h"
+#if MYSQL_VERSION_ID > 50600
+#include "rpl_slave.h"
+#else
#include "slave.h"
+#endif
#include "ha_ndbcluster_binlog.h"
#include <ndbapi/NdbDictionary.hpp>
#include <ndbapi/ndb_cluster_connection.hpp>
@@ -636,7 +640,7 @@ setup_thd(char * stackptr)
lex_start(thd);
thd->init_for_queries();
- thd->command= COM_DAEMON;
+ thd_set_command(thd, COM_DAEMON);
thd->system_thread= SYSTEM_THREAD_NDBCLUSTER_BINLOG;
#ifndef NDB_THD_HAS_NO_VERSION
thd->version= refresh_version;
@@ -5981,7 +5985,7 @@ pthread_handler_t ndb_binlog_thread_func
lex_start(thd);
thd->init_for_queries();
- thd->command= COM_DAEMON;
+ thd_set_command(thd, COM_DAEMON);
thd->system_thread= SYSTEM_THREAD_NDBCLUSTER_BINLOG;
#ifndef NDB_THD_HAS_NO_VERSION
thd->version= refresh_version;
=== modified file 'sql/ha_ndbcluster_cond.cc'
--- a/sql/ha_ndbcluster_cond.cc 2010-11-16 14:06:49 +0000
+++ b/sql/ha_ndbcluster_cond.cc 2011-01-14 14:15:54 +0000
@@ -963,8 +963,8 @@ void ndb_serialize_cond(const Item *item
Push a condition
*/
const
-COND*
-ha_ndbcluster_cond::cond_push(const COND *cond,
+Item*
+ha_ndbcluster_cond::cond_push(const Item *cond,
TABLE *table, const NDBTAB *ndb_table)
{
DBUG_ENTER("cond_push");
@@ -1020,7 +1020,7 @@ ha_ndbcluster_cond::cond_clear()
}
bool
-ha_ndbcluster_cond::serialize_cond(const COND *cond, Ndb_cond_stack *ndb_cond,
+ha_ndbcluster_cond::serialize_cond(const Item *cond, Ndb_cond_stack *ndb_cond,
TABLE *table, const NDBTAB *ndb_table)
{
DBUG_ENTER("serialize_cond");
=== modified file 'sql/ha_ndbcluster_cond.h'
--- a/sql/ha_ndbcluster_cond.h 2011-01-14 14:02:55 +0000
+++ b/sql/ha_ndbcluster_cond.h 2011-01-14 14:15:54 +0000
@@ -671,7 +671,7 @@ public:
{}
~ha_ndbcluster_cond()
{ if (m_cond_stack) delete m_cond_stack; }
- const COND *cond_push(const COND *cond,
+ const Item *cond_push(const Item *cond,
TABLE *table, const NdbDictionary::Table *ndb_table);
void cond_pop();
void cond_clear();
@@ -685,7 +685,7 @@ public:
const key_range *end_key,
uchar *buf);
private:
- bool serialize_cond(const COND *cond, Ndb_cond_stack *ndb_cond,
+ bool serialize_cond(const Item *cond, Ndb_cond_stack *ndb_cond,
TABLE *table, const NdbDictionary::Table *ndb_table);
int build_scan_filter_predicate(Ndb_cond* &cond,
NdbScanFilter* filter,
=== modified file 'sql/ha_ndbcluster_glue.h'
--- a/sql/ha_ndbcluster_glue.h 2010-11-17 08:10:15 +0000
+++ b/sql/ha_ndbcluster_glue.h 2011-01-14 14:27:09 +0000
@@ -127,6 +127,18 @@ ulonglong thd_options(const THD * thd)
#endif
}
+/* set the "command" member of thd */
+static inline
+void thd_set_command(THD* thd, enum enum_server_command command)
+{
+#if MYSQL_VERSION_ID < 50600
+ thd->command = command;
+#else
+ /* "command" renamed to "m_command", use accessor function */
+ thd->set_command(command);
+#endif
+}
+
/* get pointer to diagnostic area for statement from THD */
static inline
Diagnostics_area* thd_stmt_da(THD* thd)
=== modified file 'storage/ndb/src/mgmsrv/InitConfigFileParser.cpp'
--- a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp 2010-10-13 09:33:02 +0000
+++ b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp 2011-01-14 14:13:31 +0000
@@ -17,6 +17,7 @@
*/
#include <ndb_global.h>
+#include <ndb_version.h>
#include "InitConfigFileParser.hpp"
#include "Config.hpp"
@@ -737,6 +738,9 @@ load_defaults(Vector<struct my_option>&
BaseString group_suffix;
const char *save_file = my_defaults_file;
+#if MYSQL_VERSION_ID >= 50600
+ const
+#endif
char *save_extra_file = my_defaults_extra_file;
const char *save_group_suffix = my_defaults_group_suffix;
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0 branch (magnus.blaudd:4113 to 4118) | Magnus Blåudd | 14 Jan |