mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
fix(Core/Database): fix wrong Field::IsNull() return value on null binary fields (#5975)
This commit is contained in:
@@ -242,6 +242,10 @@ public:
|
||||
|
||||
[[nodiscard]] bool IsNull() const
|
||||
{
|
||||
if (IsBinary() && data.length == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return data.value == nullptr;
|
||||
}
|
||||
|
||||
@@ -351,6 +355,18 @@ protected:
|
||||
data.type == MYSQL_TYPE_LONGLONG );
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsBinary() const
|
||||
{
|
||||
return (
|
||||
data.type == MYSQL_TYPE_TINY_BLOB ||
|
||||
data.type == MYSQL_TYPE_MEDIUM_BLOB ||
|
||||
data.type == MYSQL_TYPE_LONG_BLOB ||
|
||||
data.type == MYSQL_TYPE_BLOB ||
|
||||
data.type == MYSQL_TYPE_VAR_STRING ||
|
||||
data.type == MYSQL_TYPE_STRING
|
||||
);
|
||||
}
|
||||
|
||||
void GetBinarySizeChecked(uint8* buf, size_t size) const;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user