[wp-trac] [WordPress Trac] #32154: Don't upgrade global tables for utf8mb4

WordPress Trac noreply at wordpress.org
Fri Jul 3 05:05:39 UTC 2015


#32154: Don't upgrade global tables for utf8mb4
--------------------------+-----------------------
 Reporter:  ocean90       |       Owner:  dd32
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  4.2.3
Component:  Database      |     Version:  4.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------

Comment (by dd32):

 > Is wp_should a convention we want to continue to use? I picked can since
 it matches existing nomenclature, and arguably WordPress should upgrade
 all tables all the time, but currently cannot for x/y/z reasons.

 On the other hand, WordPress can upgrade all tables all the time, but
 currently should not for x/y/z reasons (because it's not the right
 context, the constant is defined, etc.)

 The only places we currently use `can` is when the code is making a
 decision based on the permissions and versions it has available to it. So
 for example, If it checked that it has the `ALTER TABLE` permission, then
 I'd expect it to use `can`.

 > Why remove the (bool) type cast? I think it's better to be explicit
 after filters are applied, to ensure strict comparisons don't produce
 undesirable results, especially with something sensitive like this.
 I don't think we should be explicit when not necessary, there should be no
 strict checks on a boolean function, and plugins should behave themselves
 and return the documented data.
 The only case where the removal would've been beneficial is when a)
 someone filters it and return a non-bool result, and b) when a plugin is
 running an explicit test, which wasn't needed in the first place.
 There are no other cases (that I can see) where we use `return (bool)
 apply_filters()`.

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


More information about the wp-trac mailing list