From 114c7e284060f2b3be88d2eab8285333226a2ea5 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 4 Nov 2010 14:25:38 -0400 Subject: [PATCH] Fix generation of INTERVAL clause in the default case, fix method call --- framework/SQL/SQL.php | 3 +-- kronolith/migration/3_kronolith_upgrade_addallday.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/framework/SQL/SQL.php b/framework/SQL/SQL.php index d455aca24..e2729599d 100644 --- a/framework/SQL/SQL.php +++ b/framework/SQL/SQL.php @@ -187,7 +187,6 @@ class Horde_SQL { public function buildIntervalClause($dbh, $interval, $precision) { $type = $dbh instanceof Horde_Db_Adapter ? Horde_String::lower($dbh->adapterName()) : $dbh->phptype; - var_dump($type); switch ($type) { case 'pgsql': case 'pdo_postgresql': @@ -197,7 +196,7 @@ class Horde_SQL { $clause = 'INTERVAL ' . $interval . '(' . $precision . ')'; break; default: - $clause = 'INTERVAL ' . $interval . ' ' . $precision; + $clause = 'INTERVAL ' . $precision . ' ' . $interval; } return $clause; diff --git a/kronolith/migration/3_kronolith_upgrade_addallday.php b/kronolith/migration/3_kronolith_upgrade_addallday.php index 446c868d8..95b0b5808 100644 --- a/kronolith/migration/3_kronolith_upgrade_addallday.php +++ b/kronolith/migration/3_kronolith_upgrade_addallday.php @@ -21,7 +21,7 @@ class KronolithUpgradeAddAllDay extends Horde_Db_Migration_Base $cols = $t->getColumns(); if (!in_array('event_allday', array_keys($cols))) { $this->addColumn('kronolith_events', 'event_allday', 'integer', array('default' => 0)); - $this->_connection->execute('UPDATE kronolith_events SET event_allday = 1 WHERE event_start + ' . Horde_SQL::buildIntervalClause($this->_connection, '1 DAY') . ' = event_end'); + $this->_connection->execute('UPDATE kronolith_events SET event_allday = 1 WHERE event_start + ' . Horde_SQL::buildIntervalClause($this->_connection, 'DAY', 1) . ' = event_end'); } } -- 2.11.0