Intraoperative infusion of acetated Ringer solution containing glucose and ionized magnesium reduces ketogenesis and maintains serum magnesium.