The district attorney of the county may at all times appear before the grand jury for the purpose of giving information or advice relative to any matter cognizable by the grand jury, and may interrogate witnesses before the grand jury whenever he thinks it necessary. When a charge against or involving the district attorney, or assistant district attorney, or deputy district attorney, or anyone employed by or connected with the office of the district attorney, is being investigated by the grand jury, such district attorney, or assistant district attorney, or deputy district attorney, or all or anyone or more of them, shall not be allowed to be present before such grand jury when such charge is being investigated, in an official capacity but only as a witness, and he shall only be present while a witness and after his appearance as such witness shall leave the place where the grand jury is holding its session.
Ca. Pen. Code § 935