[fix] Escape special characters as per MySQLdb