aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/QueryHolder.cpp
AgeCommit message (Collapse)Author
2015-08-21Core/Build: Merge common library and move database out of sharedStormBytePP
2015-04-02Core/Database: Remove va_args from DatabaseWorker::Execute methods.Naios
* Also delegate SQLQueryHolder::SetPQuery into SetQuery. (cherry picked from commit df4723af25900b3638a2b5921cf67e1838cbaf64) Conflicts: src/server/shared/Database/QueryHolder.h
2015-01-01Update copyright note for 2015Vincent-Michael
Happy new year
2014-08-16Core/DBLayer: Fixed an incredibly rare memory leak happening when player ↵Shauren
started loading from database and never finished
2014-06-24Core/Databases: Removed ACE dependencies on some of the database handling code.Subv
2014-03-22Core/Misc: Fix some static analysis issuesjackpoz
Fix some static analysis issues about: - uninitialized values, most of which are false positives, always initialized before being accessed - unchecked return values - dead code never executed - bad formatting leading to wrong behavior Please ensure EventMap is never used with event id set to 0 or those events will never execute.
2014-01-01Update copyright note for 2014.Vincent_Michael
Happy new year.
2013-11-08Core/Logging: Remove LOG_FILTER_XXX defines with it's value (remember logger ↵Spp
names are case-sensitive)
2013-11-02Core/Database: Add additional assertjackpoz
Add additional assert to assure that helgrind reports related to SQLQueryHolderTask::Execute() and WorldSession::ProcessQueryCallbacks() are false positives. The only chance for WorldSession::ProcessQueryCallbacks() to access the SQL queries before they are completed is if m_result.ready() is true before the end of SQLQueryHolderTask::Execute() . Helgrind false positive log: Possible data race during read of size 8 at 0x2BD641E0 by thread #7 Locks held: none at : SQLQueryHolder::GetPreparedResult(unsigned long) (QueryHolder.cpp:107) by : Player::LoadFromDB(unsigned int, SQLQueryHolder*) (Player.cpp:16917) by : WorldSession::HandlePlayerLogin(LoginQueryHolder*) (CharacterHandler.cpp:807) by : WorldSession::ProcessQueryCallbacks() (WorldSession.cpp:1112) by : WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:401) by : World::UpdateSessions(unsigned int) (World.cpp:2646) by : World::Update(unsigned int) (World.cpp:2003) by : WorldRunnable::run() (WorldRunnable.cpp:60) by : ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:186) by : ACE_OS_Thread_Adapter::invoke() (in /usr/lib/libACE-6.0.3.so) by : mythread_wrapper (hg_intercepts.c:233) by : start_thread (pthread_create.c:311) This conflicts with a previous write of size 8 by thread #4 Locks held: none at : SQLQueryHolder::SetPreparedResult(unsigned long, PreparedResultSet*) (QueryHolder.cpp:140) by : SQLQueryHolderTask::Execute() (QueryHolder.cpp:196) by : SQLOperation::call() (SQLOperation.h:65) by : DatabaseWorker::svc() (DatabaseWorker.cpp:45) by : ACE_Task_Base::svc_run(void*) (in /usr/lib/libACE-6.0.3.so) by : ACE_Thread_Adapter::invoke_i() (in /usr/lib/libACE-6.0.3.so) by : ACE_Thread_Adapter::invoke() (in /usr/lib/libACE-6.0.3.so) by : mythread_wrapper (hg_intercepts.c:233) Address 0x2BD641E0 is 16 bytes inside a block of size 792 alloc'd at : operator new(unsigned long) (vg_replace_malloc.c:319) by : __gnu_cxx::new_allocator<std::pair<SQLElementData, SQLResultSetUnion> >::allocate(unsigned long, void const*) (new_allocator.h:104) by : std::_Vector_base<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > >::_M_allocate(unsigned long) (in /home/jackpoz/trinity/bin/worldserver) by : std::vector<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > >::_M_fill_insert(__gnu_cxx::__normal_iterator<std::pair<SQLElementData, SQLResultSetUnion>*, std::vector<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > > >, unsigned long, std::pair<SQLElementData, SQLResultSetUnion> const&) (vector.tcc:483) by : std::vector<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > >::insert(__gnu_cxx::__normal_iterator<std::pair<SQLElementData, SQLResultSetUnion>*, std::vector<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > > >, unsigned long, std::pair<SQLElementData, SQLResultSetUnion> const&) (stl_vector.h:1024) by : std::vector<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > >::resize(unsigned long, std::pair<SQLElementData, SQLResultSetUnion>) (stl_vector.h:707) by : SQLQueryHolder::SetSize(unsigned long) (QueryHolder.cpp:167) by : LoginQueryHolder::Initialize() (CharacterHandler.cpp:66) by : WorldSession::HandlePlayerLoginOpcode(WorldPacket&) (CharacterHandler.cpp:788) by : WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:363) by : World::UpdateSessions(unsigned int) (World.cpp:2646) by : World::Update(unsigned int) (World.cpp:2003)
2013-05-13Core/Logging: Performance-related tweaks to logging systemSpp
All sLog->out* functions (except outCommand atm) are replaced with TC_LOG_* macros. Memleak fix
2013-01-01Update copyright note for 2013.Vincent_Michael
Happy new year.
2012-11-27Core/Misc: Set mode 0644 for filesSpp
2012-09-10Core: Warning fixes (Also some -pedantic under game folder)Spp
2012-08-26Core/DBLayer: Fixed memory leaks when query returned empty result setShauren
2012-08-03Core/Logging: Add Asyncronous logging with Loggers ("What to log") and ↵Spp
Appenders ("Where to log") system. Will allow to select to full log some parts of core while others are not even logged. - Logging System is asyncronous to improve performance. - Each msg and Logger has a Log Type and Log Level assigned. Each msg is assigned the Logger of same Log Type or "root" Logger is selected if there is no Logger configured for the given Log Type - Loggers have a list of Appenders to send the msg to. The Msg in the Logger is not sent to Appenders if the msg LogLevel is lower than Logger LogLevel. - There are three (at the moment) types of Appenders: Console, File or DB (this is WIP, not working ATM). Msg is not written to the resource if msg LogLevel is lower than Appender LogLevel. - Appender and Console Log levels can be changed while server is active with command '.set loglevel (a/l) name level' Explanation of use with Sample config: Appender.Console.Type=1 (1 = Console) Appender.Console.Level=2 (2 = Debug) Appender.Server.Type=2 (2 = File) Appender.Server.Level=3 (3 = Info) Appender.Server.File=Server.log Appender.SQL.Type=2 (2 = File) Appender.SQL.Level=1 (1 = Trace) Appender.SQL.File=sql.log Appenders=Console Server (NOTE: SQL has not been included here... that will make core ignore the config for "SQL" as it's not in this list) Logger.root.Type=0 (0 = Default - if it's not created by config, server will create it with LogLevel = DISABLED) Logger.root.Level=5 (5 = Error) Logger.root.Appenders=Console Logger.SQL.Type=26 (26 = SQL) Logger.SQL.Level=3 (2 = Debug) Logger.SQL.Appenders=Console Server SQL Logger.SomeRandomName.Type=24 (24 = Guild) Logger.SomeRandomName.Level=5 (5 = Error) Loggers=root SQL SomeRandomName * At loading Appender SQL will be ignored, as it's not present on "Appenders" * sLog->outDebug(LOG_FILTER_GUILD, "Some log msg related to Guilds") - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomName is found but it's LogLevel = 5 and Msg LogLevel=2... Msg is not logged * sLog->outError(LOG_FILTER_GUILD, "Some error log msg related to Guilds") - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomeName is found with proper LogLevel but Logger does not have any Appenders assigned to that logger... Msg is not logged * sLog->outDebug(LOG_FILTER_SQL, "Some msg related to SQLs") - Msg is sent to Logger SQL (matches type), as it matches LogLevel the msg is sent to Appenders Console, Server and SQL - Appender Console has lower Log Level: Msg is logged to Console - Appender Server has higher Log Level: Msg is not logged to file - Appender SQL has lower Log Level: Msg is logged to file sql.log * sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Some msg related to Battelgrounds") - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). As Logger has higher LogLevel msg is not sent to any appender * sLog->outError(LOG_FILTER_BATTLEGROUND, "Some error msg related to Battelgrounds") - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). Msg has lower LogLevel and is sent to Appender Console - Appender Console has lower LogLevel: Msg is logged to Console
2012-01-01Update headers for 2012. HAPPY NEW YEAR!!!kiper
2011-09-15[Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with ↵Spp
some exceptions)
2011-04-29Add spaces after commasleak
2011-01-01Update copyright note for 2011.Machiavelli
Happy new year.
2010-12-23Core: Removed more operator workarounds for ACE_Singleton (missed previously ↵Shauren
because of inconsistent naming) --HG-- branch : trunk
2010-10-07Remove the accidental additions of CRLF-crap from the header updatesclick
--HG-- branch : trunk
2010-10-07Yet more copyright header updatesclick
--HG-- branch : trunk
2010-09-25Core: Generic cleanup (tab2spaces/whitespace removal)click
--HG-- branch : trunk
2010-09-24Core/DBLayer:Machiavelli
- Rewrite Field class to be able to store both binary prepared statement data and data from adhoc query resultsets - Buffer the data of prepared statements using ResultSet and Field classes and let go of mysql c api structures after PreparedResultSet constructor. Fixes a race condition and thus a possible crash/data corruption (issue pointed out to Derex, basic suggestion by raczman) - Conform PreparedResultSet and ResultSet to the same design standards, and using Field class as data buffer class for both * NOTE: This means the fetching methods are uniform again, using ¨Field* fields = result->Fetch();¨ and access to elements trough fields[x]. * NOTE: for access to the correct row in prepared statements, ¨Field* fields = result->Fetch();¨ must ALWAYS be called inside the do { }while(result->NextRow()) loop. * NOTE: This means that Field::GetString() returns std::string object and Field::GetCString() returns const char* pointer. Still experimental and all that jazz, not recommended for production servers until feedback is given. --HG-- branch : trunk
2010-09-20Core/DBLayer: Converted player login queries into prepared statementsShauren
Core/DBLayer: Added missing implementation for SQLQueryHolder::SetPreparedQuery --HG-- branch : trunk
2010-09-19Core/DBLayer: Shuffle an #include-statement around (initialize mysql ↵click
connections before working on the rest) - Fixes nonPCH-builds. --HG-- branch : trunk
2010-09-19Core/DBLayer: Move QueryHolder and BasicStatement operations to their own ↵Machiavelli
file and remove SQLOperation.cpp from revision control --HG-- branch : trunk