Re: [Patch] DB_common dealing with prepared statements
| From: | Stig S. Bakken | Date: | Mon, 22 Dec 2003 08:52:59 +0000 |
| Subject: | Re: [Patch] DB_common dealing with prepared statements | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24597@lists.php.net to get a copy of this message | ||
Hi,
Could you re-send the patch with no whitespace changes? "diff -w -b -B"
should do the trick.
- Stig
On Sun, 2003-12-21 at 04:13, Michael Moen wrote:
> I noticed that there wasn't any checking taking place during prepare(),
> this patch checks the previously prepared statements (if any) and does
> not bother to prepare a duplicate statement by checking
> prepared_queries for the current query being prepared.
>
> This may not be a huge issue for most, but here is where I noticed it:
>
> I have an object (AudioCD) that contains a reference to a DB object.
> The AudioCD has a method, getTracks() that executes some SQL to get a
> list of tracks and then instantiates a new Track object for each one,
> passing in a reference to the DB object and the primary key of the
> object to create. After instantiating all of the tracks for a given CD
> I noticed that prepare_tokens had many duplicate entries, due to the
> SQL being prepared for each Track all on the same DB object.
>
> Michael
>