I have 2 drupal installations. Same version 4.6.3 on both. What are some reasons a patch would have failed on 1 server but not the next ? The failures were:

patch -p0 < 4.6.3.patch

patching file includes/database.mysql.inc
Hunk #1 FAILED at 63.
1 out of 1 hunk FAILED -- saving rejects to file includes/database.mysql.inc.rej
patching file includes/database.pgsql.inc
Hunk #1 FAILED at 59.
1 out of 1 hunk FAILED -- saving rejects to file includes/database.pgsql.inc.rej

Contents of the database.mysql.inc.rej were:

***************
*** 63,69 ****
return $result;
}
else {
- trigger_error(mysql_error() ."\nquery: ". htmlspecialchars($query), E_USER_ERROR);
return FALSE;
}
}
--- 63,69 ----
return $result;
}
else {
+ trigger_error(check_plain(mysql_error() ."\nquery: ". $query), E_USER_ERROR);
return FALSE;
}
}

I can manually make this change to the file, but just wondering where it might have failed. All the other file changes went fine.