Below is the list of changes that have just been committed into a local
5.1 repository of ndbdev. When ndbdev 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.1933 05/10/13 22:37:34 tulin@stripped +14 -0
ndb test fixes
+ minor rearr of code and defines
sql/sql_repl.cc
1.144 05/10/13 22:36:31 tulin@stripped +8 -9
ndb test fixes
+ minor rearr of code and defines
sql/set_var.cc
1.139 05/10/13 22:36:31 tulin@stripped +6 -0
ndb test fixes
+ minor rearr of code and defines
sql/rpl_injector.h
1.2 05/10/13 22:36:31 tulin@stripped +3 -1
ndb test fixes
+ minor rearr of code and defines
sql/rpl_injector.cc
1.3 05/10/13 22:36:31 tulin@stripped +2 -1
ndb test fixes
+ minor rearr of code and defines
sql/mysqld.cc
1.482 05/10/13 22:36:31 tulin@stripped +2 -0
ndb test fixes
+ minor rearr of code and defines
sql/log.cc
1.176 05/10/13 22:36:31 tulin@stripped +14 -12
ndb test fixes
+ minor rearr of code and defines
sql/handler.cc
1.195 05/10/13 22:36:31 tulin@stripped +32 -0
ndb test fixes
+ minor rearr of code and defines
sql/ha_ndbcluster.h
1.101 05/10/13 22:36:30 tulin@stripped +9 -2
ndb test fixes
+ minor rearr of code and defines
sql/ha_ndbcluster.cc
1.228 05/10/13 22:36:30 tulin@stripped +19 -15
ndb test fixes
+ minor rearr of code and defines
mysql-test/t/ndb_read_multi_range.test
1.5 05/10/13 22:36:30 tulin@stripped +1 -1
ndb test fixes
+ minor rearr of code and defines
mysql-test/t/ndb_multi.test
1.7 05/10/13 22:36:30 tulin@stripped +3 -0
ndb test fixes
+ minor rearr of code and defines
mysql-test/r/ndb_read_multi_range.result
1.4 05/10/13 22:36:30 tulin@stripped +1 -1
ndb test fixes
+ minor rearr of code and defines
mysql-test/r/ndb_multi.result
1.6 05/10/13 22:36:30 tulin@stripped +1 -0
ndb test fixes
+ minor rearr of code and defines
mysql-test/r/ndb_config.result
1.5 05/10/13 22:36:30 tulin@stripped +1 -1
ndb test fixes
+ minor rearr of code and defines
# 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: tulin
# Host: dl145c.mysql.com
# Root: /home/ndbdev/tomas/mysql-5.1-wl2325-5.0
--- 1.194/sql/handler.cc Fri Oct 7 14:56:29 2005
+++ 1.195/sql/handler.cc Thu Oct 13 22:36:31 2005
@@ -2379,6 +2379,38 @@
DBUG_RETURN(error);
}
+#ifdef HAVE_ROW_BASED_REPLICATION
+int ha_reset_logs(THD *thd)
+{
+#ifdef HAVE_NDB_BINLOG
+ ndbcluster_reset_logs(thd);
+#endif
+ return 0;
+}
+
+int ha_binlog_index_purge_file(THD *thd, const char *file)
+{
+#ifdef HAVE_NDB_BINLOG
+ ndbcluster_binlog_index_purge_file(thd, file);
+#endif
+ return 0;
+}
+
+void ha_reset_slave(THD* thd)
+{
+#ifdef HAVE_NDB_BINLOG
+ ndbcluster_reset_slave(thd);
+#endif
+}
+
+void ha_wait_binlog(THD* thd)
+{
+#ifdef HAVE_NDB_BINLOG
+ ndbcluster_wait_binlog(thd);
+#endif
+}
+
+#endif
/*
Read the first row of a multi-range set.
--- 1.175/sql/log.cc Fri Oct 7 14:56:29 2005
+++ 1.176/sql/log.cc Thu Oct 13 22:36:31 2005
@@ -922,10 +922,14 @@
1 error
*/
-#ifdef HAVE_NDBCLUSTER_DB
-int ndbcluster_reset_logs(THD *thd);
-int ndbcluster_binlog_index_purge_file(THD *thd, const char *file);
+#ifdef HAVE_ROW_BASED_REPLICATION
+int ha_reset_logs(THD *thd);
+int ha_binlog_index_purge_file(THD *thd, const char *file);
+#else
+#define ha_reset_logs(a)
+#define ha_binlog_index_purge_file(a,b)
#endif
+
bool MYSQL_LOG::reset_logs(THD* thd)
{
LOG_INFO linfo;
@@ -934,9 +938,7 @@
enum_log_type save_log_type;
DBUG_ENTER("reset_logs");
-#ifdef HAVE_NDBCLUSTER_DB
- ndbcluster_reset_logs(thd);
-#endif
+ ha_reset_logs(thd);
/*
We need to get both locks to be sure that no one is trying to
write to the index log file.
@@ -1185,9 +1187,9 @@
DBUG_PRINT("info",("purging %s",log_info.log_file_name));
if (!my_delete(log_info.log_file_name, MYF(0)) && decrease_log_space)
*decrease_log_space-= file_size;
-#ifdef HAVE_NDBCLUSTER_DB
- ndbcluster_binlog_index_purge_file(current_thd, log_info.log_file_name);
-#endif
+
+ ha_binlog_index_purge_file(current_thd, log_info.log_file_name);
+
if (find_next_log(&log_info, 0) || exit_loop)
break;
}
@@ -1248,9 +1250,9 @@
stat_area.st_mtime >= purge_time)
break;
my_delete(log_info.log_file_name, MYF(0));
-#ifdef HAVE_NDBCLUSTER_DB
- ndbcluster_binlog_index_purge_file(current_thd, log_info.log_file_name);
-#endif
+
+ ha_binlog_index_purge_file(current_thd, log_info.log_file_name);
+
if (find_next_log(&log_info, 0))
break;
}
--- 1.481/sql/mysqld.cc Fri Oct 7 14:56:30 2005
+++ 1.482/sql/mysqld.cc Thu Oct 13 22:36:31 2005
@@ -5048,6 +5048,7 @@
(gptr*) &global_system_variables.ndb_force_send,
(gptr*) &global_system_variables.ndb_force_send,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
+#ifdef HAVE_NDB_BINLOG
{"ndb-report-thresh-binlog-epoch-slip", OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
"Threshold on number of epochs to be behind before reporting binlog status. "
"E.g. 3 means that if the difference between what epoch has been received "
@@ -5064,6 +5065,7 @@
(gptr*) &ndb_report_thresh_binlog_mem_usage,
(gptr*) &ndb_report_thresh_binlog_mem_usage,
0, GET_ULONG, REQUIRED_ARG, 10, 0, 100, 0, 0, 0},
+#endif
{"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT,
"Use exact records count during query planning and for fast "
"select count(*), disable for faster queries.",
--- 1.4/mysql-test/r/ndb_config.result Fri Oct 7 10:57:29 2005
+++ 1.5/mysql-test/r/ndb_config.result Thu Oct 13 22:36:30 2005
@@ -3,5 +3,5 @@
1 localhost 10485760 1048576
2 localhost 10485760 1048576
1 2
-ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7,
+ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7, mysqld,8, mysqld,9, mysqld,10, mysqld,11,
ndbd,1,localhost,52428800,26214400 ndbd,2,localhost,52428800,36700160 ndbd,3,localhost,52428800,52428800 ndbd,4,localhost,52428800,52428800 ndb_mgmd,5,localhost,, mysqld,6,localhost,,
--- 1.227/sql/ha_ndbcluster.cc Fri Oct 7 14:54:59 2005
+++ 1.228/sql/ha_ndbcluster.cc Thu Oct 13 22:36:30 2005
@@ -178,8 +178,6 @@
pthread_cond_t COND_ndb_util_thread;
extern "C" pthread_handler_decl(ndb_util_thread_func, arg);
ulong ndb_cache_check_time;
-ulong ndb_report_thresh_binlog_epoch_slip;
-ulong ndb_report_thresh_binlog_mem_usage;
/*
Dummy buffer to read zero pack_length fields
@@ -190,6 +188,11 @@
#ifdef HAVE_NDB_BINLOG
#define INJECTOR_EVENT_LEN 200
/* NDB Injector thread (used for binlog creation) */
+ulong ndb_report_thresh_binlog_epoch_slip;
+ulong ndb_report_thresh_binlog_mem_usage;
+static ulonglong ndb_latest_applied_binlog_epoch= 0;
+static ulonglong ndb_latest_handled_binlog_epoch= 0;
+static ulonglong ndb_latest_received_binlog_epoch= 0;
static pthread_t ndb_binlog_thread;
static int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key,
const char *db,
@@ -289,9 +292,6 @@
{NullS, NullS, SHOW_LONG}
};
-static ulonglong ndb_latest_applied_binlog_epoch= 0;
-static ulonglong ndb_latest_handled_binlog_epoch= 0;
-static ulonglong ndb_latest_received_binlog_epoch= 0;
/* instantiated in storage/ndb/src/ndbapi/Ndbif.cpp */
extern Uint64 g_latest_trans_gci;
@@ -6018,9 +6018,8 @@
return (byte*) share->key;
}
-#ifdef HAVE_NDB_BINLOG
#ifndef DBUG_OFF
-void dbug_print_open_tables()
+static void dbug_print_open_tables()
{
DBUG_ENTER("dbug_print_open_tables");
for (uint i= 0; i < ndbcluster_open_tables.records; i++)
@@ -6033,10 +6032,12 @@
("db.tablename: %s.%s use_count: %d commit_count: %d",
share->db, share->table_name,
share->use_count, share->commit_count));
+#ifdef HAVE_NDB_BINLOG
if (share->table)
DBUG_PRINT("share",
("table->s->db.table_name: %s.%s",
share->table->s->db, share->table->s->table_name));
+#endif
}
DBUG_VOID_RETURN;
}
@@ -6044,6 +6045,7 @@
#define dbug_print_open_tables()
#endif
+#ifdef HAVE_NDB_BINLOG
/*
For some reason a share is still around, try to salvage the situation
by closing all cached tables. If the share still exists, there is an
@@ -6280,13 +6282,13 @@
pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST);
share->commit_count= 0;
share->commit_count_lock= 0;
- share->op= 0;
- share->table= 0;
share->db= share->key + length + 1;
ha_ndbcluster::set_dbname(key, share->db);
share->table_name= share->db + strlen(share->db) + 1;
ha_ndbcluster::set_tabname(key, share->table_name);
#ifdef HAVE_NDB_BINLOG
+ share->op= 0;
+ share->table= 0;
while (ndb_binlog_thread_running > 0)
{
TABLE *table= (TABLE*) my_malloc(sizeof(*table), MYF(MY_WME));
@@ -6370,6 +6372,7 @@
pthread_mutex_destroy(&(*share)->mutex);
free_root(&(*share)->mem_root, MYF(0));
+#ifdef HAVE_NDB_BINLOG
if ((*share)->table)
{
closefrm((*share)->table);
@@ -6385,6 +6388,7 @@
(*share)->table= 0;
#endif
}
+#endif
my_free((gptr) *share, MYF(0));
*share= 0;
@@ -8604,7 +8608,10 @@
DBUG_RETURN(0);
}
-#if 0
+/*
+ Implements the SHOW NDB STATUS command.
+*/
+#ifndef HAVE_NDB_BINLOG
int
ndbcluster_show_status(THD* thd)
{
@@ -8649,11 +8656,7 @@
DBUG_RETURN(FALSE);
}
-#endif
-
-/*
- Implements the SHOW NDB STATUS command.
-*/
+#else
int ndbcluster_show_status(THD *thd)
{
Protocol *protocol= thd->protocol;
@@ -8725,6 +8728,7 @@
DBUG_RETURN(FALSE);
}
+#endif
#ifdef HAVE_NDB_BINLOG
--- 1.100/sql/ha_ndbcluster.h Fri Oct 7 11:06:16 2005
+++ 1.101/sql/ha_ndbcluster.h Thu Oct 13 22:36:30 2005
@@ -88,14 +88,14 @@
uint use_count;
uint commit_count_lock;
ulonglong commit_count;
+ char *db;
+ char *table_name;
#ifdef HAVE_NDB_BINLOG
NDB_SHARE_STATE state;
NdbEventOperation *op;
NdbEventOperation *op_old; // for rename table
char *old_names; // for rename table
TABLE *table;
- char *db;
- char *table_name;
NdbValue *ndb_value[2];
#endif
} NDB_SHARE;
@@ -800,3 +800,10 @@
void ndbcluster_print_error(int error, const NdbOperation *error_op);
int ndbcluster_show_status(THD*);
+
+#ifdef HAVE_NDB_BINLOG
+int ndbcluster_reset_logs(THD *thd);
+int ndbcluster_binlog_index_purge_file(THD *thd, const char *file);
+void ndbcluster_reset_slave(THD *thd);
+void ndbcluster_wait_binlog(THD *thd);
+#endif
--- 1.138/sql/set_var.cc Fri Oct 7 14:56:30 2005
+++ 1.139/sql/set_var.cc Thu Oct 13 22:36:31 2005
@@ -433,12 +433,14 @@
&SV::ndb_autoincrement_prefetch_sz);
sys_var_thd_bool
sys_ndb_force_send("ndb_force_send", &SV::ndb_force_send);
+#ifdef HAVE_NDB_BINLOG
sys_var_long_ptr
sys_ndb_report_thresh_binlog_epoch_slip("ndb_report_thresh_binlog_epoch_slip",
&ndb_report_thresh_binlog_epoch_slip);
sys_var_long_ptr
sys_ndb_report_thresh_binlog_mem_usage("ndb_report_thresh_binlog_mem_usage",
&ndb_report_thresh_binlog_mem_usage);
+#endif
sys_var_thd_bool
sys_ndb_use_exact_count("ndb_use_exact_count", &SV::ndb_use_exact_count);
sys_var_thd_bool
@@ -745,8 +747,10 @@
&sys_ndb_autoincrement_prefetch_sz,
&sys_ndb_cache_check_time,
&sys_ndb_force_send,
+#ifdef HAVE_NDB_BINLOG
&sys_ndb_report_thresh_binlog_epoch_slip,
&sys_ndb_report_thresh_binlog_mem_usage,
+#endif
&sys_ndb_use_exact_count,
&sys_ndb_use_transactions,
&sys_ndb_index_stat_enable,
@@ -943,10 +947,12 @@
{sys_ndb_index_stat_cache_entries.name, (char*) &sys_ndb_index_stat_cache_entries, SHOW_SYS},
{sys_ndb_index_stat_enable.name, (char*) &sys_ndb_index_stat_enable, SHOW_SYS},
{sys_ndb_index_stat_update_freq.name, (char*) &sys_ndb_index_stat_update_freq, SHOW_SYS},
+#ifdef HAVE_NDB_BINLOG
{sys_ndb_report_thresh_binlog_epoch_slip.name,
(char*) &sys_ndb_report_thresh_binlog_epoch_slip, SHOW_SYS},
{sys_ndb_report_thresh_binlog_mem_usage.name,
(char*) &sys_ndb_report_thresh_binlog_mem_usage, SHOW_SYS},
+#endif
{sys_ndb_use_exact_count.name,(char*) &sys_ndb_use_exact_count, SHOW_SYS},
{sys_ndb_use_transactions.name,(char*) &sys_ndb_use_transactions, SHOW_SYS},
#endif
--- 1.5/mysql-test/r/ndb_multi.result Tue Sep 20 22:25:52 2005
+++ 1.6/mysql-test/r/ndb_multi.result Thu Oct 13 22:36:30 2005
@@ -1,4 +1,5 @@
drop table if exists t1, t2, t3, t4;
+drop table if exists t1, t2, t3, t4;
flush status;
create table t1 (a int) engine=ndbcluster;
create table t2 (a int) engine=ndbcluster;
--- 1.6/mysql-test/t/ndb_multi.test Mon Aug 15 18:50:53 2005
+++ 1.7/mysql-test/t/ndb_multi.test Thu Oct 13 22:36:30 2005
@@ -4,6 +4,9 @@
--disable_warnings
+connection server2;
+drop table if exists t1, t2, t3, t4;
+connection server1;
drop table if exists t1, t2, t3, t4;
--enable_warnings
--- 1.143/sql/sql_repl.cc Wed Sep 14 19:55:30 2005
+++ 1.144/sql/sql_repl.cc Thu Oct 13 22:36:31 2005
@@ -26,9 +26,12 @@
my_bool opt_sporadic_binlog_dump_fail = 0;
static int binlog_dump_count = 0;
-#ifdef HAVE_NDBCLUSTER_DB
-void ndbcluster_reset_slave(THD* thd);
-void ndbcluster_wait_binlog(THD* thd);
+#ifdef HAVE_ROW_BASED_REPLICATION
+void ha_reset_slave(THD* thd);
+void ha_wait_binlog(THD* thd);
+#else
+#define ha_reset_slave(a)
+#define ha_wait_binlog(a)
#endif
/*
@@ -976,9 +979,7 @@
goto err;
}
-#ifdef HAVE_NDBCLUSTER_DB
- ndbcluster_reset_slave(thd);
-#endif
+ ha_reset_slave(thd);
// delete relay logs, clear relay log coordinates
if ((error= purge_relay_logs(&mi->rli, thd,
@@ -1324,9 +1325,7 @@
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
-#ifdef HAVE_NDBCLUSTER_DB
- ndbcluster_wait_binlog(thd);
-#endif
+ ha_wait_binlog(thd);
if (mysql_bin_log.is_open())
{
--- 1.3/mysql-test/r/ndb_read_multi_range.result Wed Dec 1 12:43:28 2004
+++ 1.4/mysql-test/r/ndb_read_multi_range.result Thu Oct 13 22:36:30 2005
@@ -1,4 +1,4 @@
-DROP TABLE IF EXISTS t1, r1;
+DROP TABLE IF EXISTS t1, t2, r1;
create table t1 (
a int primary key,
b int not null,
--- 1.4/mysql-test/t/ndb_read_multi_range.test Thu Apr 21 11:11:17 2005
+++ 1.5/mysql-test/t/ndb_read_multi_range.test Thu Oct 13 22:36:30 2005
@@ -2,7 +2,7 @@
-- source include/not_embedded.inc
--disable_warnings
-DROP TABLE IF EXISTS t1, r1;
+DROP TABLE IF EXISTS t1, t2, r1;
--enable_warnings
#
--- 1.2/sql/rpl_injector.cc Wed Aug 17 18:28:05 2005
+++ 1.3/sql/rpl_injector.cc Thu Oct 13 22:36:31 2005
@@ -17,6 +17,7 @@
#include "mysql_priv.h"
#include "rpl_injector.h"
+#ifdef HAVE_ROW_BASED_REPLICATION
////////////////////////////////////////////////////////////////
// injector::transaction - member definitions
@@ -150,4 +151,4 @@
DBUG_VOID_RETURN;
}
-
+#endif
--- 1.1/sql/rpl_injector.h Thu Jul 21 20:35:21 2005
+++ 1.2/sql/rpl_injector.h Thu Oct 13 22:36:31 2005
@@ -19,6 +19,8 @@
#define INJECTOR_H
#include <my_global.h> // Pull in 'byte', 'my_off_t', and 'uint32'
+
+#ifdef HAVE_ROW_BASED_REPLICATION
#include <my_bitmap.h>
// Forward declarations
@@ -737,5 +739,5 @@
// instances.
};
-
+#endif
#endif // INJECTOR_H
| Thread |
|---|
| • bk commit into 5.1 tree (tulin:1.1933) | tomas | 13 Oct |