diff options
author | funjoker <funjoker109@gmail.com> | 2024-03-28 20:18:59 +0100 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2024-03-28 20:20:04 +0100 |
commit | e769af1044f524ee9ef469a3d1bfb728ee5ef4d0 (patch) | |
tree | 8da8700300f27e6070a12356e97f459a7841b081 /src/common/DataStores/DB2FileLoader.cpp | |
parent | cdaf8ffc068ef00a3427af2b95a46e360d63e1fc (diff) |
Core: port sneaky fixes from "Core: Updated to 10.2.6.53840"
Diffstat (limited to 'src/common/DataStores/DB2FileLoader.cpp')
-rw-r--r-- | src/common/DataStores/DB2FileLoader.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/common/DataStores/DB2FileLoader.cpp b/src/common/DataStores/DB2FileLoader.cpp index 57ec7df6e3f..7a586178794 100644 --- a/src/common/DataStores/DB2FileLoader.cpp +++ b/src/common/DataStores/DB2FileLoader.cpp @@ -2076,19 +2076,23 @@ void DB2FileLoader::Load(DB2FileSource* source, DB2FileLoadInfo const* loadInfo) if (loadInfo) { uint32 fieldIndex = 0; + std::string signValidationResult; if (!loadInfo->Meta->HasIndexFieldInData()) { - ASSERT(!loadInfo->Fields[0].IsSigned, "ID must be unsigned in %s", source->GetFileName()); + if (loadInfo->Fields[0].IsSigned) + signValidationResult += Trinity::StringFormat("ID must be unsigned in {}", source->GetFileName()); ++fieldIndex; } for (uint32 f = 0; f < loadInfo->Meta->FieldCount; ++f) { - ASSERT(loadInfo->Fields[fieldIndex].IsSigned == _impl->IsSignedField(f), - "Field %s in %s must be %s%s", loadInfo->Fields[fieldIndex].Name, source->GetFileName(), _impl->IsSignedField(f) ? "signed" : "unsigned", - _impl->GetExpectedSignMismatchReason(f)); + if (loadInfo->Fields[fieldIndex].IsSigned != _impl->IsSignedField(f)) + signValidationResult += Trinity::StringFormat("Field {} in {} must be {}{}", loadInfo->Fields[fieldIndex].Name, + source->GetFileName(), _impl->IsSignedField(f) ? "signed" : "unsigned", _impl->GetExpectedSignMismatchReason(f)); fieldIndex += loadInfo->Meta->Fields[f].ArraySize; } + if (!signValidationResult.empty()) + throw DB2FileLoadException(std::move(signValidationResult)); } } |