Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31492 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29761 invoked by uid 1010); 8 Aug 2007 09:58:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 29745 invoked from network); 8 Aug 2007 09:58:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Aug 2007 09:58:51 -0000 Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 85.10.196.195 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 85.10.196.195 serveforce1.backendmedia.com Linux 2.6 Received: from [85.10.196.195] ([85.10.196.195:44713] helo=serveforce1.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/31-13605-DC399B64 for ; Wed, 08 Aug 2007 05:58:41 -0400 Received: from soitgoes.local (118-130.5-85.cust.bluewin.ch [85.5.130.118]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by serveforce1.backendmedia.com (Postfix) with ESMTP id 1C777122422C; Wed, 8 Aug 2007 12:00:54 +0200 (CEST) Message-ID: <46B993B5.6000208@pooteeweet.org> Date: Wed, 08 Aug 2007 11:58:13 +0200 User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Lester Caine CC: PHP internals References: <87E4F8AF-06DE-4FCC-AD1B-83E932A5E180@prohost.org> <46B41A47.1080902@lsces.co.uk> <46B81302.1060403@lsces.co.uk> <200708072345.58330.larry@garfieldtech.com> <46B9797B.6080304@lsces.co.uk> <46B97C3C.6010405@pooteeweet.org> <46B98962.7020002@lsces.co.uk> In-Reply-To: <46B98962.7020002@lsces.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-backendmedia-com-MailScanner-Information: Please contact the ISP for more information X-backendmedia-com-MailScanner: Found to be clean X-backendmedia-com-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0.079, required 6, AWL -0.02, RDNS_DYNAMIC 0.10) X-backendmedia-com-MailScanner-From: mls@pooteeweet.org X-Spam-Status: No Subject: Re: [PHP-DEV] PDO Restriction ( was 5.2.4RC1 Released ) From: mls@pooteeweet.org (Lukas Kahwe Smith) Lester Caine wrote: > Following on .... > > Lukas Kahwe Smith wrote: >> Lester Caine wrote: >> >>> The main thing I see there is 'raw' SQL. Loading the variables >>> directly into the script, rather than simply binding them as params. >>> I have yet to work out a way of converting some of my dynamically >>> generated SQL into a format that will work with PDO - on any >>> database. I've only ever used ADOdb and that handles ALL of the >>> parameterizing of things transparently. >> >> I have no clue what type of dynamically generated SQL you are talking >> about. Are you talking about being able to dynamically stick >> identifiers into placeholders? This is simply not possible if you are >> using native prepared statements. If you emulate them, yes you can, >> but then you can might as well use sprintf() with quote() (maybe with >> a wrapper). > > OK this is a key difference between MySQL and other databases - at least > looking at the raw drivers. Firebird ( and PostgreSQL ) can use > parameters to handle the transfer of values to the query. > From pg_query_params manual - "The primary advantage of > pg_query_params() over pg_query() is that parameter values may be > separated from the query string, thus avoiding the need for tedious and > error-prone quoting and escaping." But these parameters may only be literals not identifiers. The only difference in placeholder support is if the placeholders are named (pgsql, oracle etc.) or not (db2, mysql etc.). PDO (and MDB2, Doctrine etc. for that matter) support both the named and unnamed in all drivers. SELECT * FROM ?; // does not work The reason is technical, the idea behind prepared statements is to have the database be able to parse and plan the query once. Without identifiers this would not be possible. > PDO does wrap this quite nicely, except that BLOB's can only be passed > as raw content? The ability to just pass a BLOB ID means that you only > access that part of a large blob that you need. And most database > engines would benefit from being able to handle BLOB elements > independent of the general fetch. Rather than duplicating and processing > several hundred 'k' text blobs, you just pass the link to the original? Blobs in PDO are implemented via the stream API, so its not only "raw content". Adding support for blob id's would be a good idea if its not yet supported. Speaking of which, another area where PDO standards to reduce duplicate efforts is documentation, which is still a bit lacking atm (where is the new Dan?). regards, Lukas