The sheriff shall require the defendant to enter into a bond, with sufficient surety, personally to appear within the time allowed by law for answering the complaint, and to abide the order of the court; and in default thereof the defendant shall be committed to prison until discharged in due course of law; such special bail shall be liable for the principal, and shall have a right to arrest and deliver him or her up, as in other cases, and the defendant may give other bail.