Fix a bug where DB() tried to set the MySQL-specific 'sql_mode' on all drivers

Supersedes PR #2756