From 0728b8b911817c531cc3fccb200213c68836bfdd Mon Sep 17 00:00:00 2001 From: hawk__ Date: Mon, 1 Feb 2010 21:34:28 +0000 Subject: [PATCH] Reordered date_funcs array to have DAYOFMONTH handled first git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@200846 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- pg4wp/driver_pgsql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pg4wp/driver_pgsql.php b/pg4wp/driver_pgsql.php index 660226c..4a5c387 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -134,10 +134,10 @@ $sql = preg_replace( $pattern, 'ROUND(DATE_PART(\'epoch\',$1))', $sql); $date_funcs = array( + 'DAYOFMONTH(' => 'EXTRACT(DAY FROM ', 'YEAR(' => 'EXTRACT(YEAR FROM ', 'MONTH(' => 'EXTRACT(MONTH FROM ', 'DAY(' => 'EXTRACT(DAY FROM ', - 'DAYOFMONTH(' => 'EXTRACT(DAY FROM ', ); $sql = str_replace( 'ORDER BY post_date DESC', 'ORDER BY YEAR(post_date) DESC, MONTH(post_date) DESC', $sql);