Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113311 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66831 invoked from network); 27 Feb 2021 18:21:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Feb 2021 18:21:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0A51C1804F2 for ; Sat, 27 Feb 2021 10:10:57 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 10:10:56 -0800 (PST) Received: by mail-ed1-f43.google.com with SMTP id d13so10043617edp.4 for ; Sat, 27 Feb 2021 10:10:56 -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=/OxJzx8+vqRbhE4HbRc82Pi6zDTw/q4e2fHUyhfxy6I=; b=UUXSKcz8wgNCF00q4QJy77beWKZmaWoDqAGjpldVWSFt1V8B+DQUSozYeRRqzPG2J7 bQBMeYDqBwzOhqODr2It0FVljQSsfcAFJ1GrbH6Tdql9LPvRc8cGcsE5TIp/3qxy2pxN UNZFmEFrMHE73MDJHT9YAPT0efTE/8q39P0ZQeW05XmPn6SF0rpNXmHOL3fSvU+j9JI1 72vE9RpQOlPovq/B9Su6oopL0CqcqwHPsdDFVtym3MhrKF3eRs6fE7Z17EFTXXwXLQfQ AFeYWoErRXdwlrEUOTi1TAkhN8YbklnQ/YTNiQmhFA5qeo57L35K9bqvy3AFUVLn4eqd drrA== 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=/OxJzx8+vqRbhE4HbRc82Pi6zDTw/q4e2fHUyhfxy6I=; b=BABrcjMPTBS4OZuh0zgfsDj+lARd/aDRnrhjj7bdrDXOAAtSo0C05+6oIG9pFo6Z++ JzbDrJWKbDRxs3l6tvzSRBUNJv7Jzy9I7XgRHZ90hocrNlSvXCN11SW4XCc9rKQYt3uC 4EG7wEkNP68gons/HGjWwlutZoMsOjop6gKLIkMCVxZqh9Tko835sPGLnvfIhUrZPkBK MmYoqQHpyw1kA2LOO5UEmviUA5neR4VkoFe+4ZscnGmLLe8EKD3VEkOIcK9m2f1snorZ HxobGH444MFaVB8LQR9W4/rxtDihBsn2t5NmEgGHkTOR3WlS768NRaUXXNhfO2EyxsfJ kU1g== X-Gm-Message-State: AOAM5304HWLDtLtcs188gxYT/BIFsRmjMw33YCnk/DnndfcdTRUdWrux zBVQECfzCuUmMeJKCbAh+GjtH3cmTPnet4gjLGw= X-Google-Smtp-Source: ABdhPJyGAKGe0iKX4ULa3OJmELQ0V+5D7YYCzID6Ktcedx1WR2j4uWPS9pQM7C84RlkRk5k06lZfR01E4xV/keIfsyQ= X-Received: by 2002:a05:6402:b1c:: with SMTP id bm28mr9231376edb.354.1614449454626; Sat, 27 Feb 2021 10:10:54 -0800 (PST) MIME-Version: 1.0 References: <84a86f15-313e-1fb3-eb09-7fd6bbdeb5ce@php.net> <821813eb972cd5dad30a0e10385a115a9a8908a2.camel@schlueters.de> <2d9e003c-2a05-9cfa-8625-5aedf5b069f6@gmail.com> <445707c1-2b67-1f46-8d93-d9e0ca420b87@gmail.com> In-Reply-To: <445707c1-2b67-1f46-8d93-d9e0ca420b87@gmail.com> Date: Sat, 27 Feb 2021 18:10:43 +0000 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000403afb05bc554e3c" Subject: Re: [PHP-DEV] [RFC]: Change Default mysqli Error Mode From: tekiela246@gmail.com (Kamil Tekiela) --000000000000403afb05bc554e3c Content-Type: text/plain; charset="UTF-8" > > Select * From products Where product_id = 'hello world' > > If product_id is a column of type int, then the database will raise an > error about incompatible types. > No, this query would produce a warning. I am unaware of an SQL mode that would turn this warning into an error. Maybe I am wrong and there is a way to convert this into an error, but that would be pointless. I believe you have chosen the wrong example. That query, even when executed with PDO, doesn't throw an exception. The point of this RFC is that mysqli should treat SQL errors the same way that PDO does. By default, all errors should be reported. An error in SQL is the same as an exception in PHP code; it means that something went terribly wrong. I have been using PDO for a few years now and I never had a need to silence its error reporting. SQL doesn't spit out exceptions randomly. Examples, that would truly be effected are something like this: $stmt = $mysqli->query('INSERT INTO tableA (uniqueColumn) VALUE("repeated value")'); if (1062 === $mysqli->errno) { echo "Can't add this value because it already exists!"; } If the developer didn't silence the errors then the user will see a generic error instead of the specific one. --000000000000403afb05bc554e3c--