WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #47286


Ignore:
Timestamp:
05/20/2019 11:48:52 AM (16 months ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #47286 – Description

    initial v1  
    2424}}}
    2525
    26 
    2726result:
    28 
    29 **AND (
    30   ( wp_postmeta.meta_key = 'key' AND ''wp_postmeta.meta_value = '10''' )
    31 ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')**
     27{{{
     28AND (
     29  ( wp_postmeta.meta_key = 'key' AND wp_postmeta.meta_value = '10' )
     30) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')
     31}}}
    3232
    33332. using 'type' => numeric results in
    34 **AND (
    35   ( wp_postmeta.meta_key = 'key' AND ''CAST(wp_postmeta.meta_value AS SIGNED)'' = '10' )
    36 ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')"**
     34
     35{{{
     36AND (
     37  ( wp_postmeta.meta_key = 'key' AND CAST(wp_postmeta.meta_value AS SIGNED) = '10' )
     38) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')"
     39}}}
    3740
    3841which doesn't solve the problem + why casting the field and not the value?