autocommit should be disabled always by default

eos's profile image eos posted 8 years ago in Feature discussion Permalink

you should always be able to commit or rollback changes.

I am sure that heidisql used to have autocommit off, but now it seems to be on by default, with no way to disable it (except by hand every time you open a database which is a huge drag and I keep forgetting)

Autocommit is evil and dangerous.

ansgar's profile image ansgar posted 8 years ago Permalink

HeidiSQL never touched the autocommit variable, ever. But you can set it off via auto-started SQL script, in the advanced session settings.

kalvaro's profile image kalvaro posted 8 years ago Permalink

HeidiSQL never touched the autocommit variable, ever. But you can set it off via auto-started SQL script, in the advanced session settings.

That's right. Just remember that transactions do not work in all storage engines so try not to rely a lot on this to avoid unexpected data loss:

mysql> show engines;
+--------------------+- ... -+--------------+------+------------+
| Engine             |  ...  | Transactions | XA   | Savepoints |
+--------------------+- ... -+--------------+------+------------+
| FEDERATED          |  ...  | NULL         | NULL | NULL       |
| MRG_MYISAM         |  ...  | NO           | NO   | NO         |
| MyISAM             |  ...  | NO           | NO   | NO         |
| BLACKHOLE          |  ...  | NO           | NO   | NO         |
| CSV                |  ...  | NO           | NO   | NO         |
| MEMORY             |  ...  | NO           | NO   | NO         |
| ARCHIVE            |  ...  | NO           | NO   | NO         |
| InnoDB             |  ...  | YES          | YES  | YES        |
| PERFORMANCE_SCHEMA |  ...  | NO           | NO   | NO         |
+--------------------+- ... -+--------------+------+------------+
eos's profile image eos posted 8 years ago Permalink

HeidiSQL never touched the autocommit variable, ever. But you can set it off via auto-started SQL script, in the advanced session settings.

This looks like a good option, but I would like to set it globally - I have more than 30 database sessions defined - all mysql or percona with Innodb.

[expired user #11123]'s profile image [expired user #11123] posted 7 years ago Permalink

Ansgar, please consider to add "commit" and "rollback" buttons in the UI, the lack of this feature is the main reason why we chose another product for our company. It is true that transactions don't work work with all engines, but nowadays InnoDB (or XtraDB) are the most used.

Please login to leave a reply, or register at first.