aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-03-02 13:45:26 +0100
committerShauren <shauren.trinity@gmail.com>2025-03-02 13:45:26 +0100
commitdac15a32a6361a5e47e17b621828369b1b7a4d84 (patch)
treeaa94f2bc5848d112ae9d290c03cbe106570f0c67 /src
parent49aa298006456ed90211e42103ed7b073ff0c156 (diff)
Core/DataStores: Support non-uint32 ID fields
Diffstat (limited to 'src')
-rw-r--r--src/common/DataStores/DB2FileLoader.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/common/DataStores/DB2FileLoader.cpp b/src/common/DataStores/DB2FileLoader.cpp
index 12df8086a45..d3dfa65bf90 100644
--- a/src/common/DataStores/DB2FileLoader.cpp
+++ b/src/common/DataStores/DB2FileLoader.cpp
@@ -746,7 +746,20 @@ unsigned char const* DB2FileLoaderRegularImpl::GetRawRecordData(uint32 recordNum
uint32 DB2FileLoaderRegularImpl::RecordGetId(uint8 const* record, uint32 recordIndex) const
{
if (_loadInfo->Meta->HasIndexFieldInData())
- return RecordGetVarInt<uint32>(record, _loadInfo->Meta->GetIndexField(), 0);
+ {
+ uint32 indexField = _loadInfo->Meta->GetIndexField();
+ switch (_loadInfo->Meta->Fields[indexField].Type)
+ {
+ case FT_INT:
+ return RecordGetVarInt<uint32>(record, indexField, 0);
+ case FT_BYTE:
+ return RecordGetVarInt<uint8>(record, indexField, 0);
+ case FT_SHORT:
+ return RecordGetVarInt<uint16>(record, indexField, 0);
+ default:
+ ABORT_MSG("Unhandled ID type %u in %s", uint32(_loadInfo->Meta->Fields[indexField].Type), _fileName);
+ }
+ }
return _idTable[recordIndex];
}