The Diamondbacks have traded John McDonald to the Pirates for a player to be named or cash.

The trade came two days after Pittsburgh backup shortstop Chase d'Arnaud, injured in a rundown drill earlier, had surgery for a torn ligament in his left thumb.

McDonald, 38, hit .249 with six homers and 22 RBIs in 70 games for Arizona last season.