summaryrefslogtreecommitdiff
path: root/storage/ndb/src/ndbapi/NdbScanOperation.cpp
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2007-01-12 15:48:47 +0100
committerunknown <jonas@perch.ndb.mysql.com>2007-01-12 15:48:47 +0100
commit6226586c466891989fd35a7d129d632e597ec1e1 (patch)
treed3ebe54dec6a969063678a2fb0d64de410226d63 /storage/ndb/src/ndbapi/NdbScanOperation.cpp
parent7989949648cb5df8a81c4ce8e256b1e54886fb88 (diff)
downloadmariadb-git-6226586c466891989fd35a7d129d632e597ec1e1.tar.gz
ndb - bug#25587
fix not aligned or non 32-bit values in "smart" scan mysql-test/r/ndb_partition_key.result: testcase mysql-test/t/ndb_partition_key.test: ndb - bug storage/ndb/src/ndbapi/NdbScanOperation.cpp: Fix unaligned or non-32-bit values in "smart scan"
Diffstat (limited to 'storage/ndb/src/ndbapi/NdbScanOperation.cpp')
-rw-r--r--storage/ndb/src/ndbapi/NdbScanOperation.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/storage/ndb/src/ndbapi/NdbScanOperation.cpp b/storage/ndb/src/ndbapi/NdbScanOperation.cpp
index 3e2081b6018..75ad6306c69 100644
--- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp
+++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp
@@ -1188,25 +1188,31 @@ NdbIndexScanOperation::setBound(const NdbColumnImpl* tAttrInfo,
const bool nobytes = (len & 0x3) == 0;
const Uint32 totalLen = 2 + sizeInWords;
Uint32 tupKeyLen = theTupKeyLen;
+ union {
+ Uint32 tempData[2000];
+ Uint64 __align;
+ };
+ Uint64 *valPtr;
if(remaining > totalLen && aligned && nobytes){
Uint32 * dst = theKEYINFOptr + currLen;
* dst ++ = type;
* dst ++ = ahValue;
memcpy(dst, aValue, 4 * sizeInWords);
theTotalNrOfKeyWordInSignal = currLen + totalLen;
+ valPtr = (Uint64*)aValue;
} else {
if(!aligned || !nobytes){
- Uint32 tempData[2000];
tempData[0] = type;
tempData[1] = ahValue;
tempData[2 + (len >> 2)] = 0;
memcpy(tempData+2, aValue, len);
-
insertBOUNDS(tempData, 2+sizeInWords);
+ valPtr = (Uint64*)(tempData+2);
} else {
Uint32 buf[2] = { type, ahValue };
insertBOUNDS(buf, 2);
insertBOUNDS((Uint32*)aValue, sizeInWords);
+ valPtr = (Uint64*)aValue;
}
}
theTupKeyLen = tupKeyLen + totalLen;
@@ -1223,7 +1229,7 @@ NdbIndexScanOperation::setBound(const NdbColumnImpl* tAttrInfo,
if(type == BoundEQ && tDistrKey)
{
theNoOfTupKeyLeft--;
- return handle_distribution_key((Uint64*)aValue, sizeInWords);
+ return handle_distribution_key(valPtr, sizeInWords);
}
return 0;
} else {