Jump to content

[8072][patch] Get rid of data blob (first step)


Auntie Mangos

Recommended Posts

Mangos Version: 8073

Custom Patches: AHBot-004-HotFix-01 by Naicisum

SD2 Version: 1155

Database Name and Version : UDB 381

Just updated to MaNGOS Version 8073, applied all corepatches without error.

Didnt know where to post this but i suspect this patch to be the reason.

I got this errors like this since i updated:

 21:34:10 SQL: UPDATE money = '157715809' WHERE guid = '14'
21:34:10 SQL ERROR: You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near ''1577
15809' WHERE guid = '14'' at line 1

Whats wrong ?

Link to comment
Share on other sites

void Player::SaveGoldToDB()
{
   CharacterDatabase.PExecute("UPDATE money = '%u' WHERE guid = '%u'", GetMoney(), GetGUIDLow());
}

Should be

void Player::SaveGoldToDB()
{
   CharacterDatabase.PExecute("UPDATE characters SET money = '%u' WHERE guid = '%u'", GetMoney(), GetGUIDLow());
}

Link to comment
Share on other sites

I don't see why this values that are calculated every login shouldn't receive their own field... it would consume some space as a trade for cpu consuming. I'm wondering with the retail armory needs to calculate anything... :mellow:
You really don't want to go back to the problems caused by using the stat values loaded from the DB. The calculation needs to be done whether there is a separate field for it or not, making sure everything works correctly. So loading the value is a completely unnecessary overhead. This is not a tradeoff between space/cpu usage, both are just made worse by having the fields. Saving the values can on the other hand be useful to external tools and i think making a config option to enable that (even if never loaded by the server later i.e an unnecessary performance overhead for those who can afford it) might be something that can be discussed.
Link to comment
Share on other sites

and even if the data field is completely removed, its always possible to add an own table for your website or whatever that stores exactly the values you need. never beeing read, but always written on character save. (1 query more in whole saving process)

this will also save work when data field offsets change.

Link to comment
Share on other sites

  • 2 weeks later...

Vladimir we not needing apply rollback query before use [before_upgrade_to_0.13\\052_8072_01_characters_characters.sql] ?!

Example :

[HIGHLIGHT=SQL]

UPDATE `characters` SET `data`=CONCAT(CAST(SUBSTRING_INDEX(`data`, ' ', 1461) AS CHAR), ' ', `money`, ' ', CAST(SUBSTRING_INDEX(`data`, ' ', -131)AS CHAR));

[/HIGHLIGHT]

Link to comment
Share on other sites

no, data at save stored and in old and in new fields so just drop new fields not create peoblem with backporting.

Except only case when you for example change level for _offline_ character and he not login before backport.

In like case he will have old level after backport. Same for other offline change data stored in new fields.

Link to comment
Share on other sites

Ok... I understood the many:

- SaveDataFieldToDB();

+ SaveGoldToDB();

like killing the saving of money to `data`.

This only meaning that moeny to `data` will saved _only_ at full save. But it not need anyway while new columps used. After normal logout value in `money` and monet in `data` must be same anyway.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use