Commit Graph
37 Commits
Author SHA1 Message Date
Shauren d958bfd0f3 Core/Database: Replace DatabaseWorker with asio io_context 2023-12-15 12:06:59 +01:00
Shauren 5c59e2a248 Core/Database: Refactor MySQLConnection constructors and async thread creation 2023-12-14 17:00:58 +01:00
Meji 73d00dd411 Core/Logging: Update missing log to fmt::format 2023-02-01 00:16:04 +01:00
Shauren d791afae1d Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) 2023-01-08 21:16:53 +01:00
daMaex 57dae92ed3 Fixed MariaDB build the easy way for the client version check (#28039)
depending on https://jira.mariadb.org/browse/CONC-509

(cherry picked from commit f922a7dff644451a05a6b0088b652fbe86dafebc)
2022-09-05 19:27:04 +02:00
daMaex 0a07f257f2 MariaDB support for Ubuntu 22.04 (#28031)
(cherry picked from commit bceb5b606068b8ef29a55338bcaa8fb611be4e33)
2022-09-05 18:34:50 +02:00
Giacomo Pozzoni b7addbafe8 Core/DB: Improve MySQL version check messages (#26866)
* Core/DB: Improve MySQL version check messages

* Make it more clear that any version above the required one is supported

* Implement feedback

(cherry picked from commit d9a0db79a8f74254afa31bbc26ab506fa00203c1)
2022-03-13 22:37:07 +01:00
Aokromes 0a77534245 Core/DB: Updated missing check (#26834)
* Core/DB: Updated missing check

TrinityCore does not support MySQL versions below 5.7, please update your MySQL server

(cherry picked from commit 3c84972a36cf5f621f4b8c052d07c7ede4a78495)
2022-03-13 14:05:23 +01:00
Giacomo Pozzoni 51f0294c18 Core/DBLayer: Add QueueSize() method (#26733)
* Core/DBLayer: Add QueueSize() method

Add QueueSize() method to database objects (Login, Character and World) that returns how many tasks are queued.
Include the queue size of the 3 databases in ".server debug" command

* Make the code less threadsafe

* Send data to InfluxDB

* Update grafana dashboard

(cherry picked from commit 96dc110f4a353871ac74c82ff4b1bcc4c34156f3)
2022-03-11 19:32:22 +01:00
Shauren 357147834e Core/DBLayer: Fixed memory leaks with existing SQLQueryHolder uses and eliminated the possibilty of adding more in future (replaced manual memory management with smart pointers)
(cherry picked from commit 53482f729995889936ad8fba9fc5789d9cdba85a)
2022-02-28 22:41:36 +01:00
Shauren d5dcf02196 Core/DBLayer: Add nicer api for SQLQueryHolders
(cherry picked from commit 9b806c6b5d9e83f8614523317a44742954f97744)
2022-01-24 21:21:37 +01:00
Giacomo Pozzoni 736b9ac112 Log sync db queries in World::Update() loop (#25174)
* Core/Misc: Log sync queries on critical path

* Fix build

* Rename

* Fix warning

* Fix no-pch

* Change WarnAboutSyncQueries() to be header-only

(cherry picked from commit deceb11b5fc52c8036f249d628ccc69ca5d022b3)
2022-01-24 14:58:08 +01:00
Giacomo Pozzoni 1529fe1064 Core/Database: Fix build with Maria DB on some distros (#24248)
(cherry picked from commit 0752584856b0d9c2a1a5b179cf90d3bc765fa2c1)
2021-12-22 21:45:46 +01:00
jackpoz 66f7e57990 Shared/Database: Improve dead-lock error handling
Improve dead-lock error handling in async transactions by retrying the transaction for up to 60 seconds instead of just 5 times

(cherry picked from commit 54b0b8f5ead41f936b12e97d1b4fbacd9b89ab53)
2021-06-19 23:33:38 +02:00
Shauren b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
Shauren 1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
Peter Keresztes Schmidt bab5fd87a3 Core/Misc: Replace Trinity::make_unique with std (#24869) 2020-06-23 08:54:12 +02:00
Shauren d6d67a9766 Core/DBLayer: Fix build using TRINITY_DEBUG 2020-04-25 00:15:26 +02:00
Shauren 0f0ca3a919 Core/DBLayer: Implement async transaction completion callbacks 2020-04-14 16:23:44 +02:00
Aokromes b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren c3a9d56b56 Core/DBLayer: Support using mysql 8 2019-11-01 16:21:14 +01:00
ariel- d131bd1da0 Core/Database: Prepared statement parameter preallocation (#18999)
- Pass prepared statement size to the helper class to prevent runtime resizing.
- Rename CheckValidIndex -> AssertValidIndex
- Cached prepared size on the worker pool as it's shared among all connections
- Cached query data only for each connection, done lookup in map instead of possibly creating a new element
- Kill the prepared statement map, and store raw sql string on the MySQLPreparedStatement class
(This info is only used for logging, and there is no need of keeping a second container just for it)

(cherrypicked from affee140c6a8e1e9358be2aa0d0088ede218acaa)
2019-08-17 20:04:14 +02:00
Shauren 13440434c3 Core/DBLayer: Prevent mixing databases with query holders 2019-07-27 11:45:56 +02:00
Shauren f6e2b8cdc1 Core/DBLayer: Prevent committing transactions started on a different database 2019-07-27 10:52:33 +02:00
Shauren e8e89f58fb Core/DBLayer: Prevent using prepared statements on wrong database 2019-07-27 01:00:37 +02:00
vincent-michael 5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
vincent-michael 7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren ae5696ef2b Build fix for mysql 5.6 and older 2017-05-13 21:02:37 +02:00
Shauren 7e538980a2 Core/Database: Include cleanup 2017-05-12 18:50:27 +02:00
Shauren 3a418a0bbc Core/Common: Include cleanup 2017-05-11 22:29:51 +02:00
Shauren 8e2634b2b4 Core/DBLayer: Convert async queries to new query callbacks and remove old callback handling 2017-01-13 21:38:03 +01:00
vincent-michael 86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Shocker 7a5bf6c978 Core/Database: Fix logic in DatabaseWorkerPool::GetFreeConnection 2016-10-31 15:16:46 +02:00
Aokromes 8954b83d29 Core/Misc: Better description for a log
(cherry picked from commit 90cff479ac16289caeb685c9a899eeafa43bf893)
2016-08-08 18:47:03 +02:00
Shauren 70412e7e25 Core/Misc: MSVC warning fixes 2016-04-05 00:15:56 +02:00
Naios 6cfea2d8f7 Core/Database: Converted the database library to a shared library.
* There is still the possibility to static link against database.
2016-03-24 01:28:59 +01:00
Naios 31c8f9a7ed Core/Database: Move DatabaseWorkerPool into it's own translation unit
(cherry picked from commit 09fa0ab46a487ea85d475ac0b3495724c170fe1a)
2016-03-03 01:51:49 +01:00