CaptTofu/DBD-mysql — pull request #27 by wolfsage (2012-08-07 16:00:01+00:00)
Title: Fix AutoCommit comparison logic to avoid spurious commands to mysql

The code to check when you set AutoCommit on the handle was incorrectly comparing the old value with the new value, causing spurious "set auto_commit = 1" queries to be sent to the database. This was especially noticeable when Apache::DBI was in use, there would be 2 "set auto_commit = 1" queries before every actual query.

I'm not sure how to write an automated test for this, but you can see the broken behaviour by doing:
```perl
$dbh->{AutoCommit} = 1;
$dbh->{AutoCommit} = 1;
$dbh->{AutoCommit} = 1;
```

At most this should cause 1 "set_autocommit = 1" if AutoCommit is not already enabled, not 3.

--
Matthew Horsfall (alh)
http://dyn.com