Fixing strange behavior of the mysql driver