Add prepared statement example for auth server ping

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-06-28 16:09:16 +02:00
parent b6e180c17c
commit fb4d4514e5
+6 -1
View File
@@ -24,6 +24,7 @@
#include "Common.h" #include "Common.h"
#include "Database/DatabaseEnv.h" #include "Database/DatabaseEnv.h"
#include "Database/PreparedStatements.h"
#include "Configuration/ConfigEnv.h" #include "Configuration/ConfigEnv.h"
#include "Log.h" #include "Log.h"
@@ -313,7 +314,7 @@ extern int main(int argc, char **argv)
{ {
loopCounter = 0; loopCounter = 0;
sLog.outDetail("Ping MySQL to keep connection alive"); sLog.outDetail("Ping MySQL to keep connection alive");
LoginDatabase.Query("SELECT 1 FROM realmlist LIMIT 1"); sPreparedStatement.Query(&LoginDatabase, "auth_ping");
} }
#ifdef _WIN32 #ifdef _WIN32
if (m_ServiceStatus == 0) stopEvent = true; if (m_ServiceStatus == 0) stopEvent = true;
@@ -345,6 +346,10 @@ bool StartDB()
return false; return false;
} }
LoginDatabase.ThreadStart(); LoginDatabase.ThreadStart();
uint32 count = 0;
sPreparedStatement.LoadAuthserver(&LoginDatabase, count);
sLog.outString("Loaded %u prepared MySQL statements for auth DB.", count);
return true; return true;
} }