mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
Core/DBLayer: Optimized prepared statement query results by eliminating unneeded buffer copies
* Improved error logs for using incorrect Field getters to also include table name, field name and field index.
(cherry picked from commit 65dbc7082a)
Conflicts:
src/server/database/Database/Field.h
src/server/game/Globals/ObjectMgr.cpp
This commit is contained in:
@@ -30,18 +30,11 @@ Field::~Field()
|
||||
CleanUp();
|
||||
}
|
||||
|
||||
void Field::SetByteValue(const void* newValue, const size_t newSize, enum_field_types newType, uint32 length)
|
||||
void Field::SetByteValue(void* newValue, enum_field_types newType, uint32 length)
|
||||
{
|
||||
if (data.value)
|
||||
CleanUp();
|
||||
|
||||
// This value stores raw bytes that have to be explicitly cast later
|
||||
if (newValue)
|
||||
{
|
||||
data.value = new char[newSize];
|
||||
memcpy(data.value, newValue, newSize);
|
||||
data.length = length;
|
||||
}
|
||||
data.value = newValue;
|
||||
data.length = length;
|
||||
data.type = newType;
|
||||
data.raw = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user