summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <tomas@whalegate.ndb.mysql.com>2007-09-12 14:01:51 +0200
committerunknown <tomas@whalegate.ndb.mysql.com>2007-09-12 14:01:51 +0200
commit345891d76b978ddf4ac4b56e2c8bf030b87bab81 (patch)
tree46edaab69cc56a1fbe85e64295b1fd28e9ac1709 /ndb
parent5f183053df1e7efe7f2399bb6dc9eaf4bc0634ca (diff)
parent46bca215c7a9bd7980819382f71f320b8008677f (diff)
downloadmariadb-git-345891d76b978ddf4ac4b56e2c8bf030b87bab81.tar.gz
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge mysql-test/Makefile.am: Auto merged sql/ha_ndbcluster.cc: Auto merged
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.cpp2
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp15
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.hpp3
-rw-r--r--ndb/tools/restore/Restore.cpp33
-rw-r--r--ndb/tools/restore/restore_main.cpp2
5 files changed, 47 insertions, 8 deletions
diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp
index 8abce4f9cc4..1036461d404 100644
--- a/ndb/src/mgmclient/CommandInterpreter.cpp
+++ b/ndb/src/mgmclient/CommandInterpreter.cpp
@@ -2148,7 +2148,7 @@ CommandInterpreter::executeRestart(Vector<BaseString> &command_list,
return -1;
}
- if (!nostart)
+ if (nostart)
ndbout_c("Shutting down nodes with \"-n, no start\" option, to subsequently start the nodes.");
result= ndb_mgm_restart3(m_mgmsrv, no_of_nodes, node_ids,
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 3fed04de26d..bf0c02714db 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -1220,7 +1220,8 @@ indexTypeMapping[] = {
int
NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
const Uint32 * data, Uint32 len,
- bool fullyQualifiedNames)
+ bool fullyQualifiedNames,
+ bool hostByteOrder)
{
DBUG_ENTER("NdbDictInterface::parseTableInfo");
@@ -1379,13 +1380,19 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
if(tableDesc.FragmentDataLen > 0)
{
- Uint32 replicaCount = tableDesc.FragmentData[0];
- Uint32 fragCount = tableDesc.FragmentData[1];
+ Uint16 replicaCount = tableDesc.FragmentData[0];
+ Uint16 fragCount = tableDesc.FragmentData[1];
+
+ if(hostByteOrder == false)
+ {
+ replicaCount = ((replicaCount & 0xFF00) >> 8) |((replicaCount & 0x00FF) << 8);
+ fragCount = ((fragCount & 0xFF00) >> 8) |((fragCount & 0x00FF) << 8);
+ }
impl->m_replicaCount = replicaCount;
impl->m_fragmentCount = fragCount;
- for(i = 0; i<(fragCount*replicaCount); i++)
+ for(i = 0; i<(Uint32) (fragCount*replicaCount); i++)
{
if (impl->m_fragments.push_back(tableDesc.FragmentData[i+2]))
{
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp
index 819de921235..a8757b69472 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp
@@ -262,7 +262,8 @@ public:
static int parseTableInfo(NdbTableImpl ** dst,
const Uint32 * data, Uint32 len,
- bool fullyQualifiedNames);
+ bool fullyQualifiedNames,
+ bool hostByteOrder = true);
static int create_index_obj_from_table(NdbIndexImpl ** dst,
NdbTableImpl* index_table,
diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp
index c07bfbc2bd4..b89d3e239c2 100644
--- a/ndb/tools/restore/Restore.cpp
+++ b/ndb/tools/restore/Restore.cpp
@@ -324,7 +324,11 @@ bool
RestoreMetaData::parseTableDescriptor(const Uint32 * data, Uint32 len)
{
NdbTableImpl* tableImpl = 0;
- int ret = NdbDictInterface::parseTableInfo(&tableImpl, data, len, false);
+ int ret = 0;
+ if(!m_hostByteOrder)
+ ret = NdbDictInterface::parseTableInfo(&tableImpl, data, len, false, false);
+ else
+ ret = NdbDictInterface::parseTableInfo(&tableImpl, data, len, false);
if (ret != 0) {
err << "parseTableInfo " << " failed" << endl;
@@ -478,6 +482,10 @@ RestoreDataIterator::getNextTuple(int & res)
attr_data->void_value = ptr;
attr_data->size = 4*sz;
+ if(!m_hostByteOrder
+ && attr_desc->m_column->getType() == NdbDictionary::Column::Timestamp)
+ attr_data->u_int32_value[0] = Twiddle32(attr_data->u_int32_value[0]);
+
if(!Twiddle(attr_desc, attr_data))
{
res = -1;
@@ -520,6 +528,29 @@ RestoreDataIterator::getNextTuple(int & res)
*/
const Uint32 arraySize = (4 * sz) / (attr_desc->size / 8);
assert(arraySize >= attr_desc->arraySize);
+
+ //convert the length of blob(v1) and text(v1)
+ if(!m_hostByteOrder
+ && (attr_desc->m_column->getType() == NdbDictionary::Column::Blob
+ || attr_desc->m_column->getType() == NdbDictionary::Column::Text))
+ {
+ char* p = (char*)&attr_data->u_int64_value[0];
+ Uint64 x;
+ memcpy(&x, p, sizeof(Uint64));
+ x = Twiddle64(x);
+ memcpy(p, &x, sizeof(Uint64));
+ }
+
+ if(!m_hostByteOrder
+ && attr_desc->m_column->getType() == NdbDictionary::Column::Datetime)
+ {
+ char* p = (char*)&attr_data->u_int64_value[0];
+ Uint64 x;
+ memcpy(&x, p, sizeof(Uint64));
+ x = Twiddle64(x);
+ memcpy(p, &x, sizeof(Uint64));
+ }
+
if(!Twiddle(attr_desc, attr_data, attr_desc->arraySize))
{
res = -1;
diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp
index 9ec59b9b4a6..9887869a0b3 100644
--- a/ndb/tools/restore/restore_main.cpp
+++ b/ndb/tools/restore/restore_main.cpp
@@ -112,7 +112,7 @@ static struct my_option my_long_options[] =
"(parallelism can be 1 to 1024)",
(gptr*) &ga_nParallelism, (gptr*) &ga_nParallelism, 0,
GET_INT, REQUIRED_ARG, 128, 1, 1024, 0, 1, 0 },
- { "print", OPT_PRINT, "Print data and log to stdout",
+ { "print", OPT_PRINT, "Print metadata, data and log to stdout",
(gptr*) &_print, (gptr*) &_print, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "print_data", OPT_PRINT_DATA, "Print data to stdout",