[wp-trac] [WordPress Trac] #42381: Wordpress update does not check if database structure/scheme on existing site is equal to how it would be on a new install

WordPress Trac noreply at wordpress.org
Tue Oct 31 03:18:07 UTC 2017


#42381: Wordpress update does not check if database structure/scheme on existing
site is equal to how it would be on a new install
-------------------------------+------------------------------
 Reporter:  mike_vl            |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Database           |     Version:  4.8.2
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by dd32):

 * keywords:   => reporter-feedback


Comment:

 Hi @mike_vl
 WordPress does include a mechanism to update the database tables, however,
 as you've possibly found out, not everything is "run again" - and in your
 case it sounds like there may be a step which was missed - or you've run
 into a bug.

 The Repair mode is also only for "Table repair" which in the context of
 MySQL is for crashed & unoptimized tables, not out-of-date table schemas.
 Adding table schema checks to repair.php isn't out of the question and
 could be useful to some.

 Would you be able to check what `db_version` you have in your options
 table? For reference, in 4.8.2 it should be `38590`.
 If it's that value - then that means the upgrade process either failed,
 was skipped, or some other issue may have occured (like a query failing,
 and not being taken into consideration). If the value you have is lower,
 it indicates that the upgrade process isn't being run at all.

 After you've seen the `db_version` and noted it for reply here, you can
 try to force an update to occur, which should hopefully  fix it, by
 lowering the version in the table by 1 and visiting `wp-admin` (This step
 happens transparently during version updates). Hopefully `db_delta()` will
 kick in and change the indexes at that point.
 I'd backup the database before running that though, purely in case it
 reveals a bug and we need to inspect the table schema's. You may also wish
 to enable `WP_DEBUG` to see any errors that occur during the update
 process if it's not successful.

 For reference, [https://core.trac.wordpress.org/browser/tags/4.8.2/src/wp-
 admin/includes/upgrade.php upgrade.php] and
 [https://core.trac.wordpress.org/browser/tags/4.8.2/src/wp-
 admin/includes/schema.php schema.php] is where most of the code lives for
 this.

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


More information about the wp-trac mailing list