RFC: PDO MySQL get warning count

php.internals

Daniel Beardsley

5 years ago
Hi, I've gotten very little feedback on the "should I make an RFC about this?" question, so I went ahead and made an RFC: https://wiki.php.net/rfc/pdo-mysql-get-warning-count This is about a feature in an open pull request: https://github.com/php/php-src/pull/6677 which addresses an open issue in the bug tracker: https://bugs.php.net/bug.php?id=51499 Thanks for your consideration! Daniel

Claude Pache

5 years ago
> Le 26 févr. 2021 à 17:45, Daniel Beardsley <dbeardsl@gmail.com> a écrit : > > Hi, > > I've gotten very little feedback on the "should I make an RFC about this?" > question, so I went ahead and made an RFC: > https://wiki.php.net/rfc/pdo-mysql-get-warning-count > > This is about a feature in an open pull request: > https://github.com/php/php-src/pull/6677 > which addresses an open issue in the bug tracker: > https://bugs.php.net/bug.php?id=51499 > > Thanks for your consideration! > > Daniel
Hi, Warning count is one of the feature of mysqli that is missing in PDO. Last time I checked, there was no equivalent of mysqli_info(), which allows me (among other things) to retrieve the number of matched rows (in addition to the number of affected rows), and this is a blocker for me for switching from mysqli to PDO (in case I would want to switch for some reason). It may be appropriate to review other useful features of mysqli that are missing in PDO? —Claude

Christoph Becker

5 years ago
On 26.02.2021 at 17:45, Daniel Beardsley wrote:
> I've gotten very little feedback on the "should I make an RFC about this?" > question, so I went ahead and made an RFC: > https://wiki.php.net/rfc/pdo-mysql-get-warning-count > > This is about a feature in an open pull request: > https://github.com/php/php-src/pull/6677 > which addresses an open issue in the bug tracker: > https://bugs.php.net/bug.php?id=51499
The problem is that many consider adding driver specific methods to the PDO class a no-go. That resulted in a PDO_SQLITE specific RFC[1] to be declined. The preferred solution apparently would be to introduce proper subclasses for each driver. I am not sure whether this is viable at all, though. Unfortunate situation. :( [1] <https://wiki.php.net/rfc/implement_sqlite_openblob_in_pdo>
-- Christoph M. Becker

Daniel Beardsley

5 years ago
This RFC is considering adding a very tiny function wrapping a mysql function that hasn't changed in decades. This allows clients to see if their previous statement generated mysql warnings without having to do another network round trip to the DB. I've opened the pull with tests. It fixes the open bug: https://bugs.php.net/bug.php?id=51499. If there is no other feedback in a day or two, I'll probably move it to "In Voting". https://wiki.php.net/rfc/pdo-mysql-get-warning-count Thanks in advance for your thoughts! Daniel Beardsley On Fri, Feb 26, 2021 at 8:45 AM Daniel Beardsley <dbeardsl@gmail.com> wrote:

Matteo Beccati

5 years ago
Hi Daniel, thanks. This seems reasonable to me even though many might not share my point of view. The RFC would eventually apply to 8.1 as it's adding new functionality. Cheers On 05/04/2021 21:17, Daniel Beardsley wrote:
> This RFC is considering adding a very tiny function wrapping a mysql > function that hasn't changed in decades. This allows clients to see if > their previous statement generated mysql warnings without having to do > another network round trip to the DB. I've opened the pull with tests. It > fixes the open bug: https://bugs.php.net/bug.php?id=51499. If there is no > other feedback in a day or two, I'll probably move it to "In Voting". > > https://wiki.php.net/rfc/pdo-mysql-get-warning-count > > Thanks in advance for your thoughts! > Daniel Beardsley > > On Fri, Feb 26, 2021 at 8:45 AM Daniel Beardsley <dbeardsl@gmail.com> wrote: > >> Hi, >> >> I've gotten very little feedback on the "should I make an RFC about >> this?" question, so I went ahead and made an RFC: >> https://wiki.php.net/rfc/pdo-mysql-get-warning-count >> >> This is about a feature in an open pull request: >> https://github.com/php/php-src/pull/6677 >> which addresses an open issue in the bug tracker: >> https://bugs.php.net/bug.php?id=51499 >> >> Thanks for your consideration! >> >> Daniel >> >
-- Matteo Beccati Development & Consulting - http://www.beccati.com/