Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #39768, comment 9


Ignore:
Timestamp:
12/22/2019 06:25:01 PM (5 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #39768, comment 9

    v1 v2  
    88It looks like that could introduce some unintended regressions when dealing with accented characters, or if the column charset doesn't match the session charset, e.g. `latin1` vs. `utf8mb4`.
    99
    10 Using `CONVERT()` appears to be a better option. While `utf8mb4` should be available on any modern install, that may not always be the case, so we have to check for it specifically, and fall back to the current query otherwise. This option also has some performance difference from the queries above in my testing:
     10Using `CONVERT()` appears to be a better option. While `utf8mb4` should be available on any modern install, that may not always be the case, so we have to check for it specifically, and fall back to the current query otherwise. This option also has a minor performance difference from the queries above in my testing:
    1111{{{
    1212SELECT post_id FROM wp_postmeta WHERE meta_key = '_wp_attached_file' AND meta_value = CONVERT( '2009/03/myimage.jpg' USING utf8mb4 ) COLLATE utf8mb4_bin