Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100807 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52021 invoked from network); 2 Oct 2017 00:48:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2017 00:48:34 -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:41850] helo=mail.kd2.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 80/8A-34435-EDC81D95 for ; Sun, 01 Oct 2017 20:48:32 -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=Cyl0VQaPupuyMnYDb/Zr+VCoNmQEY9oYtdqzUJOo5U4=; b=WKMHmAslu9Eme4KqOksQKUHQw3u0sXMQEzgxRgoyjUxeZI70QitM+X38PbYoYynyWHXsa3O2KrmAn4EtoYULmbfgjCS9r6A6V2eYvvXOowCCw09AyklNwcgGaepOnqsCLZ2rG6r4unGC1IhxHSpEmR5hoxOmkgI7lU+/tKxwxRg=; Received: from narragoon by mail.kd2.org with local (Exim 4.84_2) (envelope-from ) id 1dyouK-0004al-0T; Mon, 02 Oct 2017 02:48:28 +0200 To: "Christoph M. Becker" X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 02 Oct 2017 13:48:27 +1300 Cc: internals@lists.php.net In-Reply-To: <20171001185540.5e572e58@platypus> 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) >> PDO already has support for large objects (LOBs)[1]. I don't know if >> and how these are supported by the pdo_sqlite driver, but wouldn't it >> make sense to use the existing API instead of introducing a new >> method? >> >> [1] >> > > Very interesting indeed, didn't know about that feature, I was > expecting the creation of a new method was the only way, as this was > the way PGSQL was doing it. > > There's even a bug report about it: > https://bugs.php.net/bug.php?id=57691 > > I will look into that next week and see if it can fit and replace my > RFC > then. OK, I took some time to look into that feature and the fact is that it doesn't work at all currently with SQLite, it is not returning a resource handle but a string, and it is consuming a large amount of memory as it is just dumping the LOB in memory. The code seems to be there to handle it though so I don't know what's going on, if the person who implemented that could come forward and tell me more about the implementation. But I tried it and it doesn't cover one of the use of openBlob that I have which is to open, read, and write at the same time. The current way it's done in PDO is that you can either fetch a LOB from a result of a query and read from it, or bind a file resource handler to a statement for writing, but you cannot open a LOB, read from it and write from it without performing a query. So for me the use case is quite different here, and openBlob allows stuff that PDO::PARAM_LOB with bindColumn and bindParam cannot allow currently. In conclusion openBlob is still useful as it allows accessing a BLOB outside of a statement and allows to read and write at the same time without having to load the blob in memory.