From fb4d4514e53a6dcd2704c957a8904be8bf02034b Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Mon, 28 Jun 2010 16:09:16 +0200 Subject: Add prepared statement example for auth server ping --HG-- branch : trunk --- src/server/authserver/Main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/server/authserver/Main.cpp') diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index 46ea2b38212..28757e914e3 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -24,6 +24,7 @@ #include "Common.h" #include "Database/DatabaseEnv.h" +#include "Database/PreparedStatements.h" #include "Configuration/ConfigEnv.h" #include "Log.h" @@ -313,7 +314,7 @@ extern int main(int argc, char **argv) { loopCounter = 0; sLog.outDetail("Ping MySQL to keep connection alive"); - LoginDatabase.Query("SELECT 1 FROM realmlist LIMIT 1"); + sPreparedStatement.Query(&LoginDatabase, "auth_ping"); } #ifdef _WIN32 if (m_ServiceStatus == 0) stopEvent = true; @@ -345,6 +346,10 @@ bool StartDB() return false; } LoginDatabase.ThreadStart(); + + uint32 count = 0; + sPreparedStatement.LoadAuthserver(&LoginDatabase, count); + sLog.outString("Loaded %u prepared MySQL statements for auth DB.", count); return true; } -- cgit v1.2.3