mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 11:27:39 +02:00
Merge lzhou@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb-bj
into dev3-63.(none):/home/zhl/mysql/mysql-5.0/bug29674
This commit is contained in:
commit
9b460fb47c
17 changed files with 429 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue