aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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];