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:
Shauren
2015-08-26 17:00:26 +02:00
committed by jackpoz
parent 0d0c2e1ca6
commit d2076ef8b0
4 changed files with 130 additions and 92 deletions

View File

@@ -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;
}