Below is the list of changes that have just been committed into a local
5.1 repository of root. When root 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@stripped, 2006-12-01 10:48:38+08:00, gni@stripped +20 -0
Merge ts3-168.ts.cn.tlan:/home/ngb/mysql/mysql-5.1/mysql-5.1-new-ndb-bj
into ts3-168.ts.cn.tlan:/home/ngb/mysql/mysql-5.1/mysql-5.1-new-ndb
MERGE: 1.2303.1.20
BitKeeper/deleted/.del-OSE_Receiver.cpp@stripped, 2006-12-01 10:45:28+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.5.1.1
BitKeeper/deleted/.del-OSE_Receiver.cpp@stripped, 2006-12-01 10:45:28+08:00, gni@stripped +0 -0
Merge rename: storage/ndb/src/common/transporter/OSE_Receiver.cpp -> BitKeeper/deleted/.del-OSE_Receiver.cpp
sql/ha_ndbcluster.cc@stripped, 2006-12-01 10:45:28+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.357.6.2
sql/log.cc@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.237.3.1
sql/log.h@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.16.1.1
sql/share/errmsg.txt@stripped, 2006-12-01 10:48:35+08:00, gni@stripped +0 -0
merge error codes added by bj teams and ndb groups
MERGE: 1.130.1.1
sql/sql_repl.cc@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.155.1.3
sql/table.cc@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.243.1.2
storage/ndb/include/mgmapi/mgmapi.h@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.57.1.2
storage/ndb/src/common/transporter/TCP_Transporter.cpp@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.11.1.1
storage/ndb/src/common/transporter/TransporterRegistry.cpp@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.65.1.1
storage/ndb/src/common/util/File.cpp@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.13.1.2
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.32.1.2
storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.21.1.1
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2006-12-01 10:48:36+08:00, gni@stripped +0 -14
Auto Merged
MERGE: 1.103.1.1
storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.29.1.2
storage/ndb/src/kernel/vm/SimulatedBlock.cpp@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.32.1.1
storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.90.1.1
storage/ndb/src/mgmsrv/Services.cpp@stripped, 2006-12-01 10:48:36+08:00, gni@stripped +9 -0
Auto Merged
MERGE: 1.75.2.1
storage/ndb/tools/restore/consumer_restore.cpp@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.36.1.1
storage/ndb/tools/restore/restore_main.cpp@stripped, 2006-12-01 10:45:29+08:00, gni@stripped +0 -0
Auto merged
MERGE: 1.48.1.1
# 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: gni
# Host: ts3-168.ts.cn.tlan
# Root: /home/ngb/mysql/mysql-5.1/mysql-5.1-new-ndb/RESYNC
--- 1.244/sql/log.cc 2006-12-01 10:48:48 +08:00
+++ 1.245/sql/log.cc 2006-12-01 10:48:48 +08:00
@@ -2973,6 +2973,7 @@
ulonglong *decrease_log_space)
{
int error;
+ int ret = 0;
bool exit_loop= 0;
LOG_INFO log_info;
DBUG_ENTER("purge_logs");
@@ -3017,6 +3018,14 @@
*decrease_log_space-= file_size;
ha_binlog_index_purge_file(current_thd, log_info.log_file_name);
+ if (current_thd->query_error) {
+ DBUG_PRINT("info",("query error: %d", current_thd->query_error));
+ if (my_errno == EMFILE) {
+ DBUG_PRINT("info",("my_errno: %d, set ret = LOG_INFO_EMFILE", my_errno));
+ ret = LOG_INFO_EMFILE;
+ break;
+ }
+ }
if (find_next_log(&log_info, 0) || exit_loop)
break;
@@ -3027,6 +3036,9 @@
the log index file after restart - otherwise, this should be safe
*/
error= update_log_index(&log_info, need_update_threads);
+ if (error == 0) {
+ error = ret;
+ }
err:
if (need_mutex)
--- 1.257/sql/table.cc 2006-12-01 10:48:48 +08:00
+++ 1.258/sql/table.cc 2006-12-01 10:48:48 +08:00
@@ -1562,21 +1562,32 @@
outparam->file->auto_repair() &&
!(ha_open_flags & HA_OPEN_FOR_REPAIR));
- if (ha_err == HA_ERR_NO_SUCH_TABLE)
+ switch (ha_err)
{
- /*
- The table did not exists in storage engine, use same error message
- as if the .frm file didn't exist
- */
- error= 1;
- my_errno= ENOENT;
- }
- else
- {
- outparam->file->print_error(ha_err, MYF(0));
- error_reported= TRUE;
- if (ha_err == HA_ERR_TABLE_DEF_CHANGED)
- error= 7;
+ case HA_ERR_NO_SUCH_TABLE:
+ /*
+ The table did not exists in storage engine, use same error message
+ as if the .frm file didn't exist
+ */
+ error= 1;
+ my_errno= ENOENT;
+ break;
+ case EMFILE:
+ /*
+ Too many files opened, use same error message as if the .frm
+ file can't open
+ */
+ DBUG_PRINT("error", ("open file: %s failed, too many files opened (errno: %d)",
+ share->normalized_path.str, ha_err));
+ error= 1;
+ my_errno= EMFILE;
+ break;
+ default:
+ outparam->file->print_error(ha_err, MYF(0));
+ error_reported= TRUE;
+ if (ha_err == HA_ERR_TABLE_DEF_CHANGED)
+ error= 7;
+ break;
}
goto err; /* purecov: inspected */
}
--- 1.134/sql/share/errmsg.txt 2006-12-01 10:48:48 +08:00
+++ 1.135/sql/share/errmsg.txt 2006-12-01 10:48:48 +08:00
@@ -6012,4 +6012,5 @@
eng "Incorrect parameters in the call to native function '%-.64s'"
ER_NATIVE_FCT_NAME_COLLISION
eng "This function '%-.64s' has the same name as a native function."
-
+ER_BINLOG_PURGE_EMFILE
+ eng "Too many files opened, please execute the command again"
--- 1.17/sql/log.h 2006-12-01 10:48:48 +08:00
+++ 1.18/sql/log.h 2006-12-01 10:48:48 +08:00
@@ -406,6 +406,9 @@
};
+int check_if_log_table(uint db_len, const char *db, uint table_name_len,
+ const char *table_name, uint check_if_opened);
+
class Log_to_csv_event_handler: public Log_event_handler
{
/*
@@ -414,6 +417,16 @@
THD's of the query. The reason is the locking order and duration.
*/
THD *general_log_thd, *slow_log_thd;
+ /*
+ This is for the thread, which called tmp_close_log_tables. The thread
+ will be allowed to write-lock the log tables (as it explicitly disabled
+ logging). This is used for such operations as REPAIR, which require
+ exclusive lock on the log tables.
+ NOTE: there can be only one priviliged thread, as one should
+ lock logger with logger.lock() before calling tmp_close_log_tables().
+ So no other thread could get privileged status at the same time.
+ */
+ THD *privileged_thread;
friend class LOGGER;
TABLE_LIST general_log, slow_log;
@@ -438,13 +451,20 @@
const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len,
CHARSET_INFO *client_cs);
- bool flush(THD *thd, TABLE_LIST *close_slow_Log,
- TABLE_LIST* close_general_log);
+ void tmp_close_log_tables(THD *thd);
void close_log_table(uint log_type, bool lock_in_use);
bool reopen_log_table(uint log_type);
+ THD* get_privileged_thread()
+ {
+ return privileged_thread;
+ }
};
+/* type of the log table */
+#define QUERY_LOG_SLOW 1
+#define QUERY_LOG_GENERAL 2
+
class Log_to_file_event_handler: public Log_event_handler
{
MYSQL_QUERY_LOG mysql_log;
@@ -500,13 +520,18 @@
{}
void lock() { (void) pthread_mutex_lock(&LOCK_logger); }
void unlock() { (void) pthread_mutex_unlock(&LOCK_logger); }
- bool is_general_log_table_enabled()
+ void tmp_close_log_tables(THD *thd);
+ bool is_log_table_enabled(uint log_table_type)
{
- return table_log_handler && table_log_handler->general_log.table != 0;
- }
- bool is_slow_log_table_enabled()
- {
- return table_log_handler && table_log_handler->slow_log.table != 0;
+ switch (log_table_type) {
+ case QUERY_LOG_SLOW:
+ return table_log_handler && table_log_handler->slow_log.table != 0;
+ case QUERY_LOG_GENERAL:
+ return table_log_handler && table_log_handler->general_log.table != 0;
+ default:
+ DBUG_ASSERT(0);
+ return FALSE; /* make compiler happy */
+ }
}
/*
We want to initialize all log mutexes as soon as possible,
@@ -544,6 +569,7 @@
void close_log_table(uint log_type, bool lock_in_use);
bool reopen_log_table(uint log_type);
+ bool reopen_log_tables();
/* we use this function to setup all enabled log event handlers */
int set_handlers(uint error_log_printer,
@@ -565,6 +591,13 @@
if (file_log_handler)
return file_log_handler->get_mysql_log();
return NULL;
+ }
+ THD* get_privileged_thread()
+ {
+ if (table_log_handler)
+ return table_log_handler->get_privileged_thread();
+ else
+ return NULL;
}
};
--- 1.58/storage/ndb/include/mgmapi/mgmapi.h 2006-12-01 10:48:48 +08:00
+++ 1.59/storage/ndb/include/mgmapi/mgmapi.h 2006-12-01 10:48:48 +08:00
@@ -17,6 +17,11 @@
#ifndef MGMAPI_H
#define MGMAPI_H
+#include "mgmapi_config_parameters.h"
+#include "ndb_logevent.h"
+
+#define MGM_LOGLEVELS CFG_MAX_LOGLEVEL - CFG_MIN_LOGLEVEL + 1
+
/**
* @mainpage MySQL Cluster Management API
*
@@ -843,6 +848,30 @@
*
* @param handle NDB management handle
*
+ * @param loglevel A vector of seven (NDB_MGM_EVENT_SEVERITY_ALL)
+ * elements of struct ndb_mgm_severity,
+ * where each element contains
+ * 1 if a severity indicator is enabled and 0 if not.
+ * A severity level is stored at position
+ * ndb_mgm_clusterlog_level;
+ * for example the "error" level is stored in position
+ * [NDB_MGM_EVENT_SEVERITY_ERROR].
+ * The first element [NDB_MGM_EVENT_SEVERITY_ON] in
+ * the vector signals whether the cluster log
+ * is disabled or enabled.
+ * @param severity_size The size of the vector (NDB_MGM_EVENT_SEVERITY_ALL)
+ * @return Number of returned severities or -1 on error
+ */
+ int ndb_mgm_get_clusterlog_severity_filter(NdbMgmHandle handle,
+ struct ndb_mgm_severity* severity,
+ unsigned int severity_size);
+
+#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
+ /**
+ * Get clusterlog severity filter
+ *
+ * @param handle NDB management handle
+ *
* @return A vector of seven elements,
* where each element contains
* 1 if a severity indicator is enabled and 0 if not.
@@ -855,7 +884,8 @@
* whether the cluster log
* is disabled or enabled.
*/
- const unsigned int *ndb_mgm_get_clusterlog_severity_filter(NdbMgmHandle handle);
+ const unsigned int *ndb_mgm_get_clusterlog_severity_filter_old(NdbMgmHandle handle);
+#endif
/**
* Set log category and levels for the cluster log
@@ -872,6 +902,23 @@
enum ndb_mgm_event_category category,
int level,
struct ndb_mgm_reply* reply);
+
+ /**
+ * get log category and levels
+ *
+ * @param handle NDB management handle.
+ * @param loglevel A vector of twelve (MGM_LOGLEVELS) elements
+ * of struct ndb_mgm_loglevel,
+ * where each element contains
+ * loglevel of corresponding category
+ * @param loglevel_size The size of the vector (MGM_LOGLEVELS)
+ * @return Number of returned loglevels or -1 on error
+ */
+ int ndb_mgm_get_clusterlog_loglevel(NdbMgmHandle handle,
+ struct ndb_mgm_loglevel* loglevel,
+ unsigned int loglevel_size);
+
+#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/**
* get log category and levels
*
@@ -880,7 +927,9 @@
* where each element contains
* loglevel of corresponding category
*/
- const unsigned int *ndb_mgm_get_clusterlog_loglevel(NdbMgmHandle handle);
+ const unsigned int *ndb_mgm_get_clusterlog_loglevel_old(NdbMgmHandle handle);
+#endif
+
/** @} *********************************************************************/
/**
@@ -1161,10 +1210,14 @@
int e, struct ndb_mgm_reply* r)
{ return ndb_mgm_set_clusterlog_severity_filter(h,(ndb_mgm_event_severity)s,
e,r); }
-
+ struct ndb_mgm_severity {
+ enum ndb_mgm_event_severity category;
+ unsigned int value;
+ };
+
inline
- const unsigned int *ndb_mgm_get_logfilter(NdbMgmHandle h)
- { return ndb_mgm_get_clusterlog_severity_filter(h); }
+ const unsigned int * ndb_mgm_get_logfilter(NdbMgmHandle h)
+ { return ndb_mgm_get_clusterlog_severity_filter_old(h); }
inline
int ndb_mgm_set_loglevel_clusterlog(NdbMgmHandle h, int n,
@@ -1172,9 +1225,14 @@
int l, struct ndb_mgm_reply* r)
{ return ndb_mgm_set_clusterlog_loglevel(h,n,c,l,r); }
+ struct ndb_mgm_loglevel {
+ enum ndb_mgm_event_category category;
+ unsigned int value;
+ };
+
inline
- const unsigned int *ndb_mgm_get_loglevel_clusterlog(NdbMgmHandle h)
- { return ndb_mgm_get_clusterlog_loglevel(h); }
+ const unsigned int * ndb_mgm_get_loglevel_clusterlog(NdbMgmHandle h)
+ { return ndb_mgm_get_clusterlog_loglevel_old(h); }
#endif
--- 1.91/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2006-12-01 10:48:48 +08:00
+++ 1.92/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2006-12-01 10:48:48 +08:00
@@ -66,8 +66,7 @@
"TCP",
"SCI",
- "SHM",
- "OSE"
+ "SHM"
};
const int ConfigInfo::m_noOfSectionNames =
sizeof(m_sectionNames)/sizeof(char*);
@@ -112,12 +111,10 @@
{ "TCP", checkConnectionSupport, 0 },
{ "SHM", checkConnectionSupport, 0 },
{ "SCI", checkConnectionSupport, 0 },
- { "OSE", checkConnectionSupport, 0 },
{ "TCP", transformConnection, 0 },
{ "SHM", transformConnection, 0 },
{ "SCI", transformConnection, 0 },
- { "OSE", transformConnection, 0 },
{ DB_TOKEN, fixNodeHostname, 0 },
{ API_TOKEN, fixNodeHostname, 0 },
@@ -129,9 +126,7 @@
{ "SHM", fixNodeId, "NodeId2" },
{ "SCI", fixNodeId, "NodeId1" },
{ "SCI", fixNodeId, "NodeId2" },
- { "OSE", fixNodeId, "NodeId1" },
- { "OSE", fixNodeId, "NodeId2" },
-
+
{ "TCP", fixHostname, "HostName1" },
{ "TCP", fixHostname, "HostName2" },
{ "SHM", fixHostname, "HostName1" },
@@ -140,8 +135,6 @@
{ "SCI", fixHostname, "HostName2" },
{ "SHM", fixHostname, "HostName1" },
{ "SHM", fixHostname, "HostName2" },
- { "OSE", fixHostname, "HostName1" },
- { "OSE", fixHostname, "HostName2" },
{ "TCP", fixPortNumber, 0 }, // has to come after fixHostName
{ "SHM", fixPortNumber, 0 }, // has to come after fixHostName
@@ -165,7 +158,6 @@
{ "TCP", checkConnectionConstraints, 0 },
{ "SHM", checkConnectionConstraints, 0 },
{ "SCI", checkConnectionConstraints, 0 },
- { "OSE", checkConnectionConstraints, 0 },
{ "TCP", checkTCPConstraints, "HostName1" },
{ "TCP", checkTCPConstraints, "HostName2" },
@@ -182,8 +174,7 @@
{ "TCP", saveInConfigValues, 0 },
{ "SHM", saveInConfigValues, 0 },
- { "SCI", saveInConfigValues, 0 },
- { "OSE", saveInConfigValues, 0 }
+ { "SCI", saveInConfigValues, 0 }
};
const int ConfigInfo::m_NoOfRules = sizeof(m_SectionRules)/sizeof(SectionRule);
@@ -2147,150 +2138,7 @@
false,
ConfigInfo::CI_STRING,
UNDEFINED,
- 0, 0 },
-
- /****************************************************************************
- * OSE
- ***************************************************************************/
- {
- CFG_SECTION_CONNECTION,
- "OSE",
- "OSE",
- "Connection section",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_SECTION,
- (const char *)CONNECTION_TYPE_OSE,
- 0, 0
- },
-
- {
- CFG_CONNECTION_HOSTNAME_1,
- "HostName1",
- "OSE",
- "Name of computer on one side of the connection",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_STRING,
- UNDEFINED,
- 0, 0 },
-
- {
- CFG_CONNECTION_HOSTNAME_2,
- "HostName2",
- "OSE",
- "Name of computer on one side of the connection",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_STRING,
- UNDEFINED,
- 0, 0 },
-
- {
- CFG_CONNECTION_NODE_1,
- "NodeId1",
- "OSE",
- "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_INT,
- MANDATORY,
- "0",
- STR_VALUE(MAX_INT_RNIL) },
-
- {
- CFG_CONNECTION_NODE_2,
- "NodeId2",
- "OSE",
- "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_INT,
- UNDEFINED,
- "0",
- STR_VALUE(MAX_INT_RNIL) },
-
- {
- CFG_CONNECTION_SEND_SIGNAL_ID,
- "SendSignalId",
- "OSE",
- "Sends id in each signal. Used in trace files.",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_BOOL,
- "true",
- "false",
- "true" },
-
- {
- CFG_CONNECTION_CHECKSUM,
- "Checksum",
- "OSE",
- "If checksum is enabled, all signals between nodes are checked for errors",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_BOOL,
- "false",
- "false",
- "true" },
-
- {
- CFG_OSE_PRIO_A_SIZE,
- "PrioASignalSize",
- "OSE",
- "Size of priority A signals (in bytes)",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_INT,
- "1000",
- "0",
- STR_VALUE(MAX_INT_RNIL) },
-
- {
- CFG_OSE_PRIO_B_SIZE,
- "PrioBSignalSize",
- "OSE",
- "Size of priority B signals (in bytes)",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_INT,
- "1000",
- "0",
- STR_VALUE(MAX_INT_RNIL) },
-
- {
- CFG_OSE_RECEIVE_ARRAY_SIZE,
- "ReceiveArraySize",
- "OSE",
- "Number of OSE signals checked for correct ordering (in no of OSE signals)",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_INT,
- "10",
- "0",
- STR_VALUE(MAX_INT_RNIL) },
-
- {
- CFG_CONNECTION_NODE_1_SYSTEM,
- "NodeId1_System",
- "OSE",
- "System for node 1 in connection",
- ConfigInfo::CI_INTERNAL,
- false,
- ConfigInfo::CI_STRING,
- UNDEFINED,
- 0, 0 },
-
- {
- CFG_CONNECTION_NODE_2_SYSTEM,
- "NodeId2_System",
- "OSE",
- "System for node 2 in connection",
- ConfigInfo::CI_INTERNAL,
- false,
- ConfigInfo::CI_STRING,
- UNDEFINED,
- 0, 0 },
+ 0, 0 }
};
const int ConfigInfo::m_NoOfParams = sizeof(m_ParamInfo) / sizeof(ParamInfo);
@@ -2835,12 +2683,7 @@
error= 1;
#endif
}
- else if (strcasecmp("OSE",ctx.fname) == 0)
- {
-#ifndef NDB_OSE_TRANSPORTER
- error= 1;
-#endif
- }
+
if (error)
{
ctx.reportError("Binary not compiled with this connection support, "
--- 1.12/storage/ndb/src/common/transporter/TCP_Transporter.cpp 2006-12-01 10:48:48 +08:00
+++ 1.13/storage/ndb/src/common/transporter/TCP_Transporter.cpp 2006-12-01 10:48:48 +08:00
@@ -25,12 +25,6 @@
extern EventLogger g_eventLogger;
// End of stuff to be moved
-#if defined NDB_OSE || defined NDB_SOFTOSE
-#define inet_send inet_send
-#else
-#define inet_send send
-#endif
-
#ifdef NDB_WIN32
class ndbstrerror
{
@@ -224,22 +218,6 @@
bool
TCP_Transporter::sendIsPossible(struct timeval * timeout) {
-#ifdef NDB_OSE
- /**
- * In OSE you cant do select without owning a socket,
- * and since this method might be called by any thread in the api
- * we choose not to implementet and always return true after sleeping
- * a while.
- *
- * Note that this only sensible as long as the sockets are non blocking
- */
- if(theSocket >= 0){
- Uint32 timeOutMillis = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;
- NdbSleep_MilliSleep(timeOutMillis);
- return true;
- }
- return false;
-#else
if(theSocket != NDB_INVALID_SOCKET){
fd_set writeset;
FD_ZERO(&writeset);
@@ -253,7 +231,6 @@
return false;
}
return false;
-#endif
}
Uint32
@@ -337,7 +314,7 @@
const char * const sendPtr = m_sendBuffer.sendPtr;
const Uint32 sizeToSend = m_sendBuffer.sendDataSize;
if (sizeToSend > 0){
- const int nBytesSent = inet_send(theSocket, sendPtr, sizeToSend, 0);
+ const int nBytesSent = send(theSocket, sendPtr, sizeToSend, 0);
if (nBytesSent > 0) {
m_sendBuffer.bytesSent(nBytesSent);
--- 1.66/storage/ndb/src/common/transporter/TransporterRegistry.cpp 2006-12-01 10:48:48 +08:00
+++ 1.67/storage/ndb/src/common/transporter/TransporterRegistry.cpp 2006-12-01 10:48:48 +08:00
@@ -27,11 +27,6 @@
#include "TCP_Transporter.hpp"
#endif
-#ifdef NDB_OSE_TRANSPORTER
-#include "OSE_Receiver.hpp"
-#include "OSE_Transporter.hpp"
-#endif
-
#ifdef NDB_SCI_TRANSPORTER
#include "SCI_Transporter.hpp"
#endif
@@ -95,7 +90,6 @@
theTCPTransporters = new TCP_Transporter * [maxTransporters];
theSCITransporters = new SCI_Transporter * [maxTransporters];
theSHMTransporters = new SHM_Transporter * [maxTransporters];
- theOSETransporters = new OSE_Transporter * [maxTransporters];
theTransporterTypes = new TransporterType [maxTransporters];
theTransporters = new Transporter * [maxTransporters];
performStates = new PerformState [maxTransporters];
@@ -106,21 +100,16 @@
nTCPTransporters = 0;
nSCITransporters = 0;
nSHMTransporters = 0;
- nOSETransporters = 0;
// Initialize the transporter arrays
for (unsigned i=0; i<maxTransporters; i++) {
theTCPTransporters[i] = NULL;
theSCITransporters[i] = NULL;
theSHMTransporters[i] = NULL;
- theOSETransporters[i] = NULL;
theTransporters[i] = NULL;
performStates[i] = DISCONNECTED;
ioStates[i] = NoHalt;
}
- theOSEReceiver = 0;
- theOSEJunkSocketSend = 0;
- theOSEJunkSocketRecv = 0;
DBUG_VOID_RETURN;
}
@@ -155,19 +144,11 @@
delete[] theTCPTransporters;
delete[] theSCITransporters;
delete[] theSHMTransporters;
- delete[] theOSETransporters;
delete[] theTransporterTypes;
delete[] theTransporters;
delete[] performStates;
delete[] ioStates;
-#ifdef NDB_OSE_TRANSPORTER
- if(theOSEReceiver != NULL){
- theOSEReceiver->destroyPhantom();
- delete theOSEReceiver;
- theOSEReceiver = 0;
- }
-#endif
if (m_mgm_handle)
ndb_mgm_destroy_handle(&m_mgm_handle);
@@ -327,60 +308,6 @@
nTransporters++;
nTCPTransporters++;
-#if defined NDB_OSE || defined NDB_SOFTOSE
- t->theReceiverPid = theReceiverPid;
-#endif
-
- return true;
-#else
- return false;
-#endif
-}
-
-bool
-TransporterRegistry::createOSETransporter(TransporterConfiguration *conf) {
-#ifdef NDB_OSE_TRANSPORTER
-
- if(!nodeIdSpecified){
- init(conf->localNodeId);
- }
-
- if(conf->localNodeId != localNodeId)
- return false;
-
- if(theTransporters[conf->remoteNodeId] != NULL)
- return false;
-
- if(theOSEReceiver == NULL){
- theOSEReceiver = new OSE_Receiver(this,
- 10,
- localNodeId);
- }
-
- OSE_Transporter * t = new OSE_Transporter(conf->ose.prioASignalSize,
- conf->ose.prioBSignalSize,
- localNodeId,
- conf->localHostName,
- conf->remoteNodeId,
- conf->serverNodeId,
- conf->remoteHostName,
- conf->checksum,
- conf->signalId);
- if (t == NULL)
- return false;
- else if (!t->initTransporter()) {
- delete t;
- return false;
- }
- // Put the transporter in the transporter arrays
- theOSETransporters[nOSETransporters] = t;
- theTransporters[t->getRemoteNodeId()] = t;
- theTransporterTypes[t->getRemoteNodeId()] = tt_OSE_TRANSPORTER;
- performStates[t->getRemoteNodeId()] = DISCONNECTED;
-
- nTransporters++;
- nOSETransporters++;
-
return true;
#else
return false;
@@ -550,19 +477,8 @@
nSHMTransporters --;
#endif
break;
- case tt_OSE_TRANSPORTER:
-#ifdef NDB_OSE_TRANSPORTER
- for(; ind < nOSETransporters; ind++)
- if(theOSETransporters[ind]->getRemoteNodeId() == nodeId)
- break;
- ind++;
- for(; ind<nOSETransporters; ind++)
- theOSETransporters[ind-1] = theOSETransporters[ind];
- nOSETransporters --;
-#endif
- break;
}
-
+
nTransporters--;
// Delete the transporter and remove it from theTransporters array
@@ -742,12 +658,7 @@
Uint32
TransporterRegistry::pollReceive(Uint32 timeOutMillis){
Uint32 retVal = 0;
-#ifdef NDB_OSE_TRANSPORTER
- retVal |= poll_OSE(timeOutMillis);
- retVal |= poll_TCP(0);
- return retVal;
-#endif
-
+
if((nSCITransporters) > 0)
{
timeOutMillis=0;
@@ -824,18 +735,6 @@
}
#endif
-#ifdef NDB_OSE_TRANSPORTER
-Uint32
-TransporterRegistry::poll_OSE(Uint32 timeOutMillis)
-{
- if(theOSEReceiver != NULL){
- return theOSEReceiver->doReceive(timeOutMillis);
- }
- NdbSleep_MilliSleep(timeOutMillis);
- return 0;
-}
-#endif
-
#ifdef NDB_TCP_TRANSPORTER
Uint32
TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
@@ -847,20 +746,8 @@
}
struct timeval timeout;
-#ifdef NDB_OSE
- // Return directly if there are no TCP transporters configured
-
- if(timeOutMillis <= 1){
- timeout.tv_sec = 0;
- timeout.tv_usec = 1025;
- } else {
- timeout.tv_sec = timeOutMillis / 1000;
- timeout.tv_usec = (timeOutMillis % 1000) * 1000;
- }
-#else
timeout.tv_sec = timeOutMillis / 1000;
timeout.tv_usec = (timeOutMillis % 1000) * 1000;
-#endif
NDB_SOCKET_TYPE maxSocketValue = -1;
@@ -908,33 +795,6 @@
void
TransporterRegistry::performReceive()
{
-#ifdef NDB_OSE_TRANSPORTER
- if(theOSEReceiver != 0)
- {
- while(theOSEReceiver->hasData())
- {
- NodeId remoteNodeId;
- Uint32 * readPtr;
- Uint32 sz = theOSEReceiver->getReceiveData(&remoteNodeId, &readPtr);
- transporter_recv_from(callbackObj, remoteNodeId);
- Uint32 szUsed = unpack(readPtr,
- sz,
- remoteNodeId,
- ioStates[remoteNodeId]);
-#ifdef DEBUG_TRANSPORTER
- /**
- * OSE transporter can handle executions of
- * half signals
- */
- assert(sz == szUsed);
-#endif
- theOSEReceiver->updateReceiveDataPtr(szUsed);
- theOSEReceiver->doReceive(0);
- // checkJobBuffer();
- }
- }
-#endif
-
#ifdef NDB_TCP_TRANSPORTER
if(tcpReadSelectReply > 0)
{
@@ -1008,67 +868,7 @@
{
int i;
sendCounter = 1;
-
-#ifdef NDB_OSE_TRANSPORTER
- for (int i = 0; i < nOSETransporters; i++)
- {
- OSE_Transporter *t = theOSETransporters[i];
- if(is_connected(t->getRemoteNodeId()) &&& (t->isConnected()))
- {
- t->doSend();
- }//if
- }//for
-#endif
-
-#ifdef NDB_TCP_TRANSPORTER
-#ifdef NDB_OSE
- {
- int maxSocketValue = 0;
-
- // Needed for TCP/IP connections
- // The writeset are used by select
- fd_set writeset;
- FD_ZERO(&writeset);
-
- // Prepare for sending and receiving
- for (i = 0; i < nTCPTransporters; i++) {
- TCP_Transporter * t = theTCPTransporters[i];
-
- // If the transporter is connected
- if ((t->hasDataToSend()) && (t->isConnected())) {
- const int socket = t->getSocket();
- // Find the highest socket value. It will be used by select
- if (socket > maxSocketValue) {
- maxSocketValue = socket;
- }//if
- FD_SET(socket, &writeset);
- }//if
- }//for
-
- // The highest socket value plus one
- if(maxSocketValue == 0)
- return;
-
- maxSocketValue++;
- struct timeval timeout = { 0, 1025 };
- Uint32 tmp = select(maxSocketValue, 0, &writeset, 0, &timeout);
-
- if (tmp == 0)
- {
- return;
- }//if
- for (i = 0; i < nTCPTransporters; i++) {
- TCP_Transporter *t = theTCPTransporters[i];
- const NodeId nodeId = t->getRemoteNodeId();
- const int socket = t->getSocket();
- if(is_connected(nodeId)){
- if(t->isConnected() && FD_ISSET(socket, &writeset)) {
- t->doSend();
- }//if
- }//if
- }//for
- }
-#endif
+
#ifdef NDB_TCP_TRANSPORTER
for (i = m_transp_count; i < nTCPTransporters; i++)
{
@@ -1091,7 +891,6 @@
m_transp_count++;
if (m_transp_count == nTCPTransporters) m_transp_count = 0;
#endif
-#endif
#ifdef NDB_SCI_TRANSPORTER
//scroll through the SCI transporters,
// get each transporter, check if connected, send data
@@ -1470,21 +1269,6 @@
TransporterRegistry::startReceiving()
{
DBUG_ENTER("TransporterRegistry::startReceiving");
-#ifdef NDB_OSE_TRANSPORTER
- if(theOSEReceiver != NULL){
- theOSEReceiver->createPhantom();
- }
-#endif
-
-#ifdef NDB_OSE
- theOSEJunkSocketRecv = socket(AF_INET, SOCK_STREAM, 0);
-#endif
-
-#if defined NDB_OSE || defined NDB_SOFTOSE
- theReceiverPid = current_process();
- for(int i = 0; i<nTCPTransporters; i++)
- theTCPTransporters[i]->theReceiverPid = theReceiverPid;
-#endif
#ifdef NDB_SHM_TRANSPORTER
m_shm_own_pid = getpid();
@@ -1513,41 +1297,20 @@
void
TransporterRegistry::stopReceiving(){
-#ifdef NDB_OSE_TRANSPORTER
- if(theOSEReceiver != NULL){
- theOSEReceiver->destroyPhantom();
- }
-#endif
-
/**
* Disconnect all transporters, this includes detach from remote node
* and since that must be done from the same process that called attach
* it's done here in the receive thread
*/
disconnectAll();
-
-#if defined NDB_OSE || defined NDB_SOFTOSE
- if(theOSEJunkSocketRecv > 0)
- close(theOSEJunkSocketRecv);
- theOSEJunkSocketRecv = -1;
-#endif
-
}
void
TransporterRegistry::startSending(){
-#if defined NDB_OSE || defined NDB_SOFTOSE
- theOSEJunkSocketSend = socket(AF_INET, SOCK_STREAM, 0);
-#endif
}
void
TransporterRegistry::stopSending(){
-#if defined NDB_OSE || defined NDB_SOFTOSE
- if(theOSEJunkSocketSend > 0)
- close(theOSEJunkSocketSend);
- theOSEJunkSocketSend = -1;
-#endif
}
NdbOut & operator <<(NdbOut & out, SignalHeader & sh){
--- 1.14/storage/ndb/src/common/util/File.cpp 2006-12-01 10:48:48 +08:00
+++ 1.15/storage/ndb/src/common/util/File.cpp 2006-12-01 10:48:48 +08:00
@@ -45,17 +45,16 @@
return (my_stat(aFileName, &stmp, MYF(0))!=NULL);
}
-long
+off_t
File_class::size(FILE* f)
{
- long cur_pos = 0, length = 0;
-
- cur_pos = ::ftell(f);
- ::fseek(f, 0, SEEK_END);
- length = ::ftell(f);
- ::fseek(f, cur_pos, SEEK_SET); // restore original position
+ MY_STAT s;
+
+ // Note that my_fstat behaves *differently* than my_stat. ARGGGHH!
+ if(my_fstat(::fileno(f), &s, MYF(0)))
+ return 0;
- return length;
+ return s.st_size;
}
bool
@@ -180,8 +179,8 @@
{
return writeChar(buf, 0, ::strlen(buf));
}
-
-long
+
+off_t
File_class::size() const
{
return File_class::size(m_file);
@@ -196,14 +195,5 @@
int
File_class::flush() const
{
-#if defined NDB_OSE || defined NDB_SOFTOSE
- ::fflush(m_file);
- return ::fsync(::fileno(m_file));
-#else
- return 0;
-#endif
+ return ::fflush(m_file);;
}
-
-//
-// PRIVATE
-//
--- 1.49/storage/ndb/tools/restore/restore_main.cpp 2006-12-01 10:48:48 +08:00
+++ 1.50/storage/ndb/tools/restore/restore_main.cpp 2006-12-01 10:48:48 +08:00
@@ -567,6 +567,15 @@
err << metaData[i]->getTableName() << " ... Exiting " << endl;
exitHandler(NDBT_FAILED);
}
+ } else {
+ for(Uint32 j= 0; j < g_consumers.size(); j++)
+ if (!g_consumers[j]->createSystable(* metaData[i]))
+ {
+ err << "Restore: Failed to restore system table: ";
+ err << metaData[i]->getTableName() << " ... Exiting " << endl;
+ exitHandler(NDBT_FAILED);
+ }
+
}
}
debug << "Close tables" << endl;
--- 1.33/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp 2006-12-01 10:48:48 +08:00
+++ 1.34/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp 2006-12-01 10:48:48 +08:00
@@ -720,6 +720,7 @@
// Do nothing
break;
}
+ globalSignalLoggers.flushSignalLog();
}
#endif
--- 1.22/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp 2006-12-01 10:48:48 +08:00
+++ 1.23/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp 2006-12-01 10:48:48 +08:00
@@ -52,7 +52,8 @@
page8 = (Page8*)allocRecord("Page8",
sizeof(Page8),
cpagesize,
- false);
+ false,
+ CFG_DB_INDEX_MEM);
operationrec = (Operationrec*)allocRecord("Operationrec",
sizeof(Operationrec),
--- 1.31/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp 2006-12-01 10:48:48 +08:00
+++ 1.32/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp 2006-12-01 10:48:48 +08:00
@@ -311,7 +311,7 @@
c_storedProcPool.setSize(noOfStoredProc);
c_buildIndexPool.setSize(c_noOfBuildIndexRec);
- c_triggerPool.setSize(noOfTriggers);
+ c_triggerPool.setSize(noOfTriggers, false, true, true, CFG_DB_NO_TRIGGERS);
c_extent_hash.setSize(1024); // 4k
@@ -343,6 +343,7 @@
{
unsigned i;
Uint32 tmp;
+ Uint32 tmp1 = 0;
const ndb_mgm_configuration_iterator * p =
m_ctx.m_config.getOwnConfigIterator();
ndbrequire(p != 0);
@@ -350,7 +351,7 @@
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE, &tmp));
// Records with dynamic sizes
- Page* ptr =(Page*)allocRecord("Page", sizeof(Page), tmp, false);
+ Page* ptr =(Page*)allocRecord("Page", sizeof(Page), tmp, false, CFG_DB_DATA_MEM);
c_page_pool.set(ptr, tmp);
attrbufrec = (Attrbufrec*)allocRecord("Attrbufrec",
@@ -374,7 +375,9 @@
cnoOfTabDescrRec);
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_OP_RECS, &tmp));
- c_operation_pool.setSize(tmp);
+ ndb_mgm_get_int_parameter(p, CFG_DB_NO_LOCAL_OPS, &tmp1);
+ c_operation_pool.setSize(tmp, false, true, true,
+ tmp1 == 0 ? CFG_DB_NO_OPS : CFG_DB_NO_LOCAL_OPS);
pageRange = (PageRange*)allocRecord("PageRange",
sizeof(PageRange),
--- 1.34/storage/ndb/src/kernel/vm/SimulatedBlock.cpp 2006-12-01 10:48:48 +08:00
+++ 1.35/storage/ndb/src/kernel/vm/SimulatedBlock.cpp 2006-12-01 10:48:48 +08:00
@@ -1940,6 +1940,7 @@
{
jam();
Uint32 len;
+ LINT_INIT(len);
switch(array){
case NDB_ARRAYTYPE_SHORT_VAR:
len = 1 + srcPtr[0];
--- 1.79/storage/ndb/src/mgmsrv/Services.cpp 2006-12-01 10:48:48 +08:00
+++ 1.80/storage/ndb/src/mgmsrv/Services.cpp 2006-12-01 10:48:48 +08:00
@@ -1352,7 +1352,7 @@
if (EventLoggerBase::event_lookup(eventType,cat,threshold,severity,textF))
DBUG_VOID_RETURN;
- char m_text[256];
+ char m_text[512];
EventLogger::getText(m_text, sizeof(m_text),
textF, theData, nodeId);
@@ -1368,6 +1368,15 @@
if (ndb_logevent_body[i].index_fn)
val= (*(ndb_logevent_body[i].index_fn))(val);
str.appfmt("%s=%d\n",ndb_logevent_body[i].token, val);
+ if(strcmp(ndb_logevent_body[i].token,"error") == 0)
+ {
+ int m_text_len= strlen(m_text);
+ if(sizeof(m_text)-m_text_len-3 > 0)
+ {
+ BaseString::snprintf(m_text+m_text_len, 4 , " - ");
+ ndb_error_string(val, m_text+(m_text_len+3), sizeof(m_text)-m_text_len-3);
+ }
+ }
}
Vector<NDB_SOCKET_TYPE> copy;
--- 1.369/sql/ha_ndbcluster.cc 2006-12-01 10:48:48 +08:00
+++ 1.370/sql/ha_ndbcluster.cc 2006-12-01 10:48:48 +08:00
@@ -4825,10 +4825,18 @@
}
if (info->store_on_disk)
+ {
if (info->tablespace)
tab.setTablespace(info->tablespace);
else
tab.setTablespace("DEFAULT-TS");
+ }
+ else if (info->tablespace)
+ {
+ tab.setTablespace(info->tablespace);
+ info->store_on_disk = true; //if use tablespace, that also means store on disk
+ }
+
// No primary key, create shadow key as 64 bit, auto increment
if (form->s->primary_key == MAX_KEY)
{
@@ -6537,6 +6545,23 @@
hash_free(&ok_tables);
hash_free(&ndb_tables);
+
+ // Delete schema file from files
+ if (!strcmp(db, NDB_REP_DB))
+ {
+ uint count = 0;
+ while (count++ < files->elements)
+ {
+ file_name = (char *)files->pop();
+ if (!strcmp(file_name, NDB_SCHEMA_TABLE))
+ {
+ DBUG_PRINT("info", ("skip %s.%s table, it should be hidden to user",
+ NDB_REP_DB, NDB_SCHEMA_TABLE));
+ continue;
+ }
+ files->push_back(file_name);
+ }
+ }
} // extra bracket to avoid gcc 2.95.3 warning
DBUG_RETURN(0);
}
--- 1.156/sql/sql_repl.cc 2006-12-01 10:48:48 +08:00
+++ 1.157/sql/sql_repl.cc 2006-12-01 10:48:48 +08:00
@@ -432,6 +432,12 @@
goto err;
}
packet->set("\0", 1, &my_charset_bin);
+ /*
+ Adding MAX_LOG_EVENT_HEADER_LEN, since a binlog event can become
+ this larger than the corresponding packet (query) sent
+ from client to master.
+ */
+ thd->variables.max_allowed_packet+= MAX_LOG_EVENT_HEADER;
/*
We can set log_lock now, it does not move (it's a member of
@@ -806,7 +812,7 @@
sizeof(mi->rli.until_log_name)-1);
}
else
- clear_until_condition(&mi->rli);
+ mi->rli.clear_until_condition();
if (mi->rli.until_condition != RELAY_LOG_INFO::UNTIL_NONE)
{
@@ -979,8 +985,8 @@
Reset errors (the idea is that we forget about the
old master).
*/
- clear_slave_error(&mi->rli);
- clear_until_condition(&mi->rli);
+ mi->rli.clear_slave_error();
+ mi->rli.clear_until_condition();
// close master_info_file, relay_log_info_file, set mi->inited=rli->inited=0
end_master_info(mi);
@@ -1106,7 +1112,7 @@
{
mi->master_log_pos= lex_mi->pos;
}
- DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos));
+ DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
if (lex_mi->host)
strmake(mi->host, lex_mi->host, sizeof(mi->host)-1);
@@ -1223,7 +1229,7 @@
}
}
mi->rli.group_master_log_pos = mi->master_log_pos;
- DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos));
+ DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
/*
Coordinates in rli were spoilt by the 'if (need_relay_log_purge)' block,
@@ -1245,8 +1251,8 @@
pthread_mutex_lock(&mi->rli.data_lock);
mi->rli.abort_pos_wait++; /* for MASTER_POS_WAIT() to abort */
/* Clear the errors, for a clean start */
- clear_slave_error(&mi->rli);
- clear_until_condition(&mi->rli);
+ mi->rli.clear_slave_error();
+ mi->rli.clear_until_condition();
/*
If we don't write new coordinates to disk now, then old will remain in
relay-log.info until START SLAVE is issued; but if mysqld is shutdown
--- 1.37/storage/ndb/tools/restore/consumer_restore.cpp 2006-12-01 10:48:48 +08:00
+++ 1.38/storage/ndb/tools/restore/consumer_restore.cpp 2006-12-01 10:48:48 +08:00
@@ -494,7 +494,7 @@
NdbDictionary::Tablespace curr = dict->getTablespace(old.getName());
NdbError errobj = dict->getNdbError();
- if(errobj.classification == ndberror_cl_none)
+ if ((int) errobj.classification == (int) ndberror_cl_none)
{
NdbDictionary::Tablespace* currptr = new NdbDictionary::Tablespace(curr);
NdbDictionary::Tablespace * null = 0;
@@ -533,7 +533,7 @@
NdbDictionary::LogfileGroup curr = dict->getLogfileGroup(old.getName());
NdbError errobj = dict->getNdbError();
- if(errobj.classification == ndberror_cl_none)
+ if ((int) errobj.classification == (int) ndberror_cl_none)
{
NdbDictionary::LogfileGroup* currptr =
new NdbDictionary::LogfileGroup(curr);
@@ -707,7 +707,7 @@
return true;
const NdbTableImpl & tmptab = NdbTableImpl::getImpl(* table.m_dictTable);
- if(tmptab.m_indexType != NdbDictionary::Index::Undefined){
+ if ((int) tmptab.m_indexType != (int) NdbDictionary::Index::Undefined){
m_indexes.push_back(table.m_dictTable);
return true;
}
| Thread |
|---|
| • bk commit into 5.1 tree (gni:1.2337) | gni | 1 Dec |