
103 Cal.App.3d 770 (1980)
163 Cal. Rptr. 233
THE PEOPLE, Plaintiff and Appellant,
v.
BARBARA HERTZ et al., Defendants and Respondents.
Docket No. 34747.
Court of Appeals of California, Second District, Division Three.
March 25, 1980.
*771 COUNSEL
John K. Van de Kamp, District Attorney, Donald J. Kaplan and John W. Messer, Deputy District Attorneys, for Plaintiff and Appellant.
Hugh R. Manes, Tom Stanley, Leo Guevara, David Weitzman, Michael L. Kogan, Warren Soloski, Gilbert Moret and Stephen Gilbert for Defendants and Respondents.
*772 OPINION
KLEIN, P.J.
The People appeal from superior court dismissals under Penal Code section 995[1] of nine counts of assault with a deadly weapon upon police officers (Pen. Code, § 245, subd. (b))[2] against respondents Barbara Hertz, Edgar G. Hernandez, Gustavo A. Bracho, William Greenberg, Antonio Marko, and William Parker.

STATEMENT OF THE CASE
The respondents filed motions for discovery in the municipal court prior to the preliminary hearing, to which the prosecution responded. The magistrate conducted hearings on the motions,[3] and on the Los Angeles Police Department (LAPD) claim of privilege for certain "official information" pursuant to Evidence Code sections 915, subdivisions (a) and (b) and 1040, subdivision (b).[4]
*773 At the close of the month-long preliminary hearing, the magistrate bound the respondents over on the crimes as charged with the exception of one count against Hernandez. The People refiled the dismissed count against Hernandez in the superior court, which count was subsequently dismissed by the superior court.
At the hearing on the Penal Code section 995 motions, the parties agreed that the superior court could consider the discovery proceedings conducted by the magistrate, part of which proceedings were contained in the transcript of the preliminary hearing, in its ruling.
The superior court dismissed the charge against Hertz, finding an illegal commitment, after determining that Hertz' offer of proof on the defense of discriminatory enforcement was adequate and that Hertz should have been allowed to pursue the defense at the preliminary hearing.
The superior court further dismissed the charges against all defendants because the magistrate had failed to preserve a reviewable record of the in camera hearing conducted during discovery proceedings held prior to the preliminary hearing, which failure resulted in illegal commitments, although the court made the observation that the "question of law ... [is] obviously one that's not been authoritatively resolved by high appellate courts."[5]
The People appeal the dismissals.


*774 FACTS
Respondents are members of the Progressive Labor Party/Committee Against Racism (PLP/CAR). On February 11, 1978, they took part in a PLP/CAR demonstration near the corner of 7th Street and Grand Avenue in downtown Los Angeles. Approximately 50 to 60 people participated by marching and carrying placards affixed to 2-inch by 2-inch by 4-foot sticks.
Los Angeles police officers on routine patrol noticed the demonstration, monitored its activities and called additional back-up units to assist. A brief scuffle occurred between members of the PLP/CAR and police officers, resulting in injuries to both sides. Twelve demonstrators who used their sticks as clubs were arrested for assaulting police officers.

CONTENTIONS
The People contend that the superior court erred in dismissing: (1) the charge against Hernandez as there was sufficient evidence adduced at the preliminary hearing to hold Hernandez for trial; (2) the charge against Hertz because the defense of discriminatory enforcement was not properly raised at the preliminary hearing; and (3) the charges against respondents, since the in camera hearing was properly held pursuant to section 915, subdivision (b).

SUMMARY
We concur with the granting of a Penal Code section 995 motion as to Hertz, on the ground that the transcript disclosed the defense of discriminatory enforcement had been properly raised by an offer of proof at the preliminary hearing, and therefore Hertz should have been given the opportunity to pursue such a defense.
We also agree with the superior court rationale that the failure of the magistrate to create a reviewable record of the in camera proceeding during discovery hearings caused the binding over of the respondents for trial to be illegal, requiring the granting of the Penal Code section 995 motions.
Although we believe that the refiled count against Hernandez was improperly dismissed on the section 995 motion on the ground of insufficiency *775 of the evidence (People v. Farley (1971) 19 Cal. App.3d 215, 221-222 [96 Cal. Rptr. 478]), such perception is irrelevant in view of the proper dismissals against all respondents.

DISCUSSION
(1) Settled case law has substantially expanded the function of the preliminary hearing from a perfunctory proceeding wherein a magistrate makes the simple determination as to whether "there is sufficient cause to believe the defendant guilty [of a public offense]" (Pen. Code, § 872) to a full-blown hearing allowing for the presentation of affirmative defenses.
In Jennings v. Superior Court (1967) 66 Cal.2d 867 [59 Cal. Rptr. 440, 428 P.2d 304], a defendant charged with possession of narcotics was denied the right to present the affirmative defense of entrapment at the preliminary hearing by the magistrate's ruling cross-examination of police officer witnesses was not relevant to the issue before the court. The Supreme Court held that restriction of defendant's cross-examination in a case wherein defendant intends to present an affirmative defense constitutes a denial of a substantial right, resulting in an unlawful commitment, despite evidence of probable cause to hold defendant for trial.
"`"The purpose of the preliminary hearing is to weed out groundless or unsupported charges of grave offenses, and to relieve the accused of the degradation and expense of a criminal trial.... [Citations.]"' To effectuate this constitutional and statutory purpose the defendant must be permitted, if he chooses, to elicit testimony or introduce evidence tending to overcome the prosecution's case or establish an affirmative defense." (Id., at p. 880.) (Saulter v. Municipal Court (1977) 75 Cal. App.3d 231, 247-248 [142 Cal. Rptr. 266]; People v. Partlow (1978) 84 Cal. App.3d 540, 551 [148 Cal. Rptr. 744].)
In Murgia v. Municipal Court (1975) 15 Cal.3d 286 [124 Cal. Rptr. 204, 540 P.2d 44], the Supreme Court held that discriminatory enforcement of the law could be asserted as an affirmative defense to a criminal prosecution. Consistent with the accepted expanded notion of preliminary hearings, there is no logical reason why the affirmative defense of discriminatory enforcement cannot be raised at that stage of criminal prosecutions.
*776 The defense of discriminatory enforcement is not unlike that of entrapment in that in either situation, a defendant does not necessarily contend that he did not commit the criminal act charged with the requisite intent, but rather that because of the tainted conduct of law enforcement personnel, he should not be punished. (People v. Salas (1975) 51 Cal. App.3d 151, 158 [123 Cal. Rptr. 903].)
We note that in Jennings v. Superior Court, supra, 66 Cal.2d 867, the fact that the defendant therein was attempting to raise the specific affirmative defense of entrapment at the preliminary hearing did not concern the Supreme Court; it was rather the magistrate's refusal to allow any affirmative defense at that "stage" of criminal proceedings against the defendant. (Id., at p. 873.)
The superior court herein found that the offers of proof made by the attorney for Hertz to the effect that Hertz was being harassed by members of the LAPD for her use of a hand-carried bullhorn, that the demonstrations of the PLP/CAR were monitored by LAPD solely because of the ideology and beliefs of the organization, and that what occurred at the February 11 incident grew out of a desire by the LAPD to get revenge on the PLP/CAR for injuries allegedly inflicted on LAPD officers unlawfully by PLP/CAR members during prior confrontations, were adequate to allow Hertz to pursue the defense of discriminatory enforcement through cross-examination.
We concur with the ruling that because the magistrate thusly precluded Hertz' attorney from cross-examination, stating, "I would point out, once again, this is a preliminary hearing; and such matters are not relevant to the issues before this Court," this caused Hertz to be unlawfully committed within the contemplation of Penal Code section 995, as interpreted by the aforementioned cases. The section itself merely states that an information must be set aside "[i]f ... before the filing [of the information] the defendant had not been legally committed by a magistrate."
(2) If we conclude a defendant has a right to present an affirmative defense at a preliminary hearing, which now seems clear (Jennings v. Superior Court, supra, 66 Cal.2d 867; McDaniel v. Superior Court (1976) 55 Cal. App.3d 803, 805 [126 Cal. Rptr. 136]), in order for that right to be meaningful, it must include the opportunity to obtain discovery prior to the hearing. (Theodor v. Superior Court (1972) 8 Cal.3d 77, 90 [104 Cal. Rptr. 226, 501 P.2d 234]; Saulter v. Municipal Court, *777 supra, 75 Cal. App.3d 231.) In pursuit of discovery of information that could have been used for the affirmative defense of discriminatory enforcement and "for the purpose of discrediting the prosecution's evidence" (Jennings v. Superior Court, supra, at p. 879) by showing bias and prejudice on cross-examination, respondents herein sought certain information which was not included in the 133-page document submitted by the prosecution in response to the motions for discovery.
The document contained, inter alia, fingerprint cards, police reports, booking information, names of victims, statements of witnesses and newspaper clippings. However, respondents demanded additional information contained in certain police intelligence files, which demand prompted the claim by a representative of the LAPD that the information was "official information" and as such, was privileged under sections 915, subdivision (b) and 1040.
The magistrate agreed to hold an in camera proceeding to determine the validity of the claim, and was persuaded by the prosecution's interpretation that section 915, subdivision (b) disallowed the presence of a court reporter to transcribe the proceeding. Counsel representing all respondents vociferously argued such proceeding would cause the magistrate's decision to be "unreviewable" and would create a violation of due process of law, and would be a "star chamber proceeding."
In the absence of any further guidance in clarification of the ambiguities inherent in section 915, subdivision (b), the magistrate concluded that he would proceed "out of the presence and hearing of all persons except the persons authorized to claim privilege."
About 50 minutes after the magistrate and the LAPD representative, Lieutenant Kilgo, recessed to chambers, the magistrate reconvened and announced he had reviewed 21 separate items and found "that 11 of those items are in fact privileged and it would be against public policy and the public interest to disclose [the] items, inasmuch as street informants may be and in fact could be named in those reports and might be endangered by turning over said reports to public scrutiny." The magistrate further found the documents to be not material. The magistrate refused to mark the individual documents or to seal those viewed in *778 camera, opining that to do so would frustrate the purpose of section 915, subdivision (b), but did order Kilgo to retain them.
The magistrate agreed to continue his inquiry concerning the issue of privilege as suggested by the procedure adopted in People v. Superior Court (Biggs) (1971) 19 Cal. App.3d 522 [97 Cal. Rptr. 118], "... in an adversary setting, probing the information's relevance to the defense, exploring with counsel the availability of other alternatives...." (Id., at p. 531.) Kilgo was examined at great length by defense counsel, coincidentally with the preliminary hearing by agreement of the parties.
However, as we have noted, in the process the cross-examination of police officers regarding crucial subject matter was inappropriately curtailed. Further, the court in Biggs was far from sanguine that the additional adversary procedures it recommended would address all the problems raised by an "unreported and unrecorded" in camera hearing. (Id., at p. 527.) At page 531 the court observed: "Evidence Code section 915, subdivision (b), withholds from court and counsel any invitation to explore and balance additional alternatives which might fulfill the defendant's needs and protect the government's interests. It leads to all-or-nothing rulings when better solutions might be available. It hinders the pruning out of material which the government wishes to seal and which is not really meaningful to the defense. It supplies no record of the proceedings in case the defendant, on appeal from an ultimate conviction, assails an unfavorable ruling." (Italics added.)
In a subsequent case, People v. Woolman (1974) 40 Cal. App.3d 652 [115 Cal. Rptr. 324], during the course of motions at trial, the People claimed the privilege provided in section 1040, subdivision (b), the same privilege asserted in this case. An in camera hearing was conducted by the trial judge, at which the reporter was present. The appellate court in review "... examined the file tendered to the trial court at the in camera hearing and agree[d] with that court's ruling; ..." (Id., at p. 654.)[6]
*779 The prosecution argues that because section 1042 was amended to include subdivision (d), which specifically states, "... A reporter shall be present at the in camera hearing. Any transcription of the proceedings at the in camera hearing, as well as any physical evidence presented at the hearing, shall be ordered sealed by the court, and only a court may have access to its contents...." and sections 915, subdivision (b) and 1040, subdivision (b) were not so amended, the Legislature intended that in camera hearings conducted pursuant to sections 915, subdivision (b) and 1040, subdivision (b), preclude the presence of reporters and subsequent transcriptions.
Although we do not find that rationale persuasive, we admit there is a dearth of legislative history from which to glean legislative intent. In the comment to section 915, subdivision (b) found in 7 California Law Revision Commission Reports (Dec. 1965) page 166, we find the not too illuminating language: "These privileges [official information] exist only if the interest in maintaining the secrecy of the information outweighs the interest in seeing that justice is done in the particular case. In at least some cases, it will be necessary for the judge to examine the information claimed to be privileged in order to balance these competing considerations intelligently."
The Legislature, as well as the courts, is constantly confronted with oftentimes conflicting demands of law enforcement and the rights of the criminally accused, in the maintenance of an orderly society. The obvious purpose of the protective procedure fashioned in section 915, subdivision (b) is "to balance ... competing considerations," and reasonably so.
However, it would be unreasonable to involve the judiciary in the pursuance of this statutory scheme to protect privileges and not contemplate some procedure for appellate review. We do not ascribe to the Legislature the intent to do away with such a substantial right. Since the burden is on defendants to provide an adequate record in a writ proceeding to contest an adverse discovery ruling (Lemelle v. Superior Court (1978) 77 Cal. App.3d 148, 156 [143 Cal. Rptr. 450]), it is a matter of basic fairness that the proceedings from which defendants are barred should be reported and transcribed. United States v. Rawlinson *780 (9th Cir.1973) 487 F.2d 5, 8, cert. den., 415 U.S. 984 [39 L.Ed.2d 881, 94 S.Ct. 1579], and United States v. Anderson (9th Cir.1975) 509 F.2d 724, 730, cert. den., 420 U.S. 910 [42 L.Ed.2d 840, 95 S.Ct. 831], are demonstrable examples of the practice of transcribing in camera proceedings, albeit in informant cases, to assure effective appellate review.
It would seem that People v. Woolman, supra, 40 Cal. App.3d 652, provides some precedent to support the presence of a reporter at an in camera proceeding under section 1040, subdivision (b), even though we do not know whether there was any objection by the prosecution in that case or whether there were any oral proceedings to transcribe.
Again without precisely discussing from whence authority therefor arises or addressing our other concerns, in a fact situation involving section 1040, subdivision (b), the court in Saulter v. Municipal Court, supra, 75 Cal. App.3d, at page 234, notes that "[t]he record [on appeal] has been augmented with a reporter's transcript of the [in camera] hearings on the petitioner's motion, and with the sealed records examined by the magistrate." (Italics ours.) The court therein in fact reviewed the in camera proceedings. (Saulter, supra, at pp. 235 and 239, fn. 1.)
Discovery in criminal cases is now firmly imbedded in the case law, and the denial of a motion for discovery is immediately reviewable by writ. (Saulter, supra; Long v. Municipal Court (1976) 58 Cal. App.3d 382, 386 [128 Cal. Rptr. 918]; Caldwell v. Municipal Court (1976) 58 Cal. App.3d 377, 380-381 [129 Cal. Rptr. 834].) Since it is the affirmative duty of any appellant to show error by an adequate record (Lemelle v. Superior Court, supra, 77 Cal. App.3d 148, 156), including appellants herein, a reviewable record of an in camera proceeding in section 1040 cases must be maintained. The preparation of a reviewable record contemplates the presence of a reporter to transcribe any oral proceedings, and a clerk to mark and identify any documents to be received.
Because no such record was presented to the superior court for review pursuant to the Penal Code section 995 motion, the ruling that respondents were unlawfully committed was proper.
We are not unmindful that the preliminary hearing herein consumed a month's time and produced a reporter's transcript in excess of some *781 2,000 pages. Again, with an eye toward balancing societal interests, it may have been well for the superior court to have reconstructed the in camera proceedings at the Penal Code section 995 hearing, made a decision as to the magistrate's exercise of discretion, and prepared a reviewable record in the process. However, lacking that effort, the judgment of the superior court is affirmed.
Allport, J., and Potter, J., concurred.
A petition for a rehearing was denied April 17, 1980, and appellant's petition for a hearing by the Supreme Court was denied May 29, 1980. Clark, J., Richardson, J., and Manuel, J., were of the opinion that the petition should be granted.
NOTES
[1]  Penal Code section 995 provides in pertinent part: "The indictment or information must be set aside by the court in which the defendant is arraigned, upon his motion, in either of the following cases:

".... .... .... ...
"If it be an information:
"1. That before the filing thereof the defendant had not been legally committed by a magistrate.
"2. That the defendant had been committed without reasonable or probable cause."
[2]  Penal Code section 245, subdivision (b), provides in pertinent part: "Every person who commits an assault with a deadly weapon ... or by any means likely to produce great bodily injury upon the person of a peace officer ... who knows or reasonably should know that such victim is a peace officer ... engaged in the performance of his duties shall be punished by imprisonment in the state prison...."
[3]  A transcript thereof has been lodged with this court for consideration in connection with this appeal.
[4]  Evidence Code section 915 provides: "(a) Subject to subdivision (b), the presiding officer may not require disclosure of information claimed to be privileged under this division in order to rule on the claim of privilege, ...

"(b) When a court is ruling on a claim of privilege under Article 9 (commencing with Section 1040) of Chapter 4 (official information ...) and is unable to do so without requiring disclosure of the information claimed to be privileged, the court may require the person from whom disclosure is sought or the person authorized to claim the privilege, or both, to disclose the information in chambers out of the presence and hearing of all persons except the person authorized to claim the privilege and such other persons as the person authorized to claim the privilege is willing to have present. If the judge determines that the information is privileged, neither he nor any other person may ever disclose, without the consent of a person authorized to permit disclosure, what was disclosed in the course of the proceedings in chambers."
(The amendment to § 915, subd. (a) eff. Jan. 1, 1980, does not clarify the perceived ambiguity raised by this appeal, namely, whether the procedures set forth in subd. (b) call for the presence of a court reporter, so that the proceedings, including oral presentations, may be transcribed for appellate review.)
Evidence Code section 1040 provides in pertinent part: "(a) As used in this section, `official information' means information acquired in confidence by a public employee in the course of his duty and not open, or officially disclosed, to the public prior to the time the claim of privilege is made.
"(b) A public entity has a privilege to refuse to disclose official information, and to prevent another from disclosing such information, if the privilege is claimed by a person authorized by the public entity to do so and:
".... .... .... ...
"(2) Disclosure of the information is against the public interest because there is a necessity for preserving the confidentiality of the information that outweighs the necessity for disclosure in the interest of justice; ..."
All section references hereinafter are to the Evidence Code, unless otherwise indicated.
[5]  All the defendants joined in the discovery motions, and objected to the magistrate's ruling disallowing the reporter's presence at the in camera hearing and the failure to preserve any kind of record for review.
[6]  A petition for hearing by the Supreme Court was denied September 12, 1974.
