Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100820 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82615 invoked from network); 3 Oct 2017 22:49:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2017 22:49:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@bohwaz.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@bohwaz.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bohwaz.net designates 5.135.163.151 as permitted sender) X-PHP-List-Original-Sender: php@bohwaz.net X-Host-Fingerprint: 5.135.163.151 sanguine.kd2.org Received: from [5.135.163.151] ([5.135.163.151:53673] helo=mail.kd2.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/D3-34435-6F314D95 for ; Tue, 03 Oct 2017 18:49:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bohwaz.net; s=mail; h=Message-ID:References:In-Reply-To:Cc:From:Date:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:To; bh=FwaTXMp6nlLkPWAlCHkQ4wmlophDpxLq2im7G5Fazhs=; b=lyzEP85gaqkBnqNHjtrf1oifu6sgx/69NlxyK2PePMPXOMwI6WI8LhBGYUInSygF4OLiel3bZ+HdauQok8Ru8S+DzGwAN4EPTq2ApcV09SMqN5fUZBnq4F4hfrJ9RQ71qRgNqn4FAI4gUoZ7FiTuU6ALK+2eNN4G4rBnzodIU64=; Received: from narragoon by mail.kd2.org with local (Exim 4.84_2) (envelope-from ) id 1dzW0B-0005dD-G0; Wed, 04 Oct 2017 00:49:23 +0200 To: Adam Baratz X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 04 Oct 2017 11:49:23 +1300 Cc: internals@lists.php.net In-Reply-To: References: <25903b1e0fc5a726e44b1e3a5ab4aec4@bohwaz.net> <0607d622-caa9-ae1d-33db-1958a0ff0500@gmx.de> <20171001185540.5e572e58@platypus> Message-ID: X-Sender: php@bohwaz.net User-Agent: Roundcube Webmail/1.1.5 Subject: Re: [PHP-DEV] Re: [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO From: php@bohwaz.net (BohwaZ/PHP) > I believe that's how PDO::PARAM_LOB is intended to work (based on my > reading of the docs and implementations for other drivers). It seems > like > more of a convenience than anything, though maybe someone had more > ideas > for how it should work across drivers and never got to follow through > on it. This is not how I understand the documentation: "PDO::PARAM_LOB tells PDO to map the data as a stream, so that you can manipulate it using the PHP Streams API." But this seems to be quite chaotic, reading https://secure.php.net/manual/en/pdostatement.bindcolumn.php "Since information about the columns is not always available to PDO until the statement is executed, portable applications should call this function after PDOStatement::execute(). However, to be able to bind a LOB column as a stream when using the PgSQL driver, applications should call this method before calling PDOStatement::execute(), otherwise the large object OID will be returned as an integer." This is quite confusing. And as stated above, with MySQL and SQLite it returns the LOB content as a string on PHP 7+ but a stream handle on PHP 5.6… To me it seems that the LOB handling of PDO via bindColumn/bindParam is completely broken and inconsistent currently :( If I have more time available after this RFC I'll look into fixing it for PHP 7.3. > I'd love it if PDO had better BLOB/LOB types and if we had a better > pattern for driver-specific APIs, but I'm comfortable lumping those > goals > under "future scope." Getting parity with ext/sqlite3 will make > pdo_sqlite > more usable, which will help grow its community, and the number of > people > who are able to contribute to these bigger projects. Deprecating the > current set of driver-specific APIs in the future, if we have > functional > equivalents, isn't an impossible project. Yeah sounds good to me :)