Req #51499 [Opn->Wfx]: mysql_warning_count to be implemented

From: Date: Mon, 09 Aug 2021 11:12:08 +0000
Subject: Req #51499 [Opn->Wfx]: mysql_warning_count to be implemented
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235701@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=51499&edit=1

 ID:                 51499
 Updated by:         cmb@php.net
 Reported by:        andrew at ajohnstone dot com
 Summary:            mysql_warning_count to be implemented
-Status:             Open
+Status:             Wont fix
 Type:               Feature/Change Request
 Package:            PDO related
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Given that the respective RFC[1] has been declined, I'm closing
this ticket as WONTFIX.  That does not necessarily imply that this
feature will never be available, but rather that someone needs to
pursue the RFC process[2], improving on the previous RFC.

[1] <https://wiki.php.net/rfc/pdo-mysql-get-warning-count>
[2] <https://wiki.php.net/rfc/howto>


Previous Comments:
------------------------------------------------------------------------
[2021-06-24 10:02:37] cmb@php.net

The following pull request has been associated:

Patch Name: Fix #51499 PDO: add mysql-specific warning count function
On GitHub:  https://github.com/php/php-src/pull/6677
Patch:      https://github.com/php/php-src/pull/6677.patch

------------------------------------------------------------------------
[2021-02-10 11:00:28] daniel dot beardsley at gmail dot com

I opened a pull request on github to add this feature:
https://github.com/php/php-src/pull/6677

------------------------------------------------------------------------
[2010-08-26 13:53:18] uw@php.net

Well, JDBC has a getWarnings() method as part of its Statement class. I think PDO should have
something similar and do it in a generic way. So, even if there's a shortcut for MySQL,
I'd rather look into how to do this on the upper PDO level than adding the shortcut to
PDO_MySQL. PDO should try to have everything in the core that can be made part of the core. Without
knowing about the other databases, I wonder if PDO could follow the JDBC example.

------------------------------------------------------------------------
[2010-04-07 18:37:19] andrew at ajohnstone dot com

Description:
------------
The warning count is sent in the returned OK packet from a executed statement, however there is no
functionality within PDO to extract, how many warnings were triggered from the statement.

This will save on round trips to the database to identify whether data could have been truncated for
example.

http://dev.mysql.com/doc/refman/5.0/en/mysql-warning-count.html
http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol#Types_Of_Result_Packets

This would need to be implemented for other drivers too.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=51499&edit=1


Thread (5 messages)

« previous php.bugs (#235701) next »