Drop hasRules(). Identation fixes.
authorsoranzo <soranzo>
Wed, 14 Jul 2004 18:32:02 +0000 (18:32 +0000)
committersoranzo <soranzo>
Wed, 14 Jul 2004 18:32:02 +0000 (18:32 +0000)
classes/database/BaseDB.php
classes/database/Postgres.php
classes/database/Postgres72.php

index 04f56275123873a2aaca6f56ce04099312564c7a..be11546eca07686b9e401f930f24582305ee2ba7 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: BaseDB.php,v 1.51 2004/07/13 09:00:40 chriskl Exp $
+ * $Id: BaseDB.php,v 1.52 2004/07/14 18:32:02 soranzo Exp $
  */
 
 include_once('./classes/database/ADODB_base.php');
@@ -250,7 +250,6 @@ class BaseDB extends ADODB_base {
        function hasOperators() { return false; }
        function hasTypes() { return false; }
        function hasAggregates() { return false; }
-       function hasRules() { return false; }
        function hasLanguages() { return false; }
        function hasSchemas() { return false; }
        function hasConversions() { return false; }     
index b64eeebcbe69a9558f3cb4a07a0012439e027792..be4012faf1dc33d5130d5a53f2637caf02e4017b 100755 (executable)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres.php,v 1.235 2004/07/13 16:33:37 jollytoad Exp $
+ * $Id: Postgres.php,v 1.236 2004/07/14 18:32:02 soranzo Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -689,20 +689,18 @@ class Postgres extends BaseDB {
                }
 
                // Rules
-               if ($this->hasRules()) {
-                       $rules = &$this->getRules($table);
-                       if (!is_object($rules)) {
-                               $this->rollbackTransaction();
-                               return null;
-                       }
+               $rules = &$this->getRules($table);
+               if (!is_object($rules)) {
+                       $this->rollbackTransaction();
+                       return null;
+               }
 
-                       if ($rules->recordCount() > 0) {
-                               $sql .= "\n-- Rules\n\n";
-                               while (!$rules->EOF) {
-                                       $sql .= $rules->f['definition'] . "\n";
+               if ($rules->recordCount() > 0) {
+                       $sql .= "\n-- Rules\n\n";
+                       while (!$rules->EOF) {
+                               $sql .= $rules->f['definition'] . "\n";
 
-                                       $rules->moveNext();
-                               }
+                               $rules->moveNext();
                        }
                }
 
@@ -3614,8 +3612,8 @@ class Postgres extends BaseDB {
                $this->clean($comment);
                $status = $this->setComment('FUNCTION', "\"{$newname}\"({$args})", null, $comment);
                if ($status != 0) {
-                 $this->rollbackTransaction();
-                 return -4;
+                       $this->rollbackTransaction();
+                       return -4;
                }
 
                $status = $this->endTransaction();
@@ -3897,7 +3895,6 @@ class Postgres extends BaseDB {
        function hasTypes() { return true; }
        function hasAggregates() { return true; }
        function hasIndicies() { return true; }
-       function hasRules() { return true; }
        function hasLanguages() { return true; }
        function hasSRFs() { return true; }
        function hasOpClasses() { return true; }
index fda16b471ce1a8455fe294795e3be8cff7bced33..48393cd76f82020f6432c16664f540fa7a0de717 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres72.php,v 1.72 2004/07/07 03:00:07 chriskl Exp $
+ * $Id: Postgres72.php,v 1.73 2004/07/14 18:32:02 soranzo Exp $
  */
 
 
@@ -360,8 +360,8 @@ class Postgres72 extends Postgres71 {
                $this->clean($comment);
                $status = $this->setComment('FUNCTION', "\"{$funcname}\"({$args})", null, $comment);
                if ($status != 0) {
-                 $this->rollbackTransaction();
-                 return -2;
+                       $this->rollbackTransaction();
+                       return -2;
                }
 
                // Rename the function, if necessary
@@ -370,8 +370,8 @@ class Postgres72 extends Postgres71 {
                        $sql = "ALTER FUNCTION \"{$funcname}\"({$args}) RENAME TO \"{$newname}\"";
                        $status = $this->execute($sql);
                        if ($status != 0) {
-                         $this->rollbackTransaction();
-                         return -3;
+                               $this->rollbackTransaction();
+                               return -3;
                        }
                }