From ede2bbe0d600e3bfbce5a842d9bc145236f0aec7 Mon Sep 17 00:00:00 2001 From: hawk__ Date: Wed, 20 Jan 2010 07:32:26 +0000 Subject: [PATCH] Moved 'INTERVAL 15 DAY' to a better place to handle DELETES git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@195684 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- pg4wp/driver_pgsql.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pg4wp/driver_pgsql.php b/pg4wp/driver_pgsql.php index 4809e9d..9189a6a 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -125,8 +125,6 @@ $sql = preg_replace($pattern, 'LIMIT $2 OFFSET $1', $sql); $sql = str_replace('INTERVAL 120 MINUTE', "'120 minutes'::interval", $sql); - // The following handles a new "INTERVAL" call in Akismet 2.2.7 - $sql = str_replace('INTERVAL 15 DAY', "'15 days'::interval", $sql); $pattern = '/DATE_ADD[ ]*\(([^,]+),([^\)]+)\)/'; $sql = preg_replace( $pattern, '($1 + $2)', $sql); @@ -257,6 +255,9 @@ elseif( defined('WP_INSTALLING') && WP_INSTALLING) $sql = pg4wp_installing( $sql, $logto); + // The following handles a new "INTERVAL" call in Akismet 2.2.7 + $sql = str_replace('INTERVAL 15 DAY', "'15 days'::interval", $sql); + // Field names with CAPITALS need special handling if( false !== strpos($sql, 'ID')) {