[wp-trac] [WordPress Trac] #5932: wpdb should reconnect and retry query when "MySQL server has gone away"

WordPress Trac noreply at wordpress.org
Fri Jan 31 07:03:26 UTC 2014


#5932: wpdb should reconnect and retry query when "MySQL server has gone away"
---------------------------------+-----------------------
 Reporter:  dtc                  |       Owner:  pento
     Type:  task (blessed)       |      Status:  reopened
 Priority:  normal               |   Milestone:  3.9
Component:  Database             |     Version:  3.0
 Severity:  normal               |  Resolution:
 Keywords:  has-patch 3.9-early  |     Focuses:
---------------------------------+-----------------------

Comment (by pento):

 attachment:5932.5.diff

 * Tidies up the `check_connection()` logic in `query()`
 * Unsuppresses the `mysql_errno()` call in `query()` (it had previously
 been causing problems with the unit test)
 * When `WP_DEBUG` is true, make sure we only show one warning if the
 `db_connect()` fails multiple times
 * When `WP_DEBUG` is false, fall back to `dead_db()` if the reconnect
 fails completely

 Still to do:
 * The error message in `check_connection()` needs to be more grammatically
 cromulent
 * PHPDocs need a once over

--
Ticket URL: <https://core.trac.wordpress.org/ticket/5932#comment:35>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list