Drupal 7, MySQL, InnoDB, and transactions I was reading default.settings.php for Drupal 7.x this afternoon, and came across this comment:

/*
 * Some database engines support transactions.  In order to enable
 * transaction support for a given database, set the 'transactions' key
 * to TRUE.  To disable it, set it to FALSE.  Note that the default value
 * varies by driver.  For MySQL, the default is FALSE since MyISAM tables
 * do not support transactions.
 */


This is different in Drupal 8:

/*
 * Transaction support is enabled by default for all drivers that support it,
 * including MySQL. To explicitly disable it, set the 'transactions' key to
 * FALSE.
 * Note that some configurations of MySQL, such as the MyISAM engine, don't
 * support it and will proceed silently even if enabled. If you experience
 * transaction related crashes with such configuration, set the 'transactions'
 * key to FALSE.
 */


So, how does db_transaction() work then on MySQL in Drupal 7?

Is this comment outdated, or should I explicitly set 

$databases['default']['default']['transactions'] = TRUE;


if I know everything is InnoDB (which is the default for Drupal 7.
The constructor for the DatabaseConnection_mysql class, has this code and comment:

public function __construct(array $connection_options = array()) {
  // This driver defaults to transaction support, except if explicitly passed FALSE.
  $this-&gt;transactionSupport = !isset($connection_options['transactions']) ||
    ($connection_options['transactions'] !== FALSE);


In addition, there is support and workaround for the MySQL implementation of transactions (including no proper support for DDL transactions).

This suggests that the documentation in the settings file is incorrect.