Re: Re: Announce: PDO beta releases

From: Date: Thu, 10 Feb 2005 02:41:42 +0000
Subject: Re: Re: Announce: PDO beta releases
References: 1 2 3 4 5  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-1944@lists.php.net to get a copy of this message
Wez Furlong schrieb:
On Wed, 09 Feb 2005 21:57:36 +0100, Reini Urban <rurban@x-ray.at> wrote: ...
Named pipes on NT are also problematic: DSN: "mysql://wikiuser:@localhost/phpwiki" DB Connection failed: SQLSTATE[HY000] [2017] Can't open named pipe to host: . pipe: MySQL (2) I'm using a mysqld-4.1.8 on NT with named pipe support. Winnt should really default to host=127.0.0.1 and not "localhost".
You're not showing the DSN you passed to PDO.
I was. DSN: "mysql://wikiuser:@localhost/phpwiki" Which means default values only.
I can change the windows build of pdo_mysql to use 127.0.0.1 instead of localhost... but doesn't the mysql client code-base handle 'localhost' and promote it to named pipes anyway?
There was some pipe problem I'll have to reproduce and investigate. Within the perl libmysqlclient "localhost" tries the socket/pipe, 127.0.01 tries TCP/IP. Within PDO I think it's the same. The default pipe name "MySQL" should have been okay. ....
Haven't tested utf-8 issues yet. Japanese blobs might bite the 8bit string functions.
PDO doesn't care about the charset; it is no different from the existing PHP database extensions in this regard. Some drivers allow you to select a charset by setting the PDO_ATTR_CHARSET attribute during connection.
PDO_ATTR_CHARSET translation is easy and welcome, but a valid utf8 \0 in any string will be a problem in a pecl extension. mbstring overrides will not fix that. Will they? ...
Thanks for your feedback so far!
Thanks for this lib! Finally a good and easy cross-database module! To summarize: Porting for phpwiki needed 2 hours, mostly converting simple adodb or pear db execute statements to the prepare/bindParam/execute syntax and changing the fetch calls. Exactly as in perl's DBI. Once I caught the transaction ability via try/catch it was easy to workaround, a lot easier than in the php4 adodb/pear db backends. I fully understand why you didn't want to parse the pear db DSN "dbtype(dbsyntax)://username:password@protocol+hostspec/database?option=value&option2=value2" in C :) It's quite easy to construct a valid PDO DSN via the pear DB parseDSN function. PDO_MYSQL doesn't accept setAttribute for valid __construct hash values PDO_ATTR_* besides the one and only documented one, but otherwise I would consider it ready for general usage. Maybe you should document those constants also. I tried to call $pdo->setAttribute(PDO_ATTR_AUTOCOMMIT, true); $pdo->setAttribute(PDO_ATTR_TIMEOUT, 10); $pdo->setAttribute(PDO_ATTR_PERSISTENT, false); ... but only the initalization via the hash worked ok. Your TODO: Cached prepared statements is IMHO not a must inside the pecl lib, you can easily cache the statement objects in php. PDO_FETCH_LAZY is a very cool idea! Shouldn't that be the default instead of _BOTH? Doesn't look too costly. -- Reini Urban http://phpwiki.org/

« previous php.pecl.dev (#1944) next »