
68 Cal.App.2d 821 (1945)
THEODORE A. SIMPSON et al., Petitioners,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY et al., Respondents.
Civ. No. 14797. 
California Court of Appeals. Second Dist., Div. One.  
Apr. 24, 1945.
 Lindstrom & Bartlett and Lecompte Davis for Petitioners.
 Katz, Gallagher & Margolis, Willis O. Tyler and Loren Miller for Real Parties in Interest.
 DORAN, J.
 This petition for a writ of prohibition relates to the validity of dismissals filed in three actions in respondent superior court.
 The record reveals that the three actions in question were assigned to department eleven of said superior court for trial; that the trial commenced on the afternoon of December 7th and continued throughout the following day, December 8th. At the conclusion of the court session on said last mentioned date, the trial was continued to Monday morning, December 11th. Plaintiff's case had not been completed when, on the morning of December 11th, before the court convened, plaintiffs (petitioners herein) filed with the clerk of respondent court, dismissals without prejudice, together with a written tender of costs in connection therewith. The clerk of said court duly filed said dismissals and entered the same upon the register of actions.
 At the opening of the session of said court, defendants disputed *823 the validity and effect of said dismissals, and made a motion to set aside said dismissals. Over the objection of plaintiffs, who then and there contended that said court was without jurisdiction to entertain such motion, or to proceed further with any matters pertaining to said actions, the court heard argument after which an order was made and entered purporting to grant said motion and to set said dismissals aside.
 The complaints in the three actions which were consolidated for trial, seek to enjoin defendants from violating certain race restrictions contained in the deeds to the property described in said actions.
 Respondents take the position that, "This case involves the right of petitioners herein (plaintiffs below) to dismiss an injunction action (1) after stipulating that a motion to exclude all evidence was submitted, to be ruled upon before the case was closed and (2) despite the fact that the respective answers to the three complaints consolidated for trial requested affirmative relief as set forth in numerous affirmative defenses concluding with the prayer for such relief as might be equitable."
 With regard to plaintiff's right to dismiss the action after the stipulation referred to respondents argue that, "At the time that petitioners (plaintiffs below) dismissed the three complaints involved herein, which had been consolidated for trial, there was pending before the trial court for determination and decision a motion that all evidence be excluded on various grounds including the ground that the complaint did not state facts sufficient to constitute a cause of action," and "that the parties had stipulated that there should be a determination of the question of the legal sufficiency of the complaint by the trial judge which estopped plaintiff from exercising the usual right to dismiss in a proper case." The record reveals that defendants, at the trial, objected to the introduction of any testimony on various grounds and in that connection appears the following:
 "I think your honor will be able to pass upon these points much better at the conclusion of the case than now. I ask the ruling on the objection be held until the conclusion of the case when the evidence is in and argument permitted then."
 "The Court: Is that satisfactory?"
 "Mr. Davis: Provided the court will pass upon them before the case is submitted. *824"
 "The Court: Oh, yes; that is a suggestion."
 "Mr. Margolis: And without repeating the objection, I would like to have a stipulation that the objection be deemed made to each and every witness and to each and every question."
 "Mr. Bartlett: So stipulated. I am perfectly willing to argue now or at the conclusion of the evidence."
 "The Court: Apparently that is agreeable to both sides. You may proceed."
 [1] It is the foregoing that respondent contends foreclosed plaintiffs from dismissing the actions. There is no merit to such contention. As petitioners point out, "The most that could possibly be said from the record is that as a matter of convenience it was determined to defer defendants' objection until after the evidence had been taken and that such objection would then be first argued and, after argument, would be submitted."
 [2] With reference to respondent's contention that the answers requested affirmative relief, it should be noted at the outset that the expression "affirmative relief sought" as provided by section 581 of the Code of Civil Procedure, does not include mere defensive matter, by whatever name it may be called. The answers to the three actions, in addition to the denials in the usual form, alleged from eight to fifteen separate defenses in substance that, the complaints do not state a cause of action; that the declaration of restrictions was void and in violation of the Constitutions of the State of California and of the United States; that said restrictions were against public policy; that said declaration of restrictions was not duly signed and lacked adequate consideration; that necessary parties are not included; that said restrictions constitute an "illegal restraint upon alienation; that the period of time provided for is indefinite; that the enforcement of said restrictions would be inequitable; that the defendants acquired the property in question without notice; and that the character of the community had changed."
 The prayers were in the usual form, namely, that plaintiffs take nothing and that defendants have judgment and "for such other and further relief as to the court may seem just and equitable."
 It is at once evident from the foregoing that the only issues raised by the pleadings were whether the contract in question *825 was valid and enforceable and whether its enforcement would be equitable.
 The answers were no more than a variety of defenses set up to defeat the action. Indeed, whether any affirmative relief in such an action is available, is at least problematical.
 [3] By affirmative relief as used in section 581 of the Code of Civil Procedure is meant the allegation of new matter which in effect amounts to a counterattack. In other words, the relief sought, if granted, operates not as a defense but, affirmatively and postively to defeat plaintiff's cause of action. [4] The privilege of dismissing an action as provided by section 581 is designed to afford to the plaintiff a certain freedom of action within the limits prescribed that cannot be circumscribed indirectly. Any attempt to wrest such control in any manner except as provided and clearly intended by its provisions, is ineffective for all purposes.
 [5] In the light of the record herein, the court was without power to entertain the defendants' motion to set aside the dismissals, and such action, as well as the procedure that followed, was without legal sanction and void.
 Let a peremptory writ of prohibition issue as prayed for.
 York, P. J., and White, J., concurred.
