[wp-trac] [WordPress Trac] #27703: Need additional db version information in WP3.9+

WordPress Trac noreply at wordpress.org
Tue Apr 8 01:56:44 UTC 2014


#27703: Need additional db version information in WP3.9+
-------------------------+-----------------------------
 Reporter:  webaware     |       Owner:  pento
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  Future Release
Component:  Database     |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  administration
-------------------------+-----------------------------
Changes (by pento):

 * keywords:  has-patch commit =>
 * milestone:  3.9 => Future Release


Comment:

 On further discussion, fixing `db_version()` is going to be significantly
 more difficult than I initially thought. It's currently being used to
 compare against version numbers, which breaks for anything except vanilla
 MySQL. Other DB servers, such as MariaDB, Postgres, Drizzle, SQLite and
 SQL Server all have different version numbering.

 I suspect in the future we'll offer extended version information, but it
 would need to offer full information, rather than just a string.

 In the mean time, plugin developers can work around this with the
 following:



 {{{
 if ( $wpdb->use_mysqli ) {
         $ver = mysqli_get_server_info( $wpdb->dbh );
 } else {
         $ver = mysql_get_server_info();
 }

 }}}


 Note that `use_mysqli` and `dbh` can indeed be accessed, as wpdb has a
 magic getter.

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


More information about the wp-trac mailing list