Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113004 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51154 invoked from network); 27 Jan 2021 15:06:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jan 2021 15:06:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 149D71804A7 for ; Wed, 27 Jan 2021 06:48:44 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 27 Jan 2021 06:48:43 -0800 (PST) Received: by mail-lj1-f175.google.com with SMTP id 3so2405604ljc.4 for ; Wed, 27 Jan 2021 06:48:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YXgS/U19X0cLMxvXZSxl9qe4m1NSy/BV8iVvW6aT5Jc=; b=JtFjs0BbUVR/RxOLBy6sC9ONH7U+ZR8HG0zMZ6ZegUOp/lmhR0zY3ESrxfk+6JmVeQ Ci1TfwfHAOI23xsgcvrfdz6uVvJxSM8BK6Cl+PK/LT7uPWBp+LvdJgTxw5TENj8aj79g tr4J843d4e1vDh2lvcsi3NAuXWg6GmQXin7+ScUlrDupeJ2G6hLEVNm5cgKS244syAzn L0lW1kiup9/kETC2cualiZQDSqQQDtqF6AeRgRNpSqYIM6G2kgJfDMtffC8M8iXd9+CP Q9vGepgq0XahVcOTt5YxQ/+P2s/yyuSnMTEzrFAJIsgC/70+Hunl0ZhAvKb81dru0L8B YCbg== 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:cc; bh=YXgS/U19X0cLMxvXZSxl9qe4m1NSy/BV8iVvW6aT5Jc=; b=nf4BcxPjAwDQyWkZ7PnCTCDcmk+Qxe79qzXMXbmE69eGpsJuqBdxdhzEwQRwKMdhrS hgMgQBU3YTfmkNCQIYhpU1pmBFzUIhQovgH3wr1o5YjnsCMzP+0N3hfKH1CSvLKAdZNR Vaxg8nerPsuTHAhcjgE/oomTe3ZcVn1SRb0h2d3aKJrdQpqlyvkeboLg4pzmJQIbZIAo 996F2PheiCWut5+JNPzQcOzgiD3ElZGwcaezF50vffWJfb9/hbQQeEJIPy+rqveE/UVY +DgjnUBlBxHIrRyu3wbQDFkBH5mVsl9zScoM1r+gYkJprhz2h6Fc2jtwMR1uisc6T949 AuyA== X-Gm-Message-State: AOAM5321/oFlnjsTAkkJU71ns1mc/vecGV4JKNU8KN3rHmqn0Vfc5WhU I4Q+gKXmbPtgj6w3829rSqDk4js4cvbE9JKhQlw= X-Google-Smtp-Source: ABdhPJxJvaEC3wSekrqkjY9+y6zKKvxYfs2gOpW55FPfjEPac0djAdciuQ84iinNQ7rt+0CbXR/kazrXTbcHHR/0w1Y= X-Received: by 2002:a2e:85cf:: with SMTP id h15mr5829189ljj.452.1611758919991; Wed, 27 Jan 2021 06:48:39 -0800 (PST) MIME-Version: 1.0 References: <0edafce4-c9a5-c483-65f1-72e49614135a@telia.com> <4D7D042F-39A5-4BEF-93B6-542FD53928A1@cschneid.com> <73C12DD2-D99E-44BA-B557-6043F3DDD4C7@cschneid.com> <30C0E1A8-6269-4221-AF21-3FA738D5910C@cschneid.com> In-Reply-To: <30C0E1A8-6269-4221-AF21-3FA738D5910C@cschneid.com> Date: Wed, 27 Jan 2021 15:48:24 +0100 Message-ID: To: Christian Schneider Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000e3c3dc05b9e2dd1d" Subject: Re: [PHP-DEV] [RFC]: Change Default mysqli Error Mode From: nikita.ppv@gmail.com (Nikita Popov) --000000000000e3c3dc05b9e2dd1d Content-Type: text/plain; charset="UTF-8" On Wed, Jan 27, 2021 at 3:35 PM Christian Schneider wrote: > Am 27.01.2021 um 14:34 schrieb Nikita Popov : > > I think if you wanted to introduce an additional diagnostic step, the > way to go about it would be to issue a deprecation warning when creating a > connection without mysqli_report() having been explicitly called beforehand. > > Wouldn't this mean everybody would add mysqli_report() to their code? > And wouldn't this render the default of mysqli_report() entirely useless? > Or is your idea that at a later stage you then want to create a warning > for manual mysqli_report() calls? > Yes, that would render a call to mysqli_report() required until the version where the default was switched, and the requirement went away. A call to mysqli_report() is already required if you use exception-based error handling. The deprecation would force those people who use manual error handling by default to make an explicit choice. > > As others have said, the warning mode is pretty much entirely useless, > and what you really want (presumably) is to know about the places where you > need to explicitly call mysqli_report() to preserve the old behavior (or > explicitly switch to the new one). > > No, I want to know if I have any code which needs fixing so I can see how > I want to change those places e.g. a duplicate key from INSERT to REPLACE > or whatever the correct fix is. Without the code aborting. > Okay, I think I now get what you want. My line of thinking was that people who use manual error handling likely just want to keep doing that, and should opt-in to it once the default changes. You apparently want them to switch to use exceptions, in which case the warning mode might indeed be useful to identify cases where "expected" errors occur. However, I don't think this has much to do with the proposal at hand. If someone wants to migrate their code to use exceptions, that's of course great, but they could do that any time, regardless of what the default is. They could have done that ten years ago, and they could do it in ten years. This proposal is only about switching the default, which is why I mentioned the possibility of diagnosing cases where it may be observable. That said, I don't think doing so would actually be particularly useful in practice. And it wouldn't even address your particular concern. As such, I think the RFC should stick with the original proposal of simply flipping the default directly. Regards, Nikita --000000000000e3c3dc05b9e2dd1d--