mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/DataStores: Updated db2 structures to 7.3.5.25996
This commit is contained in:
@@ -39,8 +39,7 @@ uint8 Field::GetUInt8() const
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (!IsType(DatabaseFieldTypes::Int8))
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Warning: GetUInt8() on non-tinyint field %s.%s (%s.%s) at index %u. Using type: %s.",
|
||||
meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index, meta.Type);
|
||||
LogWrongType(__FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -58,8 +57,7 @@ int8 Field::GetInt8() const
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (!IsType(DatabaseFieldTypes::Int8))
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Warning: GetInt8() on non-tinyint field %s.%s (%s.%s) at index %u. Using type: %s.",
|
||||
meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index, meta.Type);
|
||||
LogWrongType(__FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -77,8 +75,7 @@ uint16 Field::GetUInt16() const
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (!IsType(DatabaseFieldTypes::Int16))
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Warning: GetUInt16() on non-smallint field %s.%s (%s.%s) at index %u. Using type: %s.",
|
||||
meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index, meta.Type);
|
||||
LogWrongType(__FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -96,8 +93,7 @@ int16 Field::GetInt16() const
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (!IsType(DatabaseFieldTypes::Int16))
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Warning: GetInt16() on non-smallint field %s.%s (%s.%s) at index %u. Using type: %s.",
|
||||
meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index, meta.Type);
|
||||
LogWrongType(__FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -115,8 +111,7 @@ uint32 Field::GetUInt32() const
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (!IsType(DatabaseFieldTypes::Int32))
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Warning: GetUInt32() on non-(medium)int field %s.%s (%s.%s) at index %u. Using type: %s.",
|
||||
meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index, meta.Type);
|
||||
LogWrongType(__FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -134,8 +129,7 @@ int32 Field::GetInt32() const
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (!IsType(DatabaseFieldTypes::Int32))
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Warning: GetInt32() on non-(medium)int field %s.%s (%s.%s) at index %u. Using type: %s.",
|
||||
meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index, meta.Type);
|
||||
LogWrongType(__FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -153,8 +147,7 @@ uint64 Field::GetUInt64() const
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (!IsType(DatabaseFieldTypes::Int64))
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Warning: GetUInt64() on non-bigint field %s.%s (%s.%s) at index %u. Using type: %s.",
|
||||
meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index, meta.Type);
|
||||
LogWrongType(__FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -172,8 +165,7 @@ int64 Field::GetInt64() const
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (!IsType(DatabaseFieldTypes::Int64))
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Warning: GetInt64() on non-bigint field %s.%s (%s.%s) at index %u. Using type: %s.",
|
||||
meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index, meta.Type);
|
||||
LogWrongType(__FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -191,8 +183,7 @@ float Field::GetFloat() const
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (!IsType(DatabaseFieldTypes::Float))
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Warning: GetFloat() on non-float field %s.%s (%s.%s) at index %u. Using type: %s.",
|
||||
meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index, meta.Type);
|
||||
LogWrongType(__FUNCTION__);
|
||||
return 0.0f;
|
||||
}
|
||||
#endif
|
||||
@@ -210,8 +201,7 @@ double Field::GetDouble() const
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (!IsType(DatabaseFieldTypes::Double) && !IsType(DatabaseFieldTypes::Decimal))
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Warning: GetDouble() on non-double/non-decimal field %s.%s (%s.%s) at index %u. Using type: %s.",
|
||||
meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index, meta.Type);
|
||||
LogWrongType(__FUNCTION__);
|
||||
return 0.0f;
|
||||
}
|
||||
#endif
|
||||
@@ -229,8 +219,7 @@ char const* Field::GetCString() const
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (IsNumeric() && data.raw)
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Error: GetCString() on numeric field %s.%s (%s.%s) at index %u. Using type: %s.",
|
||||
meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index, meta.Type);
|
||||
LogWrongType(__FUNCTION__);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
@@ -304,6 +293,12 @@ bool Field::IsNumeric() const
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
|
||||
void Field::LogWrongType(char* getter) const
|
||||
{
|
||||
TC_LOG_WARN("sql.sql", "Warning: %s on %s field %s.%s (%s.%s) at index %u.",
|
||||
getter, meta.Type, meta.TableAlias, meta.Alias, meta.TableName, meta.Name, meta.Index);
|
||||
}
|
||||
|
||||
#ifdef _WIN32 // hack for broken mysql.h not including the correct winsock header for SOCKET definition, fixed in 5.7
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user