Identifying MgCl2 or CaCl2 in solution
$\ce{MgSO4}$, otherwise known as epsom salt, is soluble. $\ce{CaSO4}$ ($K_\mathrm{sp}=7.1 \times 10^{-5}$), is slightly soluble. It is extremely likely that unless there are some other unknown metal ions in this solution, the white precipitate you describe in the solution is $\ce{CaSO4}$.