Commit 6d975ea2 authored by unknown's avatar unknown

Merge lthalmann@bk-internal.mysql.com:/home/bk/mysql-5.1-new

into  mysql.com:/users/lthalmann/bkroot/mysql-5.1-new

parents a5fda39d dddd8a65
...@@ -124,6 +124,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqld", "sql\mysqld.vcproj ...@@ -124,6 +124,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqld", "sql\mysqld.vcproj
{13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD} = {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD} {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD} = {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}
{DB28DE80-837F-4497-9AA9-CC0A20584C98} = {DB28DE80-837F-4497-9AA9-CC0A20584C98} {DB28DE80-837F-4497-9AA9-CC0A20584C98} = {DB28DE80-837F-4497-9AA9-CC0A20584C98}
{BFCDA391-91A5-45F5-A14F-1011F8424113} = {BFCDA391-91A5-45F5-A14F-1011F8424113}
{433BCD9B-15C5-4B11-B8BE-825EA98EACE6} = {433BCD9B-15C5-4B11-B8BE-825EA98EACE6} {433BCD9B-15C5-4B11-B8BE-825EA98EACE6} = {433BCD9B-15C5-4B11-B8BE-825EA98EACE6}
{8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF}
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B} = {F74653C4-8003-4A79-8F53-FC69E0AD7A9B} {F74653C4-8003-4A79-8F53-FC69E0AD7A9B} = {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}
...@@ -302,6 +303,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example", "storage\example\ ...@@ -302,6 +303,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example", "storage\example\
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fulltext", "plugin\fulltext\fulltext.vcproj", "{BFCDA391-91A5-45F5-A14F-1011F8424113}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfiguration) = preSolution
classic = classic classic = classic
...@@ -1778,6 +1783,42 @@ Global ...@@ -1778,6 +1783,42 @@ Global
{6B6812DB-636E-465D-B53D-5012F237E539}.TLS.Build.0 = TLS|Win32 {6B6812DB-636E-465D-B53D-5012F237E539}.TLS.Build.0 = TLS|Win32
{6B6812DB-636E-465D-B53D-5012F237E539}.TLS_DEBUG.ActiveCfg = TLS_DEBUG|Win32 {6B6812DB-636E-465D-B53D-5012F237E539}.TLS_DEBUG.ActiveCfg = TLS_DEBUG|Win32
{6B6812DB-636E-465D-B53D-5012F237E539}.TLS_DEBUG.Build.0 = TLS_DEBUG|Win32 {6B6812DB-636E-465D-B53D-5012F237E539}.TLS_DEBUG.Build.0 = TLS_DEBUG|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.classic.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.classic.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.classic nt.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.classic nt.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Debug.ActiveCfg = Debug|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Debug.Build.0 = Debug|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Embedded_Classic.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Embedded_Classic.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Embedded_Debug.ActiveCfg = Debug|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Embedded_Debug.Build.0 = Debug|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Embedded_Pro.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Embedded_Pro.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Embedded_ProGPL.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Embedded_ProGPL.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Embedded_Release.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Embedded_Release.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Max.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Max.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Max nt.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Max nt.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.nt.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.nt.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.pro.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.pro.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.pro gpl.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.pro gpl.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.pro gpl nt.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.pro gpl nt.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.pro nt.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.pro nt.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Release.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.Release.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.TLS.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.TLS.Build.0 = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.TLS_DEBUG.ActiveCfg = Release|Win32
{BFCDA391-91A5-45F5-A14F-1011F8424113}.TLS_DEBUG.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection
......
LIBRARY fulltext
EXPORTS
_mysql_plugin_interface_version_
_mysql_plugin_declarations_
\ No newline at end of file
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="fulltext"
ProjectGUID="{BFCDA391-91A5-45F5-A14F-1011F8424113}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FULLTEXT_EXPORTS"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="../../client_debug/fulltext.dll"
LinkIncremental="2"
ModuleDefinitionFile="fulltext.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/fulltext.pdb"
SubSystem="2"
ImportLibrary="$(OutDir)/fulltext.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../../include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FULLTEXT_EXPORTS"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="../../client_release/fulltext.dll"
LinkIncremental="1"
ModuleDefinitionFile="fulltext.def"
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/fulltext.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\fulltext.def">
</File>
<File
RelativePath=".\plugin_example.c">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
...@@ -5813,7 +5813,11 @@ static bool ndbcluster_init() ...@@ -5813,7 +5813,11 @@ static bool ndbcluster_init()
opt_ndbcluster_connectstring)); opt_ndbcluster_connectstring));
goto ndbcluster_init_error; goto ndbcluster_init_error;
} }
{
char buf[128];
my_snprintf(buf, sizeof(buf), "mysqld --server-id=%d", server_id);
g_ndb_cluster_connection->set_name(buf);
}
g_ndb_cluster_connection->set_optimized_node_selection g_ndb_cluster_connection->set_optimized_node_selection
(opt_ndb_optimized_node_selection); (opt_ndb_optimized_node_selection);
......
...@@ -468,6 +468,14 @@ extern "C" { ...@@ -468,6 +468,14 @@ extern "C" {
*/ */
void ndb_mgm_destroy_handle(NdbMgmHandle * handle); void ndb_mgm_destroy_handle(NdbMgmHandle * handle);
/**
* Set a name of the handle. Name is reported in cluster log.
*
* @param handle Management handle
* @param name Name
*/
void ndb_mgm_set_name(NdbMgmHandle handle, const char *name);
/** @} *********************************************************************/ /** @} *********************************************************************/
/** /**
* @name Functions: Connect/Disconnect Management Server * @name Functions: Connect/Disconnect Management Server
......
...@@ -54,6 +54,14 @@ public: ...@@ -54,6 +54,14 @@ public:
Ndb_cluster_connection(const char * connectstring = 0); Ndb_cluster_connection(const char * connectstring = 0);
~Ndb_cluster_connection(); ~Ndb_cluster_connection();
/**
* Set a name on the connection, which will be reported in cluster log
*
* @param name
*
*/
void set_name(const char *name);
/** /**
* Connect to a cluster management server * Connect to a cluster management server
* *
......
...@@ -3027,7 +3027,7 @@ void Dbtc::tckeyreq050Lab(Signal* signal) ...@@ -3027,7 +3027,7 @@ void Dbtc::tckeyreq050Lab(Signal* signal)
/* NODE IF POSSIBLE TO AVOID UNNECESSARY COMMUNICATION */ /* NODE IF POSSIBLE TO AVOID UNNECESSARY COMMUNICATION */
/* WITH SIMPLE READS. */ /* WITH SIMPLE READS. */
/*-------------------------------------------------------------*/ /*-------------------------------------------------------------*/
arrGuard(tnoOfBackup, 4); arrGuard(tnoOfBackup, MAX_REPLICAS);
UintR Tindex; UintR Tindex;
UintR TownNode = cownNodeid; UintR TownNode = cownNodeid;
for (Tindex = 1; Tindex <= tnoOfBackup; Tindex++) { for (Tindex = 1; Tindex <= tnoOfBackup; Tindex++) {
...@@ -6306,7 +6306,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr) ...@@ -6306,7 +6306,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
jam(); jam();
tcConnectptr.i = apiConnectptr.p->currentTcConnect; tcConnectptr.i = apiConnectptr.p->currentTcConnect;
ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord); ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord);
arrGuard(apiConnectptr.p->currentReplicaNo, 4); arrGuard(apiConnectptr.p->currentReplicaNo, MAX_REPLICAS);
hostptr.i = tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo]; hostptr.i = tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo];
ptrCheckGuard(hostptr, chostFilesize, hostRecord); ptrCheckGuard(hostptr, chostFilesize, hostRecord);
if (hostptr.p->hostStatus == HS_ALIVE) { if (hostptr.p->hostStatus == HS_ALIVE) {
...@@ -6332,7 +6332,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr) ...@@ -6332,7 +6332,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
jam(); jam();
tcConnectptr.i = apiConnectptr.p->currentTcConnect; tcConnectptr.i = apiConnectptr.p->currentTcConnect;
ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord); ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord);
arrGuard(apiConnectptr.p->currentReplicaNo, 4); arrGuard(apiConnectptr.p->currentReplicaNo, MAX_REPLICAS);
hostptr.i = tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo]; hostptr.i = tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo];
ptrCheckGuard(hostptr, chostFilesize, hostRecord); ptrCheckGuard(hostptr, chostFilesize, hostRecord);
if (hostptr.p->hostStatus == HS_ALIVE) { if (hostptr.p->hostStatus == HS_ALIVE) {
...@@ -6358,7 +6358,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr) ...@@ -6358,7 +6358,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
jam(); jam();
tcConnectptr.i = apiConnectptr.p->currentTcConnect; tcConnectptr.i = apiConnectptr.p->currentTcConnect;
ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord); ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord);
arrGuard(apiConnectptr.p->currentReplicaNo, 4); arrGuard(apiConnectptr.p->currentReplicaNo, MAX_REPLICAS);
hostptr.i = tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo]; hostptr.i = tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo];
ptrCheckGuard(hostptr, chostFilesize, hostRecord); ptrCheckGuard(hostptr, chostFilesize, hostRecord);
if (hostptr.p->hostStatus == HS_ALIVE) { if (hostptr.p->hostStatus == HS_ALIVE) {
...@@ -6495,7 +6495,7 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck) ...@@ -6495,7 +6495,7 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck)
// in time to the ABORT signal we will declare it as dead. // in time to the ABORT signal we will declare it as dead.
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
UintR Ti = 0; UintR Ti = 0;
arrGuard(tcConnectptr.p->noOfNodes, 4); arrGuard(tcConnectptr.p->noOfNodes, MAX_REPLICAS+1);
for (Ti = 0; Ti < tcConnectptr.p->noOfNodes; Ti++) { for (Ti = 0; Ti < tcConnectptr.p->noOfNodes; Ti++) {
jam(); jam();
if (tcConnectptr.p->tcNodedata[Ti] != 0) { if (tcConnectptr.p->tcNodedata[Ti] != 0) {
...@@ -7552,7 +7552,7 @@ void Dbtc::execABORTCONF(Signal* signal) ...@@ -7552,7 +7552,7 @@ void Dbtc::execABORTCONF(Signal* signal)
warningReport(signal, 18); warningReport(signal, 18);
return; return;
}//if }//if
arrGuard(apiConnectptr.p->currentReplicaNo, 4); arrGuard(apiConnectptr.p->currentReplicaNo, MAX_REPLICAS);
if (tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo] != if (tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo] !=
tnodeid) { tnodeid) {
warningReport(signal, 19); warningReport(signal, 19);
...@@ -7568,7 +7568,7 @@ void Dbtc::toAbortHandlingLab(Signal* signal) ...@@ -7568,7 +7568,7 @@ void Dbtc::toAbortHandlingLab(Signal* signal)
do { do {
if (tcurrentReplicaNo != (Uint8)Z8NIL) { if (tcurrentReplicaNo != (Uint8)Z8NIL) {
jam(); jam();
arrGuard(tcurrentReplicaNo, 4); arrGuard(tcurrentReplicaNo, MAX_REPLICAS);
const LqhTransConf::OperationStatus stat = const LqhTransConf::OperationStatus stat =
(LqhTransConf::OperationStatus) (LqhTransConf::OperationStatus)
tcConnectptr.p->failData[tcurrentReplicaNo]; tcConnectptr.p->failData[tcurrentReplicaNo];
...@@ -7702,7 +7702,7 @@ void Dbtc::execCOMMITCONF(Signal* signal) ...@@ -7702,7 +7702,7 @@ void Dbtc::execCOMMITCONF(Signal* signal)
warningReport(signal, 10); warningReport(signal, 10);
return; return;
}//if }//if
arrGuard(apiConnectptr.p->currentReplicaNo, 4); arrGuard(apiConnectptr.p->currentReplicaNo, MAX_REPLICAS);
if (tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo] != if (tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo] !=
tnodeid) { tnodeid) {
warningReport(signal, 11); warningReport(signal, 11);
...@@ -7722,7 +7722,7 @@ void Dbtc::toCommitHandlingLab(Signal* signal) ...@@ -7722,7 +7722,7 @@ void Dbtc::toCommitHandlingLab(Signal* signal)
do { do {
if (tcurrentReplicaNo != (Uint8)Z8NIL) { if (tcurrentReplicaNo != (Uint8)Z8NIL) {
jam(); jam();
arrGuard(tcurrentReplicaNo, 4); arrGuard(tcurrentReplicaNo, MAX_REPLICAS);
switch (tcConnectptr.p->failData[tcurrentReplicaNo]) { switch (tcConnectptr.p->failData[tcurrentReplicaNo]) {
case LqhTransConf::InvalidStatus: case LqhTransConf::InvalidStatus:
jam(); jam();
...@@ -7847,7 +7847,7 @@ void Dbtc::execCOMPLETECONF(Signal* signal) ...@@ -7847,7 +7847,7 @@ void Dbtc::execCOMPLETECONF(Signal* signal)
warningReport(signal, 14); warningReport(signal, 14);
return; return;
}//if }//if
arrGuard(apiConnectptr.p->currentReplicaNo, 4); arrGuard(apiConnectptr.p->currentReplicaNo, MAX_REPLICAS);
if (tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo] != if (tcConnectptr.p->tcNodedata[apiConnectptr.p->currentReplicaNo] !=
tnodeid) { tnodeid) {
warningReport(signal, 15); warningReport(signal, 15);
...@@ -7867,7 +7867,7 @@ void Dbtc::toCompleteHandlingLab(Signal* signal) ...@@ -7867,7 +7867,7 @@ void Dbtc::toCompleteHandlingLab(Signal* signal)
do { do {
if (tcurrentReplicaNo != (Uint8)Z8NIL) { if (tcurrentReplicaNo != (Uint8)Z8NIL) {
jam(); jam();
arrGuard(tcurrentReplicaNo, 4); arrGuard(tcurrentReplicaNo, MAX_REPLICAS);
switch (tcConnectptr.p->failData[tcurrentReplicaNo]) { switch (tcConnectptr.p->failData[tcurrentReplicaNo]) {
case LqhTransConf::InvalidStatus: case LqhTransConf::InvalidStatus:
jam(); jam();
...@@ -8156,6 +8156,7 @@ void Dbtc::setupFailData(Signal* signal) ...@@ -8156,6 +8156,7 @@ void Dbtc::setupFailData(Signal* signal)
case OS_PREPARED: case OS_PREPARED:
case OS_COMMITTING: case OS_COMMITTING:
jam(); jam();
arrGuard(tcConnectptr.p->lastReplicaNo, MAX_REPLICAS);
for (tindex = 0; tindex <= tcConnectptr.p->lastReplicaNo; tindex++) { for (tindex = 0; tindex <= tcConnectptr.p->lastReplicaNo; tindex++) {
jam(); jam();
/*------------------------------------------------------------------- /*-------------------------------------------------------------------
...@@ -8163,13 +8164,13 @@ void Dbtc::setupFailData(Signal* signal) ...@@ -8163,13 +8164,13 @@ void Dbtc::setupFailData(Signal* signal)
* IN THIS CASE ALL LQH'S ARE PREPARED AND WAITING FOR * IN THIS CASE ALL LQH'S ARE PREPARED AND WAITING FOR
* COMMIT/ABORT DECISION. * COMMIT/ABORT DECISION.
*------------------------------------------------------------------*/ *------------------------------------------------------------------*/
arrGuard(tindex, 4);
tcConnectptr.p->failData[tindex] = LqhTransConf::Prepared; tcConnectptr.p->failData[tindex] = LqhTransConf::Prepared;
}//for }//for
break; break;
case OS_COMMITTED: case OS_COMMITTED:
case OS_COMPLETING: case OS_COMPLETING:
jam(); jam();
arrGuard(tcConnectptr.p->lastReplicaNo, MAX_REPLICAS);
for (tindex = 0; tindex <= tcConnectptr.p->lastReplicaNo; tindex++) { for (tindex = 0; tindex <= tcConnectptr.p->lastReplicaNo; tindex++) {
jam(); jam();
/*------------------------------------------------------------------- /*-------------------------------------------------------------------
...@@ -8177,19 +8178,18 @@ void Dbtc::setupFailData(Signal* signal) ...@@ -8177,19 +8178,18 @@ void Dbtc::setupFailData(Signal* signal)
* IN THIS CASE ALL LQH'S ARE COMMITTED AND WAITING FOR * IN THIS CASE ALL LQH'S ARE COMMITTED AND WAITING FOR
* COMPLETE MESSAGE. * COMPLETE MESSAGE.
*------------------------------------------------------------------*/ *------------------------------------------------------------------*/
arrGuard(tindex, 4);
tcConnectptr.p->failData[tindex] = LqhTransConf::Committed; tcConnectptr.p->failData[tindex] = LqhTransConf::Committed;
}//for }//for
break; break;
case OS_COMPLETED: case OS_COMPLETED:
jam(); jam();
arrGuard(tcConnectptr.p->lastReplicaNo, MAX_REPLICAS);
for (tindex = 0; tindex <= tcConnectptr.p->lastReplicaNo; tindex++) { for (tindex = 0; tindex <= tcConnectptr.p->lastReplicaNo; tindex++) {
jam(); jam();
/*------------------------------------------------------------------- /*-------------------------------------------------------------------
* KEYDATA IS USED TO KEEP AN INDICATION OF STATE IN LQH. * KEYDATA IS USED TO KEEP AN INDICATION OF STATE IN LQH.
* IN THIS CASE ALL LQH'S ARE COMPLETED. * IN THIS CASE ALL LQH'S ARE COMPLETED.
*-------------------------------------------------------------------*/ *-------------------------------------------------------------------*/
arrGuard(tindex, 4);
tcConnectptr.p->failData[tindex] = LqhTransConf::InvalidStatus; tcConnectptr.p->failData[tindex] = LqhTransConf::InvalidStatus;
}//for }//for
break; break;
......
...@@ -102,6 +102,7 @@ struct ndb_mgm_handle { ...@@ -102,6 +102,7 @@ struct ndb_mgm_handle {
FILE* logfile; FILE* logfile;
#endif #endif
FILE *errstream; FILE *errstream;
char *m_name;
}; };
#define SET_ERROR(h, e, s) setError(h, e, __LINE__, s) #define SET_ERROR(h, e, s) setError(h, e, __LINE__, s)
...@@ -156,6 +157,7 @@ ndb_mgm_create_handle() ...@@ -156,6 +157,7 @@ ndb_mgm_create_handle()
h->write_timeout = 100; h->write_timeout = 100;
h->cfg_i = -1; h->cfg_i = -1;
h->errstream = stdout; h->errstream = stdout;
h->m_name = 0;
strncpy(h->last_error_desc, "No error", NDB_MGM_MAX_ERR_DESC_SIZE); strncpy(h->last_error_desc, "No error", NDB_MGM_MAX_ERR_DESC_SIZE);
...@@ -170,6 +172,14 @@ ndb_mgm_create_handle() ...@@ -170,6 +172,14 @@ ndb_mgm_create_handle()
DBUG_RETURN(h); DBUG_RETURN(h);
} }
extern "C"
void
ndb_mgm_set_name(NdbMgmHandle handle, const char *name)
{
my_free(handle->m_name, MYF(MY_ALLOW_ZERO_PTR));
handle->m_name= my_strdup(name, MYF(MY_WME));
}
extern "C" extern "C"
int int
ndb_mgm_set_connectstring(NdbMgmHandle handle, const char * mgmsrv) ndb_mgm_set_connectstring(NdbMgmHandle handle, const char * mgmsrv)
...@@ -216,6 +226,7 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle) ...@@ -216,6 +226,7 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle)
} }
#endif #endif
(*handle)->cfg.~LocalConfig(); (*handle)->cfg.~LocalConfig();
my_free((*handle)->m_name, MYF(MY_ALLOW_ZERO_PTR));
my_free((char*)* handle,MYF(MY_ALLOW_ZERO_PTR)); my_free((char*)* handle,MYF(MY_ALLOW_ZERO_PTR));
* handle = 0; * handle = 0;
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
...@@ -1875,6 +1886,8 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) ...@@ -1875,6 +1886,8 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype)
args.put("password", "mysqld"); args.put("password", "mysqld");
args.put("public key", "a public key"); args.put("public key", "a public key");
args.put("endian", (endian_check.c[sizeof(long)-1])?"big":"little"); args.put("endian", (endian_check.c[sizeof(long)-1])?"big":"little");
if (handle->m_name)
args.put("name", handle->m_name);
const ParserRow<ParserDummy> reply[]= { const ParserRow<ParserDummy> reply[]= {
MGM_CMD("get nodeid reply", NULL, ""), MGM_CMD("get nodeid reply", NULL, ""),
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <base64.h> #include <base64.h>
extern bool g_StopServer; extern bool g_StopServer;
extern EventLogger g_eventLogger;
static const unsigned int MAX_READ_TIMEOUT = 1000 ; static const unsigned int MAX_READ_TIMEOUT = 1000 ;
static const unsigned int MAX_WRITE_TIMEOUT = 100 ; static const unsigned int MAX_WRITE_TIMEOUT = 100 ;
...@@ -135,6 +136,7 @@ ParserRow<MgmApiSession> commands[] = { ...@@ -135,6 +136,7 @@ ParserRow<MgmApiSession> commands[] = {
MGM_ARG("password", String, Mandatory, "Password"), MGM_ARG("password", String, Mandatory, "Password"),
MGM_ARG("public key", String, Mandatory, "Public key"), MGM_ARG("public key", String, Mandatory, "Public key"),
MGM_ARG("endian", String, Optional, "Endianness"), MGM_ARG("endian", String, Optional, "Endianness"),
MGM_ARG("name", String, Optional, "Name of connection"),
MGM_CMD("get version", &MgmApiSession::getVersion, ""), MGM_CMD("get version", &MgmApiSession::getVersion, ""),
...@@ -411,6 +413,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &, ...@@ -411,6 +413,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
const char * password; const char * password;
const char * public_key; const char * public_key;
const char * endian= NULL; const char * endian= NULL;
const char * name= NULL;
union { long l; char c[sizeof(long)]; } endian_check; union { long l; char c[sizeof(long)]; } endian_check;
args.get("version", &version); args.get("version", &version);
...@@ -421,6 +424,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &, ...@@ -421,6 +424,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
args.get("password", &password); args.get("password", &password);
args.get("public key", &public_key); args.get("public key", &public_key);
args.get("endian", &endian); args.get("endian", &endian);
args.get("name", &name);
endian_check.l = 1; endian_check.l = 1;
if(endian if(endian
...@@ -489,6 +493,9 @@ MgmApiSession::get_nodeid(Parser_t::Context &, ...@@ -489,6 +493,9 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
m_output->println(""); m_output->println("");
m_allocated_resources->reserve_node(tmp); m_allocated_resources->reserve_node(tmp);
if (name)
g_eventLogger.info("Node %d: %s", tmp, name);
return; return;
} }
......
...@@ -262,7 +262,8 @@ Ndb_cluster_connection::wait_until_ready(int timeout, ...@@ -262,7 +262,8 @@ Ndb_cluster_connection::wait_until_ready(int timeout,
Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char * Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char *
connect_string) connect_string)
: Ndb_cluster_connection(*this), : Ndb_cluster_connection(*this),
m_optimized_node_selection(1) m_optimized_node_selection(1),
m_name(0)
{ {
DBUG_ENTER("Ndb_cluster_connection"); DBUG_ENTER("Ndb_cluster_connection");
DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%x", this)); DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%x", this));
...@@ -287,7 +288,11 @@ Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char * ...@@ -287,7 +288,11 @@ Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char *
delete m_config_retriever; delete m_config_retriever;
m_config_retriever= 0; m_config_retriever= 0;
} }
if (m_name)
{
NdbMgmHandle h= m_config_retriever->get_mgmHandle();
ndb_mgm_set_name(h, m_name);
}
m_transporter_facade= m_transporter_facade=
TransporterFacade::theFacadeInstance= TransporterFacade::theFacadeInstance=
new TransporterFacade(); new TransporterFacade();
...@@ -326,9 +331,25 @@ Ndb_cluster_connection_impl::~Ndb_cluster_connection_impl() ...@@ -326,9 +331,25 @@ Ndb_cluster_connection_impl::~Ndb_cluster_connection_impl()
ndb_print_state_mutex= NULL; ndb_print_state_mutex= NULL;
} }
#endif #endif
if (m_name)
free(m_name);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
void
Ndb_cluster_connection_impl::set_name(const char *name)
{
if (m_name)
free(m_name);
m_name= strdup(name);
if (m_config_retriever && m_name)
{
NdbMgmHandle h= m_config_retriever->get_mgmHandle();
ndb_mgm_set_name(h, m_name);
}
}
void void
Ndb_cluster_connection_impl::init_nodes_vector(Uint32 nodeid, Ndb_cluster_connection_impl::init_nodes_vector(Uint32 nodeid,
const ndb_mgm_configuration const ndb_mgm_configuration
...@@ -480,6 +501,11 @@ Ndb_cluster_connection_impl::do_test() ...@@ -480,6 +501,11 @@ Ndb_cluster_connection_impl::do_test()
delete [] nodes; delete [] nodes;
} }
void Ndb_cluster_connection::set_name(const char *name)
{
m_impl.set_name(name);
}
int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds,
int verbose) int verbose)
{ {
......
...@@ -62,6 +62,7 @@ private: ...@@ -62,6 +62,7 @@ private:
Vector<Node> m_all_nodes; Vector<Node> m_all_nodes;
void init_nodes_vector(Uint32 nodeid, const ndb_mgm_configuration &config); void init_nodes_vector(Uint32 nodeid, const ndb_mgm_configuration &config);
void connect_thread(); void connect_thread();
void set_name(const char *name);
TransporterFacade *m_transporter_facade; TransporterFacade *m_transporter_facade;
ConfigRetriever *m_config_retriever; ConfigRetriever *m_config_retriever;
...@@ -69,6 +70,7 @@ private: ...@@ -69,6 +70,7 @@ private:
int (*m_connect_callback)(void); int (*m_connect_callback)(void);
int m_optimized_node_selection; int m_optimized_node_selection;
char *m_name;
}; };
#endif #endif
...@@ -30,6 +30,8 @@ static Uint32 get_part_id(const NdbDictionary::Table *table, ...@@ -30,6 +30,8 @@ static Uint32 get_part_id(const NdbDictionary::Table *table,
Uint32 hash_value); Uint32 hash_value);
extern const char * g_connect_string; extern const char * g_connect_string;
extern BaseString g_options;
bool bool
BackupRestore::init() BackupRestore::init()
{ {
...@@ -39,6 +41,7 @@ BackupRestore::init() ...@@ -39,6 +41,7 @@ BackupRestore::init()
return true; return true;
m_cluster_connection = new Ndb_cluster_connection(g_connect_string); m_cluster_connection = new Ndb_cluster_connection(g_connect_string);
m_cluster_connection->set_name(g_options.c_str());
if(m_cluster_connection->connect(12, 5, 1) != 0) if(m_cluster_connection->connect(12, 5, 1) != 0)
{ {
return false; return false;
......
...@@ -58,6 +58,7 @@ static int _print_log = 0; ...@@ -58,6 +58,7 @@ static int _print_log = 0;
static int _restore_data = 0; static int _restore_data = 0;
static int _restore_meta = 0; static int _restore_meta = 0;
static int _no_restore_disk = 0; static int _no_restore_disk = 0;
BaseString g_options("ndb_restore");
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
...@@ -450,6 +451,18 @@ main(int argc, char** argv) ...@@ -450,6 +451,18 @@ main(int argc, char** argv)
exitHandler(NDBT_FAILED); exitHandler(NDBT_FAILED);
} }
g_options.appfmt(" -b %d", ga_backupId);
g_options.appfmt(" -n %d", ga_nodeId);
if (_restore_meta)
g_options.appfmt(" -m");
if (_restore_data)
g_options.appfmt(" -r");
if (ga_restore_epoch)
g_options.appfmt(" -e");
if (_restore_disk)
g_options.appfmt(" -d");
g_options.appfmt(" -p %d", ga_nParallelism);
g_connect_string = opt_connect_str; g_connect_string = opt_connect_str;
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment