Re: [RFC]: Change Default mysqli Error Mode

From: Date: Wed, 27 Jan 2021 14:35:04 +0000
Subject: Re: [RFC]: Change Default mysqli Error Mode
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-113003@lists.php.net to get a copy of this message
Am 27.01.2021 um 14:34 schrieb Nikita Popov <nikita.ppv@gmail.com>:
> 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?

> 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.

Yes, individual developers can switch on mysqli_report(MYSQLI_REPORT_ERROR) *now* to get this
behavior but I still think this makes more sense as a default. Otherwise the temptation is big to
just add a global mysqli_report(MYSQLI_REPORT_OFF) everywhere just in case.

- Chris


Thread (39 messages)

« previous php.internals (#113003) next »