[wp-trac] [WordPress Trac] #23033: Decimal and numeric options in meta_query do not produce correct MYSQL for floating point numbers comparisons

WordPress Trac noreply at wordpress.org
Tue Jan 15 15:06:51 UTC 2013


#23033: Decimal and numeric options in meta_query do not produce correct MYSQL for
floating point numbers comparisons
--------------------------+-----------------------------
 Reporter:  ericlewis     |       Owner:  wonderboymusic
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  3.6
Component:  Query         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |
--------------------------+-----------------------------

Comment (by ericlewis):

 We'll also need to be able to specify the precision and scale for fixed-
 point data types. I suggest that we use the convention of defining the
 precision and scale in the 'type' field, and explode the string for
 parsing when we need to.

 {{{

 $stuff = new WP_Query( array(
         'meta_query' => array(
                 array(
                         'key' => '_edit_last',
                         'type' => 'decimal(3, 1)',
                         'compare' => '=',
                         'value' => 10.5
                 )
         )
 ) );

 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23033#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list