From 479270637bd7e3eae61fe8d045893950848c41cb Mon Sep 17 00:00:00 2001 From: hawk__ Date: Tue, 19 Jan 2010 19:50:28 +0000 Subject: [PATCH] Add support for DAYOFMONTH( construct git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@195486 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- pg4wp/driver_pgsql.php | 7 ++++--- readme.txt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pg4wp/driver_pgsql.php b/pg4wp/driver_pgsql.php index 65ae3e0..7d470db 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -152,9 +152,10 @@ $sql = preg_replace( $pattern, '($1 + $2)', $sql); $date_funcs = array( - 'YEAR(' => 'EXTRACT(YEAR FROM ', - 'MONTH(' => 'EXTRACT(MONTH FROM ', - 'DAY(' => '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); diff --git a/readme.txt b/readme.txt index 0c382f6..3824d07 100644 --- a/readme.txt +++ b/readme.txt @@ -50,7 +50,7 @@ There is no screenshot for this plugin == Changelog == - +* Added DAYOFMONTH support (Thanks to Pete Deffendol for noticing the problem) * Upgrading from WP 2.8.6 to WP 2.9.1 works with a minor error Upgrading should remove an index on table "wp_options" that may not exist, throwing an error * Installing WP 2.9.1 works smoothly