The Giants purchased the contract of infielder Ehire Adrianza prior to Tuesday night's game against the Marlins, and designated veteran Casey McGehee for assignment.