From: Michael J. Rubinsky Date: Thu, 4 Nov 2010 18:25:38 +0000 (-0400) Subject: Fix generation of INTERVAL clause in the default case, fix method call X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=114c7e284060f2b3be88d2eab8285333226a2ea5;p=horde.git Fix generation of INTERVAL clause in the default case, fix method call --- 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'); } }