Issue information

Issue ID
#1252
Status
Confirmed
Severity
None
Started
Hercules Elf Bot
Mar 23, 2008 10:31
Last Post
Hercules Elf Bot
Mar 23, 2008 10:31
Confirmation
N/A

Hercules Elf Bot - Mar 23, 2008 10:31

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=1252

EAthena's SQL data saving uses a non-transactional method to run queries - MyISAM by default, and no BEGIN TRANSACTION.

Yet things like storage saving issue multiple consecutive queries - a bunch of updates, then inserts, then deletes.
This opens up a very serious problem: when the database server suddenly disconnects/shuts down in mid-operation, you can end up with various results like
- char has lost new items
- char has duped old items

And this is not limited to storage, as other stuff is written this way.
- memo points are done using "DELETE everything, then INSERT everything"
- skills as well!
- player variables too!

Heck, even single queries are unsafe. Any non-transactional multi-row query that gets interrupted in the middle of processing will leave the db in a rather inconsistent state. And you will never even know whether it happened or not.
QUOTE
In InnoDB, all user activity occurs inside a transaction. If the autocommit mode is enabled, each SQL statement forms a single transaction on its own. By default, MySQL starts new connections with autocommit enabled.
InnoDB on the other hand, has no such problems because each single-query is automatically atomic.

I do not know why people insist on using MyISAM when tests in the mysql docs say that a non-flushing InnoDB database has clearly superior performance, and guarantees that the data will not suddenly become junk when something happens...
Hey, MyISAM users! Are you feeling lucky today?!

This post has been edited by theultramage: Mar 23 2008, 03:56 AM