
39 Cal.Rptr.3d 887 (2006)
137 Cal.App.4th 241
The PEOPLE, Plaintiff and Appellant,
v.
Robert THORNTON et al., Defendants and Respondents.
No. D046052.
Court of Appeal, Fourth District, Division One.
March 2, 2006.
As Modified on Denial of Rehearing March 16, 2006.
*888 Bill Lockyer, Attorney General, Robert R. Anderson, Chief Assistant Attorney General, Gary W. Schons, Assistant Attorney General, for Plaintiff and Appellant.
Carmela F. Simoncini, San Diego, under appointment by the Court of Appeal, for Defendant and Respondent Robert Thornton.
Carl M. Hancock, under appointment by the Court of Appeal, for Defendant and Respondent Jonathan McClaurin.
McCONNELL, P.J.
The People appeal, contending the court erred in ordering specific performance of a plea bargain for two defendants based on a finding they had detrimentally relied on the plea bargain when they waived time for the preliminary hearing. We reverse the judgment with instructions.

FACTUAL AND PROCEDURAL BACKGROUND
*889 On April 8, 2004,[1] defendants Robert Thornton, Jonathan McClaurin, and a third defendant, were arraigned for committing a battery on a nonconfined person by a prisoner (Pen.Code,[2] § 4501.5), with an enhancement for committing the offense while confined in a state prison (§ 1170.1, subd. (c)). McClaurin was additionally charged with custodial possession of a weapon in violation of section 4502, subdivision (a).
Over the course of the next four months, the preliminary hearing was continued seven times while the parties discussed disposition of the case. According to an uncontested declaration by Thornton's counsel, before a hearing on August 30, Imperial County Deputy District Attorney Baker told both defense counsel for Thornton and McClaurin that his office was most concerned with convicting the third defendant[3] and was willing to offer a plea agreement where defendants Thornton and McClaurin would plead guilty to the lesser crime of battery on a custodial officer (§ 243.1) in exchange for dismissal of the pending charges and a two-year midterm sentence to be served concurrently with the sentences they were currently serving. Defendants accepted the offer but asked Baker to request the Department of Corrections not pursue an administrative action against the defendants based upon their plea. When Baker agreed to make the request, Thornton and McClaurin agreed to continue the case and enter their formal pleas on September 20.
At the September 20 hearing, Baker was not present; instead Deputy District Attorney Robinson appeared on behalf of the People. According to the declaration by Thornton's counsel, Thornton and McClaurin were prepared to enter their pleas that day, but because Baker had not left any notes in the district attorney's file regarding the plea agreement, the parties agreed to continue the matter to September 27 when it was expected Baker would appear on behalf of the People. After the hearing, Thornton's counsel spoke with Baker who confirmed the plea agreement. The following day, Thornton's counsel sent a fax to Baker detailing their conversation and reiterating Thornton's acceptance of the plea agreement.
Before the September 27 hearing began, Deputy District Attorney Willis, who appeared on behalf of the People that day, gave a note to defendants' counsel from Baker. The note stated Baker had "discuss[ed] concurrent offers with both defendants" but was withdrawing the plea offer "[u]pon further consideration and discussions with other members of the prison unit." The note contained a new offer for defendants to plead guilty to battery on a custodial officer (§ 243.1), admit a strike prior and receive consecutive sentencing. During the hearing, Thornton's counsel informed the court of the People's withdrawal of the plea offer and requested a continuance to file a motion to compel specific performance of the plea agreement. The court granted the requested continuance and took the preliminary hearing off calendar.
On October 25, Thornton and McClaurin jointly filed a motion to compel specific performance of the August 30 plea offer. Attached as exhibits were the letter Thornton faxed to Baker confirming the offer and Thornton's acceptance of it, the *890 note from Baker withdrawing the plea offer, and a copy of the change of plea form Thornton signed, changing his plea to no contest. The People's opposition did not contest Thornton's factual statements, but argued Thornton's change of plea form was not a judicial admission of guilt that could be used against him in subsequent proceedings because it was not accepted by the court, nor did the court take any waivers. On November 15, defendants argued the court should reject the People's memorandum opposing their motion because it had not been provided five days before the hearing and they sought time to respond. The court continued the hearing to January 10, 2005, and thereafter to January 24, 2005.
On January 10, 2005, the court found "the offer was made, the offer was accepted, [but] the People did not wish to take the plea until some event involving a third party was resolved and then the case wasthere was a time waiver and the matter was put off about 30 days." The court stated it was inclined to rule in favor of defendants based on its finding Thornton and McClaurin had detrimentally relied on the plea agreement remaining available to the next hearing when they voluntarily waived time to continue the preliminary hearing. The court explained, "The willing and voluntary waiver of a constitutional right [the right to a speedy preliminary hearing] appears . . . to be a very substantial waiver and of a sort that one could characterize as detrimental reliance." Yet because there had been no opposition filed to defendants' version of the facts, the court continued the matter to allow the People the opportunity to offer any declarations or testimony about the facts of the plea agreement.
On January 24, 2005, the People submitted on the pleadings and the court granted the motion for specific performance. The court ordered the offer open for one day to allow Thornton and McClaurin the opportunity to accept or reject the offer. The next day, over the objection of the People, the court dismissed the charges against Thornton and McClaurin and amended the complaint to reflect a charge of violation of section 243.1. Both Thornton and McClaurin pleaded no contest and at a later hearing were sentenced to the middle term of two years to run concurrently with their existing prison sentences.

DISCUSSION

I

Appealability
Defendants Thornton and McClaurin contend an order directing specific performance of a plea agreement is not appealable by the People.
"The Legislature has determined that except under certain limited circumstances the People shall have no right of appeal in criminal cases." (People v. Superior Court (Howard) (1968) 69 Cal.2d 491, 497, 72 Cal.Rptr. 330, 446 P.2d 138.) The circumstances when the People may appeal "`are specifically set forth in section 1238 of the Penal Code, and it is well settled that such an appeal will not lie except in a case so specified.'" (People v. Valenti (1957) 49 Cal.2d 199, 205, 316 P.2d 633, disapproved on other grounds in People v. Sidener (1962) 58 Cal.2d 645, 647, 25 Cal.Rptr. 697, 375 P.2d 641, quoting People v. Knowles (1915) 27 Cal.App. 498, 506, 155 P. 137.) Courts may not interpret section 1238 to expand the People's right to appeal beyond those areas clearly specified by the Legislature. (People v. Johnwell (2004) 121 Cal.App.4th 1267, 1283, 18 Cal.Rptr.3d 286; People v. McDougal (2003) 109 Cal. App.4th 571, 580, 135 Cal.Rptr.2d 160.) "[T]he presence of error does not compel appealability where none exists." (People *891 v. Eberhardt (1986) 186 Cal.App.3d 1112, 1117, 231 Cal.Rptr. 387.)
Under section 1238, subdivision (a)(1), the People are entitled to appeal "[a]n order setting aside all or any portion of the indictment, information, or complaint." In determining whether a specific order is appealable under this section, courts consider the form, substance and effect of the order. (People v. Valenti, supra, 49 Cal.2d at pp. 204-205, 316 P.2d 633; see also People v. Burke (1956) 47 Cal.2d 45, 53-54, 301 P.2d 241, disapproved on other grounds in People v. Sidener, supra, 58 Cal.2d 645, 647, 25 Cal.Rptr. 697, 375 P.2d 641.) While an order may not be specifically listed as an appealable order under section 1238, if the substance of the order has the purpose and ultimate effect of setting aside all or any portion of the indictment, information, or complaint, then the order is appealable under section 1238, subdivision (a)(1). (See People v. Burke, supra, at p. 53, 301 P.2d 241 [an order striking a prior conviction was in substance an order setting aside part of the information and appealable under section 1238 subdivision (a)(1)]; People v. Walker (2001) 89 Cal.App.4th 380, 385, 107 Cal. Rptr.2d 264 [court's order invalidating prior conviction on constitutional grounds "had the effect of either striking the prior conviction or dismissing it as an allegation in the pleadings"]; People v. Booker (1994) 21 Cal.App.4th 1517, 1520-1521, 26 Cal. Rptr.2d 715 [an order declaring the charged violations misdemeanors rather than felonies was tantamount to dismissal of the felony charges and appealable under section 1238, subdivision (a)(1)].)
Here, when the court ordered specific performance, it dismissed all the pending charges against defendants and amended the complaint to include a violation of section 243.1. The order compelling specific performance thus had the effect of "setting aside all or any portion of the . . . complaint." (§ 1238, subd. (a)(1).) Accordingly, the People are entitled to appeal under section 1238, subdivision (a)(1).[4]
Defendants further contend that for policy reasons the People should not be allowed to appeal because to permit an appeal by the government under these circumstances would be to condone egregious governmental conduct. This argument confuses the merits of the claim with the issue of whether the order is appealable. Indeed, our conclusion thus far, that under the circumstances of this case the order is appealable by the People under section 1238, subdivision (a)(1) expresses no opinion as to the motivation behind the People's withdrawal of the plea offer.

II

Specific Enforcement of Plea Agreement
The People contend defendants' waiver of time and agreement to continue the preliminary hearing did not constitute detrimental reliance requiring specific performance of the August 30 plea offer.
"In a plea bargain, `the defendant agrees to plead guilty in order to obtain a reciprocal benefit, generally consisting of a less severe punishment than that which could result if he were convicted of all offenses charged.' [Citation.] The process requires the consent of the prosecutor [citations], and the `traditional role of the [court] . . . is one of approving or disapproving' the bargain `arrived at by counsel for defendant and the' prosecutor." *892 (People v. Turner (2004) 34 Cal.4th 406, 418, 20 Cal.Rptr.3d 182, 99 P.3d 505.) "`The prosecutor is under no duty to plea bargain.'" (People v. Barnett (1980) 113 Cal.App.3d 563, 572, 170 Cal.Rptr. 255.) If a prosecutor withdraws a plea bargain before it is accepted in open court, the defendant is not entitled to enforcement of the bargain unless he or she has detrimentally relied on the bargain. (People v. Rhoden (1999) 75 Cal.App.4th 1346, 1353-1354, 89 Cal.Rptr.2d 819; In re Kenneth H. (2000) 80 Cal.App.4th 143, 148, 95 Cal.Rptr.2d 5.) "`A defendant relies upon a [prosecutor's] plea offer by taking some substantial step or accepting serious risk of an adverse result following acceptance of the plea offer. [Citation.] Detrimental reliance may be demonstrated where the defendant performed some part of the bargain.'" (People v. Rhoden, supra, at p. 1355, 89 Cal. Rptr.2d 819.) If the defendant has detrimentally relied on a plea bargain such that the prosecutor is bound by the agreement, the trial court still has the option to disapprove of the agreement. (In re Kenneth H., supra, at pp. 148, 149-150, 95 Cal. Rptr.2d 5.)
Here, the trial court's finding of detrimental reliance rested solely on the fact defendants had waived time for the preliminary hearing. Defendants contend this finding was supported by evidence showing a six- to eight-month delay in the preliminary hearing. We disagree.
The preliminary hearing was originally scheduled in April 2004 and the court's ruling enforcing the plea agreement was made in January 2005. The relevant period of delay, however, does not encompass that entire time.
Until August 30, the parties had not reached any sort of agreement. Therefore, defendants could not have detrimentally relied on a plea bargain before August 30.
On August 30, defendants and the People reached an agreement but defendants agreed to delay the preliminary hearing and formal entry of the plea until September 20 because defendants had asked the prosecutor to see if he could convince the Department of Corrections not to pursue disciplinary proceedings against them. On September 20, defendants requested a delay of one week to September 27. On September 27, the prosecutor informed defendants the offer had been withdrawn and a new offer was being made. Beginning on September 27 and continuing thereafter, defendants had the opportunity to demand a speedy preliminary hearing. Instead, they chose not to proceed with a speedy preliminary hearing and the preliminary hearing was taken off calendar. Defendants asked for and were given continuances for the preparation, filing and hearing on a motion to compel specific performance of the plea agreement. The delay after September 27 was not due to defendants' reliance on a plea bargain being offered by the People; the People had withdrawn the August 30 plea offer and had substituted a new offer that had not been accepted by the defendants. The delay in holding the preliminary hearing after September 27 was due to defendants' decision to pursue a motion for specific performance of a plea agreement.
This record shows the period of delay in reliance on the plea agreement amounted to less than one month, that is, from August 30 when the plea agreement was reached to September 27 when it was withdrawn. *893 Delaying a preliminary hearing for a period of less than a month does not, in and of itself, represent "`some substantial step or accept[ance of] serious risk of an adverse result following acceptance of the plea offer.'" (People v. Rhoden, supra, 75 Cal.App.4th at p. 1355, 89 Cal. Rptr.2d 819.)
Other than waiving time for the preliminary hearing, the only other step either defendant took was Thornton's filling out of a change of plea form, changing his plea from not guilty to no contest. However, there is no evidence Thornton suffered any detriment as a result. The change of plea form was not entered in the court records nor did Thornton make any admissions in open court. Further, there is no indication that such a change of plea form, arising in the context of plea negotiations, would ever be admitted or used against him. Indeed, in opposing the motion for specific performance, the People argued the change of plea form did not constitute a judicial admission that could be used against Thornton.
Thornton also asserts the delay prejudiced his "ability to defend because, during the passage of time, inmates, who would be percipient witnesses, will have been transferred, and all witnesses will have suffered from fading memories, if they can be located at all." However, he presented no evidence to support this assertion and, thus, the court made no findings that the one-month delay resulted in any lost evidence or witnesses. Nor did defendants present any evidence to support a finding the prosecutor acted in bad faith.
To the extent Thornton and McClaurin may be suggesting that merely engaging in negotiations about a possible plea is sufficient to establish a detrimental delay of the preliminary hearing, we find no merit. A defendant is not required to engage in plea negotiations, rather, the defendant may, as here, voluntarily engage in the negotiations rather than pursue a speedy preliminary hearing. Nor is a prosecutor required to postpone plea negotiations until after a preliminary hearing is held. To accept the defendant's argument would discourage plea negotiations prior to the preliminary hearing; a prosecutor who engaged in pre-plea negotiations would do so at the risk of facing a claim of delay and detrimental reliance if he or she waived time for the preliminary hearing to engage in plea negotiations. Such a result would be neither in the best interests of the defendant nor of judicial economy.
In sum, while there was substantial evidence showing some reliance by defendants on the plea agreement, the evidence does not support a finding the reliance resulted in a detriment to defendants sufficient to justify specific enforcement of a plea agreement that had been withdrawn by the People. We conclude the trial court erred in finding defendants Thornton and McClaurin were entitled to specific performance of a plea bargain that had been withdrawn by the prosecutor.

DISPOSITION
The order granting specific performance and dismissing the charged counts is vacated. Defendants Thornton and McClaurin shall be returned to the positions they had before the court accepted the plea bargains. The judgment is reversed.
HALLER and AARON, JJ., concur.
NOTES
[1]  All dates refer to the 2004 calendar year unless otherwise indicated.
[2]  All statutory references are to the Penal Code unless otherwise specified.
[3]  The People did proceed separately against the third defendant, with his preliminary hearing being held on August 30.
[4]  The People also contend section 1238, subdivision (a)(8) authorizes their appeal. However, because we conclude they have the right to appeal under section 1238, subdivision (a)(1), we do not discuss this contention.
