aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-10-15 23:53:28 +0200
committerShauren <shauren.trinity@gmail.com>2016-10-15 23:53:28 +0200
commit4a0f5ed2be66afcb8d26b17c1dffc02614d69520 (patch)
tree3ce8bfa41fd4a16c9f3234b6268257b0e22e314f /src
parent6a87e266eb473596e8ff9287dc1d05301511d2ef (diff)
Core/DataStores: Fixed loading int arrays from trailing packed blobs in db2 files
Closes #18072
Diffstat (limited to 'src')
-rw-r--r--src/server/shared/DataStores/DB2StorageLoader.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/shared/DataStores/DB2StorageLoader.cpp b/src/server/shared/DataStores/DB2StorageLoader.cpp
index 09ad198bbb5..ce1963420d7 100644
--- a/src/server/shared/DataStores/DB2StorageLoader.cpp
+++ b/src/server/shared/DataStores/DB2StorageLoader.cpp
@@ -184,7 +184,7 @@ uint16 DB2FileLoaderRegularImpl::Record::GetByteSize(uint32 field) const
uint32 DB2FileLoaderRegularImpl::Record::GetVarInt(uint32 field, uint32 arrayIndex, bool isSigned) const
{
ASSERT(field < file._header->FieldCount);
- uint32 val = *reinterpret_cast<uint32*>(offset + GetOffset(field) + arrayIndex * sizeof(uint32));
+ uint32 val = *reinterpret_cast<uint32*>(offset + GetOffset(field) + arrayIndex * (4 - file.fields[field].UnusedBits / 8));
EndianConvert(val);
if (isSigned)
return int32(val) << file.fields[field].UnusedBits >> file.fields[field].UnusedBits;
@@ -332,7 +332,7 @@ char* DB2FileLoaderRegularImpl::AutoProduceData(uint32& records, char**& indexTa
for (uint32 y = 0; y < _header->RecordCount; y++)
{
Record rec = getRecord(y);
- uint32 indexVal = _loadInfo.Meta->HasIndexFieldInData() ? rec.getUInt(indexField, 0, _loadInfo.Fields[0].IsSigned) : ((uint32*)idTable)[y];
+ uint32 indexVal = _loadInfo.Meta->HasIndexFieldInData() ? rec.getUInt(indexField, 0, false) : ((uint32*)idTable)[y];
indexTable[indexVal] = &dataTable[offset];