[wp-trac] [WordPress Trac] #62061: Prepare for PHP 8.4

WordPress Trac noreply at wordpress.org
Mon Sep 30 22:08:18 UTC 2024


#62061: Prepare for PHP 8.4
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:  (none)
     Type:  task (blessed)                       |      Status:  new
 Priority:  normal                               |   Milestone:  6.7
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php-84 has-patch has-unit-tests      |     Focuses:  php-
  needs-dev-note                                 |  compatibility
-------------------------------------------------+-------------------------

Comment (by jrf):

 Replying to [comment:53 kkmuffme]:
 > mysql error code changed from 2006 to 4031 https://github.com/php/php-
 src/blob/php-8.4.0RC1/UPGRADING#L102 but this isn't handled yet in class-
 wpdb.php yet

 @kkmuffme Good catch, though this should be qualified a little as per the
 changelog entry:

 > The error code reported for MySQL server wait timeouts has been changed
 from 2006
 > to 4031 for MySQL server versions 8.0.24 and above.

 This was not caught in the review as:
 1. There are clearly no tests covering the code referencing the error
 code, so this will need a test.
 2. I'm a little stunned there are no PHP native constants for these error
 codes which can be referenced.

 This will need a patch with tests (if it's possible to mock this
 situation), but the patch would need to take the MySQL server version into
 account. I suggest handling that via a `version_compare()` against the
 return value of `wpdb::db_server_info()`.

 Would you like to create a patch for this ?

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


More information about the wp-trac mailing list