Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105977 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 54597 invoked from network); 18 Jun 2019 22:20:26 -0000 Received: from unknown (HELO us-smtp-delivery-195.mimecast.com) (63.128.21.195) by pb1.pair.com with SMTP; 18 Jun 2019 22:20:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenable.com; s=mimecast20170201; t=1560886494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ck3Q6MtmIR1A2qQyzBdF0/OoABNJX9SWd6oMlCv+21E=; b=ZSh0OkSUcD/1qBKRHjTJPP0l7SnUwHjHdol/Kvjwi9eez193TyozY7P/PDxpCBJ/eEsXjA bhZEC7I+QL2QmzZXafzKxFbAC1UShIUQwtFaw9Mn43OabUfhd/jKg+4yfuQWrK8dV4+ksY PoyLxXnCe+xZAr8C0t7VElQOdSIdA8U= Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-100-d4RPojTjMrueo74zF0VFYA-1; Tue, 18 Jun 2019 15:34:53 -0400 Received: by mail-oi1-f199.google.com with SMTP id 189so4690939oii.18 for ; Tue, 18 Jun 2019 12:34:53 -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=qgBx9GcUakEzSF6cF9n6qp4/gNne598lQWV7fcJ//mE=; b=RjyuoD53cVCk+gZGzBY9l9RiTUtx+SeVLidQiMgqH7oGg7491oj8nOtuUPDsTn2qKA gLbXCK5DiRUTrMHvaTVHlIuwDldeOzu5UL4HGyfkvytwG9SP8zDMKdrWXXdDDXxH5kMh N0sbczek3UPfSBNYVtOpuhxRXO7i69ecgvI2ndexnSo+CIWwk+IWA80xx8TAtgjc4/dG 8K5zFwF7QqBt1+A5fDrmGaiOxE2SSFHlJfa3Zf6l+OeZxipf61IaDnusOIHAT0tAwuuJ vdHEgu/l4l51TbY68BeUKfM9TNzkOtWUy7nXmpbvZMjfBa1uWycL/al+9TVbPn+q/o9D XE2Q== X-Gm-Message-State: APjAAAXuWCHoHWeI2TOL0ZV2SOX5iD4mF2jSxrLJ90whn/pDkX1iTFT9 dB01HJdDwvbvcWMBkSThUieJqFHRpXJ/BGZFAcTxxijXaYvVGvOgLU0RdjILuiechYo4VT+40Er upjXCy11Z6hj4la/ibyJEK4v5NAIFc5OXwg== X-Received: by 2002:aca:3007:: with SMTP id w7mr527591oiw.32.1560886492864; Tue, 18 Jun 2019 12:34:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCKVApTpOVxDBTDcgzvVoV+Qzcl5ZQD7braWK/XeIgahRI9UoSAP4rpv2FTlpBIiXhV5aU9oo7+bSE+shcltI= X-Received: by 2002:aca:3007:: with SMTP id w7mr527579oiw.32.1560886492556; Tue, 18 Jun 2019 12:34:52 -0700 (PDT) MIME-Version: 1.0 References: <42b836d2-5193-b2fd-bf0a-6ccf8843bc03@gmx.de> In-Reply-To: <42b836d2-5193-b2fd-bf0a-6ccf8843bc03@gmx.de> Date: Tue, 18 Jun 2019 15:34:41 -0400 Message-ID: To: internals@lists.php.net X-MC-Unique: d4RPojTjMrueo74zF0VFYA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: RFC for Sqlite3 Extended Error Codes From: rkopack@tenable.com (Robert Kopack) Hello everybody, I've had the PR open for this a while now (https://github.com/php/php-src/pull/4166) and was hoping to get more eyes on it; Kalle was looking at it but he appears to have not been as active lately and as I believe it is in a good state right now I was hoping to have some other feedback on it. I was also curious if this would go into a 7.x version of PHP or if something like this would only be for the next major version (8.0). Thank you, Robert On Sat, May 18, 2019 at 5:51 AM Christoph M. Becker wro= te: > > On 16.05.2019 at 15:51, Robert Kopack wrote: > > > On Wed, May 15, 2019 at 7:00 PM Christoph M. Becker > > wrote: > > > >> 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()? > > I was referring to the slight behavioral change that is caused by > calling sqlite3_extended_result_codes(db, 1). As I understand it, this > will cause other functions to possibly return extended error codes > instead of primary result codes. It seems, though, that there would not > be any conflict right now, since only SQLITE_OK, SQLITE_ROW and > SQLITE_DONE are checked in ext/sqlite3, and these do not have extended > error codes. Still it might make sense to mask these checks to prevent > future issues. And of course, we would have to be careful, if we add > checks for e.g. SQLITE_BUSY in the future. > > > If it's the latter, and after glancing at the sqlite source, it looks l= ike > > 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 fel= t > > 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 t= hat > > 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? > > I think the method should return TRUE on success, and FALSE on failure. > An alternative might be to return the old value, like done by > SQLite3::enableExceptions(). > > > Thank you for your time! > > Thanks for your's. :) > > -- > Christoph M. Becker >