[7935] Move seldom used access to query data by field names to independent object.

This let not do preparation code for unused later functionlity.
This commit is contained in:
VladimirMangos 2009-06-01 10:20:28 +04:00
parent 626553c9ee
commit c3c7187841
12 changed files with 165 additions and 71 deletions

View file

@ -335,16 +335,16 @@ std::string PlayerDumpWriter::GetDump(uint32 guid)
dump += "IMPORTANT NOTE: NOT APPLY ITS DIRECTLY to character DB or you will DAMAGE and CORRUPT character DB\n\n";
// revision check guard
QueryResult* result = CharacterDatabase.Query("SELECT * FROM character_db_version LIMIT 1");
QueryNamedResult* result = CharacterDatabase.QueryNamed("SELECT * FROM character_db_version LIMIT 1");
if(result)
{
QueryResult::FieldNames const& namesMap = result->GetFieldNames();
QueryFieldNames const& namesMap = result->GetFieldNames();
std::string reqName;
for(QueryResult::FieldNames::const_iterator itr = namesMap.begin(); itr != namesMap.end(); ++itr)
for(QueryFieldNames::const_iterator itr = namesMap.begin(); itr != namesMap.end(); ++itr)
{
if(itr->second.substr(0,9)=="required_")
if(itr->substr(0,9)=="required_")
{
reqName = itr->second;
reqName = *itr;
break;
}
}