
125 Cal.App.2d Supp. 908 (1954)
O. R. DAVISON et al., Appellants,
v.
CLIFFORD C. ANDERSON, Respondent.
California Court of Appeals. 
June 9, 1954.
 Gilbert Moody for Appellants.
 Daniel E. O'Connell for Respondent.
 HALBERT, J.
 This is an appeal from an order of the trial court cancelling a judgment and writ of execution under the provisions of Code of Civil Procedure, section 675b. This order was in favor of, and relates solely to the defendant, Clifford C. Anderson, who is also known as C. C. Anderson. Hereinafter he will be referred to as respondent, and the plaintiffs will be referred to as appellants.
 This proceeding arose out of an action to foreclose a chattel mortgage given by respondent and his wife to appellants. Since the sequence of the prior events relating to this case will have a strong bearing upon the ultimate decision, a brief history of the case is necessary.
 [1a] The respondent was adjudged a bankrupt on July 26, 1951, and he was granted his discharge in bankruptcy on April 11, 1952. On May 29, 1952, the appellants were granted permission in the bankruptcy proceeding to institute the present action. This action was commenced on September 10, 1952, by a complaint for foreclosure wherein the usual relief, including a deficiency judgment, was prayed for by appellants. On October 24, 1952, respondent filed his answer. The answer was, for all practical purposes, a general denial, the matter of bankruptcy not being mentioned in it. On February 2, 1953, the case was called for trial, and the respondent then stipulated without reservation that judgment might be entered against him. On March 20, 1953, judgment was entered against respondent granting appellants all relief asked for in the complaint, including the right to seek a deficiency judgment. A foreclosure sale was then had in accordance with the judgment, and a return on the sale was made to the trial court. The appellants thereafter sought and obtained a deficiency judgment [125 Cal.App.2d Supp. 910] against the respondent on August 6, 1953. The respondent had notice of all these proceedings, but made no objection to them prior to filing the proceeding out of which this appeal grows. On August 20, 1953, respondent filed the instant proceeding seeking his discharge from the judgment under the provisions of section 675b of the Code of Civil Procedure, and the trial court granted his motion of February 15, 1954. This appeal followed.
 The only issue on this appeal is whether, under the record in this case, the respondent was entitled to the relief granted him. We think he was not. The only way that the relief granted respondent can be sustained is to place a strained construction upon the provisions of Code of Civil Procedure, section 675b. This, we believe, is neither required nor proper. [2] A common-sense construction, which brings about justice, should always be placed upon legislation. The pertinent portions of Code of Civil Procedure, section 675b, read as follows:
 "If it appears upon the hearing that he [the bankrupt] has been discharged from the payment of that judgment or the debt upon which such judgment was recovered, an order must be made directing said judgment to be cancelled and discharged of record."
 [1b] Obviously, the judgment in this case was not discharged by respondent's discharge in bankruptcy, for the action upon which it is founded was not commenced until after the respondent had been granted his discharge in bankruptcy. The sole question, then, is whether the debt upon which the judgment is founded was discharged, and if so, whether the judgment itself must therefore fall. The record indicates that the debt was discharged, but under the peculiar facts of this case, the respondent can obtain no comfort from that fact, for he stipulated that judgment might be entered against him on this debt after he had received his discharge in bankruptcy. His stipulation that judgment might be entered against him is tantamount to an acknowledgment of the debt, and an agreement to pay it. [3] There was ample consideration for this new agreement, for even though the remedy to enforce the debt, discharged by the proceedings in bankruptcy, was gone, the moral obligation to pay the debt remained, and constituted sufficient consideration to support the new promise to pay. (Civ. Code,  1606; 12 Cal.Jur.2d 235; Lambert v. Schmalz, 118 Cal. 33 [50 P. 13].) [4] Furthermore, a stipulation for a judgment is a consent to the entry of the judgment and is a waiver of errors by the party consenting thereto. Such a judgment [125 Cal.App.2d Supp. 911] so entered will not be disturbed on appeal. (Morrow v. Learned, 76 Cal.App. 538 [245 P. 442]; 14 Cal.Jur. 878.)
 As we view the record in this case, the respondent had full knowledge of all of the proceedings and affirmatively participated in them. He never, at any time, sought relief from the judgment under Code of Civil Procedure, section 473, on the ground that it was entered through mistake, inadvertence, surprise or excusable neglect. Such being the case, we must presume that the judgment as entered correctly and properly reflected the stipulation between the parties at the time the case came on for trial. Likewise, the respondent never at any time prior to the entry of judgment sought to plead the defense of his discharge in bankruptcy. [5] If he wished to take advantage of his discharge in bankruptcy as a defense, it was his duty to plead it, for it is a plea in bar, and must therefore be specially and affirmatively pleaded. (Luse v. Peters, 219 Cal. 625 [28 P.2d 357]; Tuttle v. Scott, 119 Cal. 586 [51 P. 849]; Holmes v. Justice's Court, 19 Cal.App.2d 362 [65 P.2d 820].)
 Respondent has cited to us several authorities which hold that the provisions of section 675b of the Code of Civil Procedure are available to him, even when the action against him is brought on a discharged debt after his discharge in bankruptcy; and this, even though this action actually goes to a default judgment. We appreciate that problem and have considered it, but the authorities cited by him do not approach the problem here. In all of the authorities that have been cited to us, the judgment was entered after default of the debtor. [1c] No authority has been called to our attention, and we are unable to find any authority, which holds that a bankrupt debtor may appear in an action brought by his creditor on a discharged debt, stipulate for judgment, and then, after the judgment has been entered on his stipulation, seek relief under the provisions of section 675b of the Code of Civil Procedure. There are a host of cases holding that if a debtor fails to affirmatively plead the bar of his discharge in bankruptcy and the case goes to judgment, he has waived his right to that defense. (Maryland Cas. Co. v. Lipscomb, 40 Cal.App.2d 171 [104 P.2d 525]; Harrell v. Hoagland, 18 Cal.App.2d 721 [64 P.2d 953]; Holmes v. Justice's Court, 19 Cal.App.2d 362 [65 P.2d 820]; Tuttle v. Scott, 119 Cal. 586 [51 P. 849].) We do not think the rule should be otherwise in situations such as we now have before us. We think that any bankrupt [125 Cal.App.2d Supp. 912] debtor who actually appears in an action on a debt claimed by him to be discharged in bankruptcy must plead that defense in the action, and if he fails to do so, he waives his right to claim relief under Code of Civil Procedure, section 675b Any other rule would allow the bankrupt debtor to lure his creditors into the expenditure of needless time, effort and money, to trifle with the court, and to needlessly take up time of all concerned only to have him defeat the claim by the identical defense that he could have raised long before in the very same proceeding. This, we believe, would be a travesty on justice, and common sense dictates that it should not be permitted.
 Accordingly, the order of the trial court cancelling the judgment in this case, and cancelling the writ of execution issued on said judgment, insofar as they apply to the respondent, is reversed, and the cause is remanded to the trial court with directions to enter an order denying the respondent the relief sought by him under the provisions of Code of Civil Procedure, section 675b.
 Hawkins, P. J., and Chamberlain, J., concurred.
