The court or presiding judge in all cases of jury trial may discharge the jury without giving a verdict, with the consent of all parties to the trial or without the consent of the parties, when, in the opinion of the court or judge, there is a manifest necessity for the discharge or when the ends of justice would otherwise be defeated. In all cases in which the jury is discharged without a verdict, a mistrial shall be entered upon the minutes of the court, assigning the reason or cause for the mistrial, and no person shall gain any advantage by reason of such discharge of the jury.
Ala. Code § 12-16-233 (1975)