aboutsummaryrefslogtreecommitdiff
path: root/src/server/database/Database/Field.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/database/Database/Field.cpp')
-rw-r--r--src/server/database/Database/Field.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/database/Database/Field.cpp b/src/server/database/Database/Field.cpp
index f891bfd22b9..b9d25b3da1b 100644
--- a/src/server/database/Database/Field.cpp
+++ b/src/server/database/Database/Field.cpp
@@ -16,6 +16,7 @@
*/
#include "Field.h"
+#include "Errors.h"
#include "Log.h"
#include "MySQLHacks.h"
@@ -247,6 +248,12 @@ std::vector<uint8> Field::GetBinary() const
return result;
}
+void Field::GetBinarySizeChecked(uint8* buf, size_t length) const
+{
+ ASSERT(data.value && (data.length == length), "Expected %zu-byte binary blob, got %sdata (%u bytes) instead", length, data.value ? "" : "no ", data.length);
+ memcpy(buf, data.value, length);
+}
+
void Field::SetByteValue(char const* newValue, uint32 length)
{
// This value stores raw bytes that have to be explicitly cast later