The mucus of the stomach contains bicarbonate which lubricates the stomach wall to protect it from getting digested by the hydrochloric acid present in the stomach. If mucus is not secreted by the gastric glands, the walls of the stomach will get digested by the HCl secreted there.