Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98364 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34178 invoked from network); 1 Mar 2017 01:02:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Mar 2017 01:02:53 -0000 Authentication-Results: pb1.pair.com header.from=christopher.jones@oracle.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=christopher.jones@oracle.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oracle.com from 156.151.31.81 cause and error) X-PHP-List-Original-Sender: christopher.jones@oracle.com X-Host-Fingerprint: 156.151.31.81 userp1040.oracle.com Received: from [156.151.31.81] ([156.151.31.81:47043] helo=userp1040.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/61-16445-BBD16B85 for ; Tue, 28 Feb 2017 20:02:52 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v2112ekr032023 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Mar 2017 01:02:40 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v2112eql000889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Mar 2017 01:02:40 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v2112dRv009510; Wed, 1 Mar 2017 01:02:39 GMT Received: from [10.191.133.24] (/10.191.133.24) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 28 Feb 2017 17:02:39 -0800 To: Adam Baratz , Andrea Faulds , Marco Pivetta References: Cc: "internals@lists.php.net" Message-ID: Date: Wed, 1 Mar 2017 12:02:36 +1100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------2CDA8997228AC9AFAD027467" X-Source-IP: userv0021.oracle.com [156.151.31.71] Subject: Re: [PHP-DEV] Re: [RFC] Extended String Types For PDO From: christopher.jones@oracle.com (Christopher Jones) --------------2CDA8997228AC9AFAD027467 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 1/3/17 12:58 am, Adam Baratz wrote: > Merging responses here... > > Are PARAM_STR_UNICODE, ATTR_UNICODE_STRINGS and PARAM_STR_ASCII the most appropriate names? > > > Good point. Maybe instead: > > * PDO::PARAM_STR_NATL > * PDO::ATTR_NATL_STRINGS > * PDO::PARAM_STR_CHAR > > How does this interact with different character sets used for the connection, if at all? > > > I don't think that should matter. This is strictly a hint for the quote functions to put an "N" at the beginning of their output. > > DBAL maintainer here: before we introduce even more complexity into the PDO stuff (which is already a maze), could a set of test cases be > written, so that stuff that is currently impossible to do without this RFC is clearer/demonstrated? > > > The other RFC I mentioned included a similar solution to this problem. The PR I put together for that should make this clear enough: > https://github.com/php/php-src/pull/2168 > > I'm asking because we didn't get any bug reports about extended string types for Doctrine DBAL, and adding new types just to workaround the > limitations of the usual suspects is shotgun surgery, and just more complexity to handle. > > > I think of them more like flags, like PDO::PARAM_INPUT_OUTPUT, than standalone types. Since you apply with a bitwise-OR, the addition would be > minimally invasive. And you wouldn't have to rewrite code if you switch drivers. The flags would simply be ignored. > > (remember that PDO for SQLServer is experimental, if not totally unusable) > > > I'm mainly interested in pdo_dblib, which is an officially maintained extension (I'm the maintainer). I assume you're referring to pdo_sqlsrv? > > More importantly, what about allowing arbitrary quote delimiters? > > https://livesql.oracle.com/apex/livesql/file/content_CIREYU9EA54EOKQ7LAMZKRF6P.html > > > > This functionality seems orthogonal to what I'm describing. It would be more appropriate to implement this as a driver-specific attribute for > pdo_oci. But since that driver doesn't support emulated prepares, I'm not sure how much value it would have. Isn't the same quoting functionality available via the quote() method? That's what the PR's tests use. I don't think it's orthogonal. There are various ways to quote strings and a generic PDO solution should be flexible enough to handle all drivers. Chris > > Thanks, > Adam -- http://twitter.com/ghrd --------------2CDA8997228AC9AFAD027467--