An aqueous solution of salt of sodium (NaX) on boiling with MgCI2 gives white precipitate, hence anion X is:
2NaHCO3+MgCl2→MgCO3+2NaCl+H2O+CO2