Patches to mysql.php