Oil, gasoline climb to records as investors move to commodities