Upon the plaintiff dismissing his suit, or defendant dismissing the same for want of prosecution, the defendant shall recover against the plaintiff his costs; and in all other cases it shall be in the discretion of the court to award costs or not, except in those cases in which a different provision is made by law.
§ 514.170, RSMo