[wp-trac] [WordPress Trac] #47286: WP_Query final SQL replaces int numbers to string in meta_query
WordPress Trac
noreply at wordpress.org
Tue Aug 20 22:21:58 UTC 2019
#47286: WP_Query final SQL replaces int numbers to string in meta_query
-------------------------------+------------------------------
Reporter: eddr | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 5.2
Severity: normal | Resolution: invalid
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Changes (by desrosj):
* keywords: => reporter-feedback
Comment:
Hi @eddr,
Thanks for this ticket! I'm sorry that it took so long to receive a
response.
I see you closed the ticket and marked it as `invalid`. Is this because
you were able to figure out the issue? I just want to make sure that
closing the ticket was intentional. In the future, please make sure to
include a detailed message whenever updating a ticket (especially when
closing) so that others can follow the thought process.
In MySQL, `UNSIGNED` and `SIGNED` represent types integers. `UNSIGNED` can
only be a positive integer, where as `SIGNED` can be a positive or
negative integer. Because the `meta_value` key is a `longtext` type, the
casting ensures the values are looked at as integers in the query.
As far as I know, all of the unit tests are still passing and I have not
seen any other reports that there is something going on with integer meta
value queries. I also did some testing in a local install and was unable
to produce any incorrect behaviors.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47286#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list