Core/DBLayer: fixed debug build (#195)

This commit is contained in:
Phil
2020-12-05 19:27:35 +02:00
committed by GitHub
parent 10f776c4f4
commit c8d37293e8
2 changed files with 12 additions and 23 deletions

View File

@@ -272,7 +272,7 @@ TransactionCallback DatabaseWorkerPool<T>::AsyncCommitTransaction(SQLTransaction
{
case 0:
TC_LOG_DEBUG("sql.driver", "Transaction contains 0 queries. Not executing.");
return;
break;
case 1:
TC_LOG_DEBUG("sql.driver", "Warning: Transaction only holds 1 query, consider removing Transaction context in code.");
break;

View File

@@ -37,8 +37,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
@@ -56,8 +55,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
@@ -75,8 +73,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
@@ -94,8 +91,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
@@ -113,8 +109,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
@@ -132,8 +127,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
@@ -151,8 +145,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
@@ -170,8 +163,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
@@ -189,8 +181,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
@@ -208,8 +199,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
@@ -227,8 +217,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 nullptr;
}
#endif