Core/DBLayer: Converted player login queries into prepared statements

Core/DBLayer: Added missing implementation for SQLQueryHolder::SetPreparedQuery

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-09-20 18:20:40 +02:00
parent cd40ab6776
commit a509976369
23 changed files with 601 additions and 481 deletions
@@ -305,8 +305,8 @@ void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQ
void AuctionHouseMgr::LoadAuctionItems()
{
// data needs to be at first place for Item::LoadFromDB
// 0 1 2 3 4 5 6 7 8 9 10 11 12
QueryResult result = CharacterDatabase.Query("SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, itemguid, item_template FROM auctionhouse JOIN item_instance ON itemguid = guid");
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_AUCTION_ITEMS);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
@@ -321,14 +321,12 @@ void AuctionHouseMgr::LoadAuctionItems()
uint32 count = 0;
Field *fields;
do
{
bar.step();
fields = result->Fetch();
uint32 item_guid = fields[11].GetUInt32();
uint32 item_template = fields[12].GetUInt32();
uint32 item_guid = result->GetUInt32(11);
uint32 item_template = result->GetUInt32(12);
ItemPrototype const *proto = sObjectMgr.GetItemPrototype(item_template);