fix(Core/Database): fix wrong Field::IsNull() return value on null binary fields (#5975)
This commit is contained in:
parent
fe6db2ff96
commit
983d4b5771
1 changed files with 16 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue