[wp-trac] [WordPress Trac] #17065: Independent ASC/DESC in multiple ORDER BY statement.

WordPress Trac noreply at wordpress.org
Mon Mar 16 19:18:17 UTC 2015


#17065: Independent ASC/DESC in multiple ORDER BY statement.
----------------------------+-----------------------
 Reporter:  ericmann        |       Owner:  ericmann
     Type:  task (blessed)  |      Status:  closed
 Priority:  normal          |   Milestone:  4.0
Component:  Query           |     Version:  3.1
 Severity:  normal          |  Resolution:  fixed
 Keywords:  has-patch       |     Focuses:
----------------------------+-----------------------

Comment (by boonebgorges):

 Replying to [comment:75 joshcanhelp]:
 > Happy to help ... but I'm not familiar with the term "CAST issue." Is
 there a format you'd like me to follow?
 >
 > Also happy to write a test but have never done so for core before and
 the docs section covering that is a TODO:
 >
 > https://make.wordpress.org/core/handbook/automated-testing/#writing-
 tests

 Sorry - my reading of the reports above make it look like this is a
 problem with the data types used when `WP_Query` uses `CAST` when parsing
 orderby tokens https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/query.php?marks=2290#L2259. This is totally a guess though, as I
 haven't looked into it :)

 Regarding the unit test. Here is an example of a simple unit test that
 tests 'orderby' using 'meta_query' on `WP_Query`
 https://core.trac.wordpress.org/browser/trunk/tests/phpunit/tests/query/metaQuery.php#L1264.
 If you want to have a go at it, you might copy that one and rewrite it to
 test your post_date + meta_value_num combination. But feel free to open
 the ticket without the unit test!

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


More information about the wp-trac mailing list