mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/DataStores: Updated db2 structures to 8.1.5
This commit is contained in:
@@ -22,8 +22,8 @@ DB2MetaField::DB2MetaField(DBCFormer type, uint8 arraySize, bool isSigned) : Typ
|
||||
{
|
||||
}
|
||||
|
||||
DB2Meta::DB2Meta(int32 indexField, uint32 fieldCount, uint32 layoutHash, DB2MetaField const* fields, int32 parentIndexField)
|
||||
: IndexField(indexField), ParentIndexField(parentIndexField), FieldCount(fieldCount), LayoutHash(layoutHash), Fields(fields)
|
||||
DB2Meta::DB2Meta(uint32 fileDataId, int32 indexField, uint32 fieldCount, uint32 layoutHash, DB2MetaField const* fields, int32 parentIndexField)
|
||||
: FileDataId(fileDataId),IndexField(indexField), ParentIndexField(parentIndexField), FieldCount(fieldCount), LayoutHash(layoutHash), Fields(fields)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -76,6 +76,46 @@ uint32 DB2Meta::GetRecordSize() const
|
||||
return size;
|
||||
}
|
||||
|
||||
uint32 DB2Meta::GetIndexFieldOffset() const
|
||||
{
|
||||
if (IndexField == -1)
|
||||
return 0;
|
||||
|
||||
uint32 offset = 0;
|
||||
|
||||
for (int32 i = 0; i < IndexField; ++i)
|
||||
{
|
||||
for (uint8 j = 0; j < Fields[i].ArraySize; ++j)
|
||||
{
|
||||
switch (Fields[i].Type)
|
||||
{
|
||||
case FT_BYTE:
|
||||
offset += 1;
|
||||
break;
|
||||
case FT_SHORT:
|
||||
offset += 2;
|
||||
break;
|
||||
case FT_FLOAT:
|
||||
case FT_INT:
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_LONG:
|
||||
offset += 8;
|
||||
break;
|
||||
case FT_STRING:
|
||||
case FT_STRING_NOT_LOCALIZED:
|
||||
offset += sizeof(char*);
|
||||
break;
|
||||
default:
|
||||
ASSERT(false, "Unsupported column type specified %c", Fields[i].Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
int32 DB2Meta::GetParentIndexFieldOffset() const
|
||||
{
|
||||
if (ParentIndexField == -1)
|
||||
|
||||
Reference in New Issue
Block a user