[wp-trac] [WordPress Trac] #59481: dbDelta do useless request when type case is not the same between query and describe result

WordPress Trac noreply at wordpress.org
Fri Sep 12 15:37:53 UTC 2025


#59481: dbDelta do useless request when type case is not the same between query and
describe result
---------------------------+------------------------------
 Reporter:  tristanleboss  |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Database       |     Version:  6.3
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------
Changes (by leewillis77):

 * keywords:  has-patch =>


Comment:

 The PR mentioned is unrelated to this issue. The problem reported in this
 ticket appears to be down to an incorrect comparison in line 3204 of
 upgrade.php: https://github.com/WordPress/WordPress/blob/master/wp-
 admin/includes/upgrade.php#L3204

 In my specific case the comparison

 {{{#!php
 $tablefield->Type !== $fieldtype
 }}}

 is comparing 'longtext' with 'LONGTEXT'. Clearly these are the same types
 and no table alteration is required, but this comparison fails and an
 alter statement is generated needlessly. I suspect that changing
 $fieldtype to $fieldtype_without_parentheses would resolve this. If that
 seems sensible then patch to follow.

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


More information about the wp-trac mailing list