[wp-trac] [WordPress Trac] #33501: Starting w/ WP4.2, upgrade scenario may fail for non-MySQL installs

WordPress Trac noreply at wordpress.org
Fri Aug 21 21:30:07 UTC 2015


#33501: Starting w/ WP4.2, upgrade scenario may fail for non-MySQL installs
--------------------------+-----------------------------
 Reporter:  RSkoon        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Database      |    Version:  4.3
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 CONFIGURATION:
 Current Wordpress
 Azure SQL DB w/ Brandoo DB Abstraction Plugin

 FORUM REPORTS:
 [https://wordpress.org/support/topic/update-to-421-on-azure-with-ms-sql-
 server]

 REPRO:
 Attempt to upgrade from < v4.2 to anything current

 RESULT:
 Endless loop for "database upgrade required" and / or HTTP 500 error

 EXPECTED:
 Upgrade to work properly

 DEBUG INFO:
 In wp-include\wp-db.php there are some checks for the table's charset.  At
 the beginning of each of these functions there is a quick check to
 determine whether or not it is a MySQL database.  The issue is that not
 all abstraction plugins are setting the is_mysql variable, thus causing
 these functions to return data that causes the upgrade to fail.

 There is a quick fix (tested on my production site up until 4.3) that
 appears to work, but it would likely be good for folks more familiar with
 the code to chime in on.

 In get_col_charset() and get_col_length() there is the following code:

 {{{
 Skip this entirely if this isn't a MySQL database.
 if ( false === $this->is_mysql ) {
         return false;
 }
 }}}

 Updating each instance (~lines 2404 and 2453) to the following solves the
 problem:

 {{{
 Skip this entirely if this isn't a MySQL database.
 if ( false === $this->is_mysql || empty( $this->is_mysql ) ) {
         return false;
 }
 }}}

 This is my first bug report, so not sure how it all works, but I can
 provide my copy of wp-db.php with the fix if that would be beneficial.

 Thanks for your attention to this!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33501>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list