aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/PreparedStatement.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-07-11 19:26:26 +0200
committerShauren <shauren.trinity@gmail.com>2012-07-11 19:26:26 +0200
commit492fd80b0621728889c6013682d07b420778ef9a (patch)
tree6539618a8f34e937b5ca5af3044ca0fbcca15d7b /src/server/shared/Database/PreparedStatement.cpp
parent7611ab69be5982dfe558d6e7554545ea253cbb60 (diff)
Core/Misc
* Cleaned up packet manipulation methods, no need to keep duplicate sets of functions doing the same * Added a very basic ObjectGuid structure for easier (and endian-safe) method of accessing individual guid bytes
Diffstat (limited to 'src/server/shared/Database/PreparedStatement.cpp')
-rwxr-xr-xsrc/server/shared/Database/PreparedStatement.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp
index 58aa2bd3aa0..ae69fc5f913 100755
--- a/src/server/shared/Database/PreparedStatement.cpp
+++ b/src/server/shared/Database/PreparedStatement.cpp
@@ -230,11 +230,16 @@ void MySQLPreparedStatement::ClearParameters()
}
}
+static bool ParementerIndexAssertFail(uint32 stmtIndex, uint8 index, uint32 paramCount)
+{
+ sLog->outError("Attempted to bind parameter %u%s on a PreparedStatement %u (statement has only %u parameters)", uint32(index) + 1, (index == 1 ? "st" : (index == 2 ? "nd" : (index == 3 ? "rd" : "nd"))), stmtIndex, paramCount);
+ return false;
+}
+
//- Bind on mysql level
bool MySQLPreparedStatement::CheckValidIndex(uint8 index)
{
- if (index >= m_paramCount)
- return false;
+ ASSERT(index < m_paramCount || ParementerIndexAssertFail(m_stmt->m_index, index, m_paramCount));
if (m_paramsSet[index])
sLog->outSQLDriver("[WARNING] Prepared Statement (id: %u) trying to bind value on already bound index (%u).", m_stmt->m_index, index);