Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105723 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 59783 invoked from network); 16 May 2019 16:45:10 -0000 Received: from unknown (HELO us-smtp-delivery-195.mimecast.com) (216.205.24.195) by pb1.pair.com with SMTP; 16 May 2019 16:45:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenable.com; s=mimecast20170201; t=1558014679; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:openpgp:autocrypt; bh=GNYj584yuqZwXN/SzrlpbiUp4/eQxjR9fvD6E9DRsyE=; b=NaNbkrvno1LrOnMo/fe8MrWNQVymJ7x6qPA56Aj4SvX4MHIUPZdsNBXb145jUOH2iBnpM/ TE5fUN3UZClwdOEOmYU/85ueuf9Qgw0VcOsu07G9ePWnMbN1JNYU5E7Vj4+UU2ri36V4Yc ahBM0AjgSwuUSXs2lymNGPZ+94ixb8M= Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-205-c4uhKAV7MvG19oO2rxd3vg-1; Thu, 16 May 2019 09:51:17 -0400 Received: by mail-ot1-f70.google.com with SMTP id v16so1668360otp.17 for ; Thu, 16 May 2019 06:51:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=eMgUqILHG0xN8tXaN2R4xw2lmCy1+rDqb7P8MeSIlvg=; b=eA8hby3t3NIuxAlokUsafAdK7b+r9djYngNkheO8N8Ohvtyyu4tkBf/y6Nw3zCAl6A F5gj26ajXD3wlc8Cc+RzqOGSM5viOZxmFQRcRLFpVT7/Dq+MKsn3XbCEsK20F7xDpweH 3G45J2Qe/RM2x6h6j8s0Ck4A7CaPyziRMII0WuZb2AwhoJprVb8icE8Ugxxe9nNE+2Lj TgG5yu+GwuvY0IHjIAcDa4LE1pz/zVxBPWimL0RQmHikqLn0gEcfYSYk9tiZA+CirW5K muZSOsx0ZGNl+Jjnt4FlUXXt1HetO8yPmIz1TlT1zsy+feAlqU2J13+AMxOO0ZKLFTii cpYA== X-Gm-Message-State: APjAAAVY+/jnVXDM04ls6G59q7zJKHho5qyfbzn9sjB8SSSclAS5TnVv l567K8/6qYLVAq9rmtpcXkKXkYHdC9jFxJK1WVlRK132cyyYbZRwzYAsgohVP99tzm71CNtYj6T pMGkO3ncyu8eBONPBEG0lEHa2WO2km0clvg== X-Received: by 2002:aca:c1c6:: with SMTP id r189mr177493oif.162.1558014677215; Thu, 16 May 2019 06:51:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwk8pHZYaypm0afJjvJpwdvJlQ4Lw+WaG6WMD5w2jOhug+BmQx4OZZiBQgEky/44zLj494i7d5ouSjc38bh0PU= X-Received: by 2002:aca:c1c6:: with SMTP id r189mr177475oif.162.1558014676954; Thu, 16 May 2019 06:51:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 16 May 2019 09:51:05 -0400 Message-ID: To: "Christoph M. Becker" , internals@lists.php.net X-MC-Unique: c4uhKAV7MvG19oO2rxd3vg-1 X-Mimecast-Spam-Score: 0 Content-Type: multipart/alternative; boundary="0000000000006012160589018f43" Subject: Re: RFC for Sqlite3 Extended Error Codes From: rkopack@tenable.com (Robert Kopack) --0000000000006012160589018f43 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, May 15, 2019 at 7:00 PM Christoph M. Becker wrote: > On 15.05.2019 at 19:14, Robert Kopack wrote: > > > I would to extend the functionality of the current sqlite3 implementati= on > > (in *ext/sqlite3* and in *ext/pdo_sqlite*) by exposing the functions > > related to extended result codes. I have already forked and made my > changes > > at > > > https://github.com/rkopack/php-src/commit/f6c4d1eeccd27a3c5bd836fd8205b12= 83bd5eabc > . > > From > > my understanding Scott MacVicar and Christoph M. Becker are the primary > > maintainers for the sqlite3 extension and Ilia Alshanetsky is the prima= ry > > maintainer for the pdo_sqlite extension; > > It's best to look at EXTENSIONS in master[1], which also reveals the > most up-to-date dates of maintainership =E2=80=93 i.e. pdo_sqlite is effe= ctively > maintained by the core maintainers. > That's strange as I did look in that file first which is how I found the three names. Perhaps I read it wrong. Mea Cupla. > > if any of you would like to > > comment on this (it's around 50 lines of new code) so I can get feedbac= k > on > > this I would greatly appreciate it. I made sure to follow the conventio= n > I > > saw in the file(s) to the best of my ability but I am sure there are > little > > things I might have missed. > > I haven't reviewed closely for now, but basically I like these > additions. With regard to sqlite3_extended_result_codes() we have to > review existing error checks (they likely need small adjustments, if > extended error codes are enabled). And we likely want to have a few > tests for the new functionality. > I didn't consider that! And just to clarify are you referring to the results from sqlite3_extended_errcode() or the return value from sqlite3_extended_result_codes()? If the former, I'll have to look around to see where those kind of checks are done - do you know of any locations off the top of your head? From my understanding we can just mask the incoming error code with 0xFF (That's what sqlite does anyway) and always get "what we expected" it to be in the past instead of trying to account for the additional extended error codes in some other manner. If it's the latter, and after glancing at the sqlite source, it looks like that function returns either SQLITE_MISUSE (21) or SQLITE_OK (0). I put in -1 instead of 21 as the return for that function in error because I felt that was following what PHP normally does on error (perhaps FALSE would be better?) In fact, on further thought, returning the 0 from success on that might be confusing as well. Perhaps it would better suited to check the return and return TRUE on SQLITE_OK and FALSE on SQLITE_MISUSE? With regards to Unit Tests that is a fantastic idea (that I completely forgot about and i'm sure my team lead would lecture me on much to my chagrin) and I will be sure to add some to cover the new functions at a minimum. > Feel free to submit a pull request[2]; it seems to me any discussion > could happen on Github as well. :) > I have already done so ( https://github.com/php/php-src/pull/4166 ) and i'll be sure to keep any more discussion beyond these last questions there. Thank you for your time! --0000000000006012160589018f43--