Conversation
|
See https://github.com/jackpoz/TC-SQL-AutoUpdater by @jackpoz, it detects file changes using libgit |
|
The big question is: is it better to swap this in an external tool or include it in the world & bnetserver. To include it in the servers would bring several advantages like:
|
|
You cannot simply load the entire file into one buffer and execute it as-is. You need to call mysql_set_server_option with MYSQL_OPTION_MULTI_STATEMENTS_ON (preferably opening a separate connection to database with this option for updating purposes) |
|
Yeah, I agree with make the worldserver apply the SQLs instead of an external tool. I linked Jackpoz's proof of concept to show a way to detect changes (it doesn't have to be like this, CRC checks would probably be fine too). |
|
@Shauren xD you are right, this sql option needs to be set. And probably it would make sence to open a new connection with this special option, except to set it for all connections. |
|
I need to ask Aokromes for the IRC logs of the discussion of this feature few years ago. |
An update is bugged is it throws an error when executed, in any other case a new sql update script should be added instead of modifying the existing one so modified ones shouldn't be updated. |
There was a problem hiding this comment.
Utils.h -> ByteArrayToHexString
|
as far as i remember mangos used a kind of version check in each sql query. could this be also used in this case here ? well this would mean each sql correction must be pushed as a seperate sql file but this would prevent double batching |
|
Its requested that queries are multi batchable. |
1d2ae5e to
cc49777
Compare
|
I can clear my DB and launch it couple time if needed, i dont mind resetting everything |
|
Updated this to a4b5b41. Recent updates (2015_03_16_*) included. |
|
Well this addition to the core works really well, any reason we're still waiting for it to be merged? |
|
Now time to be a PITA same goes for auth and character so i can keep all 3 branches updated. Would I be able to set those settings in the automation ? |
|
@danlapps Sure you can, it updates the dbs that are written in worldserver.conf & authserver.conf/bnetserver.conf. @jaredjones Currently we are waiting to do some cherry-picks first so a new TDB can be released as soon as this gets merged (to avoid conflicts with old not updated TDB's). |
6732a8f to
55154d3
Compare
|
Updated this to a30eb73. Also added the possibility to define the databases you want to update through flags: Also improved the DatabaseLoader which removes a lot of duplicated code in worldserver and bnetserver main.cpp (and adds the functionality to close databases correctly on failure). // Load databases
DatabaseLoader loader("server.worldserver", DATABASE_MASK_ALL);
loader
.AddDatabase(HotfixDatabase, "Hotfix")
.AddDatabase(WorldDatabase, "World")
.AddDatabase(CharacterDatabase, "Character")
.AddDatabase(LoginDatabase, "Login");
if (!loader.Load())
return false; |
6dda07c to
ba719fc
Compare
|
Yes all DB uses different names, you are a Genius :) |
|
Excellent idea, me gusto. 👍 |
|
LF @Naios @ irc |
a105c81 to
b923397
Compare
Automatically detects new and edited sql updates through file lists and hashing. Detects renames, deletes and is able to create and auto import full databases. * cleanups in main.cpp of world & bnetserver * refactoring in DatabaseWorkerPool.h & MySQLConnection.cpp Make sure you re-run cmake, because boost::iostreams was added as dependency. Maybe you need to install libboost-iostreams1.55-dev on unix as well. Import every update manual until (included) those INSERT IGNORE updates for each database. Thanks DDuarte and Shauren for your amazing ideas, help and advises. In hope that nobody gets a "Your database structure is not up to date..." anymore ,-) Signed-off-by: Naios <[email protected]>
|
Merged in 352012e TODO: Port to 3.3.5 |
Idea:
This pullrequest implements a great idea of @DDuarte mentioned in this post.
The idea is very simple: let the world and authserver update its database tables itself so you don't need to care about updates anymore -> say bye to
"Your database structure is not up to date...", you won't see this message anymore ,-)The procedure is following:
sql/old,sql/customandsql/updates)...How it works
The pullrequest adds the functionality to both servers to create, populate and update its databases automatically.
Configuration:
Create databases:
Populate databases:
Update databases
ToDo:
Ready to test!
For testing purposes append this to your full database. Otherwise world population won't be supported!
Finished
Working location