File upload with single quote in filename

I was unable to find a thread for this which surprises me, or maybe its not a bug and I am doing something wrong?

It seems that if a filename has a single quote in it, it is not escaped before being sent to the database. This creates an error and the file cannot be saved. This is only an issue when using MySQL PDO. MySQLi works correctly.