|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #51499 mysql_warning_count to be implemented
Submitted: 2010-04-07 18:37 UTC Modified: 2021-08-09 11:12 UTC
Avg. Score:4.6 ± 0.9
Reproduced:21 of 21 (100.0%)
Same Version:16 (76.2%)
Same OS:17 (81.0%)
From: andrew at ajohnstone dot com Assigned: cmb (profile)
Status: Wont fix Package: PDO related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-04-07 18:37 UTC] andrew at ajohnstone dot com
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.

This would need to be implemented for other drivers too.


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-26 13:53 UTC]
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.
 [2021-02-10 11:00 UTC] daniel dot beardsley at gmail dot com
I opened a pull request on github to add this feature:
 [2021-06-24 10:02 UTC]
The following pull request has been associated:

Patch Name: Fix #51499 PDO: add mysql-specific warning count function
On GitHub:
 [2021-08-09 11:12 UTC]
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-08-09 11:12 UTC]
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] <>
[2] <>
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 06:01:30 2024 UTC