If the undertaking required by the last section is given, the party informed of must be discharged. If he does not give it, the magistrate must commit him to prison, specifying in the warrant the requirement to give security, the amount thereof and the omission to give the same.