mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
[7935] Move seldom used access to query data by field names to independent object. Author: VladimirMangos
This let not do preparation code for unused later functionlity. --HG-- branch : trunk
This commit is contained in:
@@ -133,6 +133,25 @@ QueryResult* Database::PQuery(const char *format,...)
|
||||
return Query(szQuery);
|
||||
}
|
||||
|
||||
QueryNamedResult* Database::PQueryNamed(const char *format,...)
|
||||
{
|
||||
if(!format) return NULL;
|
||||
|
||||
va_list ap;
|
||||
char szQuery [MAX_QUERY_LEN];
|
||||
va_start(ap, format);
|
||||
int res = vsnprintf( szQuery, MAX_QUERY_LEN, format, ap );
|
||||
va_end(ap);
|
||||
|
||||
if(res==-1)
|
||||
{
|
||||
sLog.outError("SQL Query truncated (and not execute) for format: %s",format);
|
||||
return false;
|
||||
}
|
||||
|
||||
return QueryNamed(szQuery);
|
||||
}
|
||||
|
||||
bool Database::PExecute(const char * format,...)
|
||||
{
|
||||
if (!format)
|
||||
|
||||
Reference in New Issue
Block a user