mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +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
|
[[nodiscard]] bool IsNull() const
|
||||||
{
|
{
|
||||||
|
if (IsBinary() && data.length == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return data.value == nullptr;
|
return data.value == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,6 +355,18 @@ protected:
|
|||||||
data.type == MYSQL_TYPE_LONGLONG );
|
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;
|
void GetBinarySizeChecked(uint8* buf, size_t size) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user