laketuna
laketuna

Reputation: 4080

MySQL: START TRANSACTION sets 'autocommit' to off?

When I execute START TRANSACTION followed by SHOW VARIABLES LIKE 'autocommit' immediately, I see that the variable autocommit is still set to ON. Isn't this supposed to set to OFF until I explicitly say COMMIT?

Source: http://dev.mysql.com/doc/refman/5.0/en/commit.html

Upvotes: 2

Views: 695

Answers (1)

invertedSpear
invertedSpear

Reputation: 11054

It is my understanding that transactions just ignore the autocommit setting. So starting a transaction won't change the value of the autocommit variable. This makes sense as you would not want one user a's transaction to disable user b's autocommit while user a's transaction is processing.

This is not obvious by reading the document unless you read "autocommit mode" and "autocommit variable" as being two different things, which they are.

Upvotes: 2

Related Questions