[wp-trac] [WordPress Trac] #31644: mysqli_get_client_version in wp-db

WordPress Trac noreply at wordpress.org
Fri Mar 27 10:54:50 UTC 2015

#31644: mysqli_get_client_version in wp-db
 Reporter:  filipac       |       Owner:  pento
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  4.2
Component:  Database      |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:

Comment (by MattyRob):

 Replying to [comment:13 pento]:
 > @MattyRob: Both functions return the same number, just in a different
 format. The problem is that `mysqlnd`'s version numbers don't match
 MySQL's, so we need to detect when `mysqlnd` is being used.

 In my testing I'm not seeing the same number returned. On on site where
 mysql is used I get 5.5.42 returned which is the same as the server MySQL
 version. While on a local host testing environment at home I get a long
 string of the mysqlnd version including 5.0.11 which is different from the
 MySQL version. (PHP 5.6.7 and MySQL 5.6.23)

 Can we check for the presence of the 'mysqlnd' string in the version
 string, does that cover all possibilities?
 if ( false !== stristr( $client_version, 'mysqlnd' ) ) {
         $client_version = preg_replace( '/[^0-9.].*/', '', $client_version
         return version_compare( $client_version, '5.0.9', '>=' );
 } else {
         return version_compare( $client_version, '5.5.3', '>=' );

Ticket URL: <https://core.trac.wordpress.org/ticket/31644#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list