"InnoDB doesn't really support transactions" - what? [closed]
Our system engineer takes every opportunity to remind everyone how much he hates MySQL, and how much he loves postgres and that we need to switch. His complaints sometimes seem reasonable, but recently they've included the ridiculous. One of the things he's claiming now is that "InnoDB doesn't really do transactions. It only pretends to." Yes, that's a direct quote. In fact, he claims that all of the transaction related commands in innodb are in fact NOPs. Here's a paraphrasing of something he just said about five minutes ago:
"I found that out recently, because I keep everything in a transaction. I went to do a rollback, and it wouldn't let me. After some digging I found out that all of the transaction commands in innodb are actually NOPs."
This sounds patently ridiculous to me. It would mean no one has ever successfully rolled back a transaction using innodb, or in fact even performed one. It would mean the developers of innodb are outright lying, and think we are all stupid enough to fall for their fakery.
Is there any possible way, in the slightest, that there is a grain of truth to his claims? Or maybe, that there's some twiste开发者_JAVA技巧d way to interpret this in a way that doesn't sound so crazy?
edit to clarify: I'm not trying to rant. I'm asking, since I can't find evidence of his claims, whether he is outright wrong, or whether there's some truth that I should be aware of.
You can prove this wrong: Create an InnoDB Table with some dummy data, then
BEGIN TRANSACTION
then do something stupid like
DELETE FROM TABLE
(note the missing where clause) and then do a
ROLLBACK
and when the data in the table is mysteriously there again, InnoDB has transactions and your collegue is just - misinformed.
Note that he might just mixed up InnoDB with MyISAM.
No. This is just wrong. I bet he has his InnoDB commit flush set wrong, so that transaction are not able to roll back.
The basic answer is: the entire point of InnoDB is transactions, and row level locking, but transactions is an integral part of InnoDB.
Also he could be doing something stupid like not turning off AutoCommit and thus each SQL statement in his "transaction" is committing and thus turning into its own transaction.
精彩评论