Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113320 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 86527 invoked from network); 27 Feb 2021 21:06:20 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Feb 2021 21:06:20 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2246918050B for ; Sat, 27 Feb 2021 12:55:54 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 ; Sat, 27 Feb 2021 12:55:53 -0800 (PST) Received: by mail-wr1-f46.google.com with SMTP id v15so12015244wrx.4 for ; Sat, 27 Feb 2021 12:55:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9WO5bnyOGnBGCInI+pbe8rM3LeD3vvDfTvB/waq5TS4=; b=g1BdH/tepjfJ2e6B11WGp3zL+JIIQSSdtafC14+fACQcNVFvVLE22yfKa1mLIcN5SD NaiynkMHxe0Ziu0pzCCrKGZBxRx4FpMMzHGMlTlpciQxRuICZwrkkcC3zCdPMZ3BHyo1 FJtWbQAZbbXdQssQUCcOlDANKWSR7/WT5Zyyj/i1Mtp9aHPMYvHEBYwdGtS20DIjhT8E K+vXwg3FRH92lpvqqLgyifaE2K9MFqsfH3WGJWYacc9miNGnUWU+cskP47Uq0885+MfQ oPJqBf2ITdE6Oeoa4vbaSDVrqPI+kUF4LgwI1id0jJAJG/AqvBpHZu0V1vD9nEy4It+s ysmg== 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=9WO5bnyOGnBGCInI+pbe8rM3LeD3vvDfTvB/waq5TS4=; b=JzuVugMni+8EDeDh4j24O1RQq1bV3ZXSaWZTcMrK9p8HSft/ABBpC1oFmhdsvZkfy9 WwFplmIpWw99DoutSVVF+3ImYrUglXSWFqtCj1G99HhD+gHCMOrH/GPrFevQW3l2zSFz LIVA48DuusudJ/IBMpTy7WcQcjg7gNwNERwqF3KLN13otMebVoJ6WhMzR030oBSEZonT zNdWCrCs0TmVXx4IfVLEccTXdWKuVMk09+J6aKEsPMzrdm/mWr9EoR0f6xcoVnWyzjMa qby3w2Z6zIFl19dzFlmHGBeIXgUf3GDTCYnnj+6hPfZMEgCeV4NeeUY7Ycxxl380lGhV pR7A== X-Gm-Message-State: AOAM53143vqDwIPMdxjrLOnV/1QuGJQXaYGXWmKM3jMHHijP926HGoY7 n6+zYdJv/zSP9j0xLraGxEBHGbHv/CIgHTu6GvUalA== X-Google-Smtp-Source: ABdhPJy0oZlpV7QpbTof1bga4WIuIfdOP4+I+/98999lhGklNAMWJ0ml17Hmk3WolGGB4LZKcUdpFWPR8rrFWBvCDh4= X-Received: by 2002:a5d:4203:: with SMTP id n3mr9225218wrq.116.1614459351464; Sat, 27 Feb 2021 12:55:51 -0800 (PST) MIME-Version: 1.0 References: <84a86f15-313e-1fb3-eb09-7fd6bbdeb5ce@php.net> <821813eb972cd5dad30a0e10385a115a9a8908a2.camel@schlueters.de> In-Reply-To: Date: Sat, 27 Feb 2021 21:55:40 +0100 Message-ID: To: Kamil Tekiela Cc: =?UTF-8?Q?Johannes_Schl=C3=BCter?= , Sebastian Bergmann , PHP internals Content-Type: multipart/alternative; boundary="000000000000260a2305bc579cc2" Subject: Re: [PHP-DEV] [RFC]: Change Default mysqli Error Mode From: kontakt@beberlei.de (Benjamin Eberlei) --000000000000260a2305bc579cc2 Content-Type: text/plain; charset="UTF-8" On Sat, Feb 27, 2021 at 5:24 PM Kamil Tekiela wrote: > > > > The issue is, as said, that this only happens in an error situation. > > Thus if users only test "does my site still work after update?" (what > > many do ...) won't notice this, till something fails, which would have > > been caught nice beforehand. > > > > I don't see why this would be such an issue. If the code fails for any > reason then an error is produced. The error might be surprising, but it is > not something that would cause problems. > I think you are very wrong about this, there could be perfectly valid code doing: if (!$conn->query("select 1") && $conn->errno == 2006) { // mysql gone away $conn = new mysqli(....); } With your proposed change the query would throw an exception instead, potentially breaking follow up code that is required to run. This is the kind of code you have that only gets triggered every 100000 times and that is very hard to write a real test for. If the test here uses a mock, then you wont catch the behavior change. > This change fixes more problems than it creates. I believe it is still > worthy to put it in 8.1. Every PHP release contains backwards-incompatible > changes. In comparison to other BC changes PHP has put in minor releases > this one has a very easy fix. You don't have to scour the code looking for > places to fix. > There are projects out there that do a mysqli_connect on *every* script. You underestimate the impact of this break. PHP can't improve if we have to think of people who upgrade without reading > the release notes. We also shouldn't be held back by outdated tutorials. In > fact, this will help people who still use such tutorials. This isn't a > major change that would affect everyone on the planet. This will only > affect people who still use mysqli and didn't set the error reporting mode > before upgrading. > I am sorry, but to me that feels a bit like you want to take the easy way out.. As a counterexample, Nikita made a very good RFC for 8.1 / 9.0 deprecating and changing the nullable to internal functions behavior: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg This RFC goes above and beyond to provide a migration path, deprecation messages and such. Yes it has a higher potential break impact, but i don't expect this change to wait until 9.0 either. I would wish your RFC would throw a deprecation message in 8.1 that you cannot make a query without setting the reporting level before by calling mysqil_report() explicitly. Then in 8.2 we could change the behavior. > I understand your worries but I don't think this is a good enough reason to > not go ahead with this change. > > Kind regards, > Kamil > --000000000000260a2305bc579cc2--