[wp-trac] [WordPress Trac] #36625: Don't CAST the post meta value to CHAR in meta query

WordPress Trac noreply at wordpress.org
Mon May 30 04:35:18 UTC 2016


#36625: Don't CAST the post meta value to CHAR in meta query
-------------------------+---------------------------
 Reporter:  ericlewis    |       Owner:  boonebgorges
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:  4.6
Component:  Query        |     Version:  3.1
 Severity:  normal       |  Resolution:  fixed
 Keywords:               |     Focuses:
-------------------------+---------------------------
Changes (by boonebgorges):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"37594"]:
 {{{
 #!CommitTicketReference repository="" revision="37594"
 In `WP_Meta_Query`, don't cast `meta_value` to `CHAR`.

 `CHAR` is redundant, since the `meta_value` column is `LONGTEXT`.
 Meanwhile,
 use of `CAST()` causes MySQL to ignore any index that the administrator
 may
 have added to the column.

 A number of automated tests were doing searches for `CAST` in the SQL
 strings
 generated by `WP_Meta_Query` (for reasons unrelated to the `CAST()`
 behavior).
 These tests have been updated to expect the new query format.

 Props ericlewis.
 Fixes #36625.
 }}}

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


More information about the wp-trac mailing list