Make Enclose Export in Transaction checked by default when exporting #12960

dlangh opened this Issue Feb 6, 2017 · 4 comments


None yet

3 participants

dlangh commented Feb 6, 2017

Steps to reproduce

  1. In my case I've been working through exporting views, so select one or more views then choose Export
  2. On the export screen, click on 'custom' to open up all available export options.
  3. By default the option 'Enclose Export in Transaction' is not checked, imho it should be

Expected behaviour

This is not a bug, but feature request to have the option 'Enclose Export in Transaction' checked by default. In the case of views if it's not checked and something goes wrong, you end up with the temporary tables that were created for views remaining and it's quite a mess, I would like to see either it simply be checked by default, or at least a new setting for exports that you could set the default for your phpMyAdmin installation (I saw there is already a settings tab for export so it would not be a lot of work to create a new option there). Personally I think it would always be better to have it be a transaction since I doubt most people would actually want a partial import after an error but rather be able to correct the error and re-import. With the checkbox still there (certainly not advocating getting rid of it as an option) one could still uncheck and create an export that isn't wrapped in a transaction if they needed to, but I think most people would be better served with this enabled.

Actual behaviour

The option 'Enclose export in a transaction' is always unchecked when you first get to the export screen.

Server configuration

Operating system: Ubuntu 16.04

Web server: 2.4.18

Database: 5.7.17

PHP version: 7.0.13

phpMyAdmin version: 4.6.6

Client configuration

Browser: Firefox 51/chrome 56

Operating system: Mac OS Sierra

nijel commented Feb 6, 2017

You can change the default for your installation using:

$cfg['Export']['sql_use_transaction'] = true;

This feature was added in 7dbba54 (#5185) and defaults to disabled as most people used MyISAM by that time where transactions are not supported. Maybe it's time to revisit this decision now...

@nijel nijel self-assigned this Feb 6, 2017
@nijel nijel added the enhancement label Feb 6, 2017
dlangh commented Feb 6, 2017

Thanks for the quick reply!!

While I do think it would be beneficial to re-evaluate if users can control this with a default, especially now that MySQL 5.7 defaults to innodb, being able to set this in the file will suit my needs for now.




You make a pretty good argument for why this should be changed, I agree that we should re-examine this decision to see whether it's worth changing now.

@nijel nijel added this to the 4.7.0 milestone Feb 7, 2017
@nijel nijel added a commit that closed this issue Feb 7, 2017
@nijel nijel Enclose exports in transaction by default
Fixes #12960

Signed-off-by: Michal Čihař <>
@nijel nijel closed this in 63db3da Feb 7, 2017
nijel commented Feb 7, 2017

I've changed the default value for 4.7.0 - I don't think this causes any harm as it's ignored on engines which do not support transactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment