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 65dbc7082a60b67b76966259130aedc337af3eca)

Conflicts:
	src/server/database/Database/Field.h
	src/server/game/Globals/ObjectMgr.cpp
This commit is contained in:
Shauren authored and jackpoz committed 2015-09-27 16:28:04 +02:00
1 parent 0d0c2e1ca6
commit d2076ef8b0
4 files changed
+130 -92

No files matched your search

+3 -10
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;
}