fixes for search paths
authorchriskl <chriskl>
Mon, 6 Dec 2004 02:50:24 +0000 (02:50 +0000)
committerchriskl <chriskl>
Mon, 6 Dec 2004 02:50:24 +0000 (02:50 +0000)
HISTORY
classes/database/ADODB_base.php
classes/database/Postgres73.php

diff --git a/HISTORY b/HISTORY
index 45ae3b8cdba4c665372099ea9a118c0f5aed7409..9a55ec474c017897b1116ccb5e257bfd623f0df9 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -8,6 +8,8 @@ Bugs
 * Support 8.0beta5 schema tablespace changes
 * Help link fixes
 * Estimated row count in 7.0 and 7.1 fixes
+* Priviliges nav fix
+* Search path fix
 
 Translations
 * Romanian from Alin
index 1a232d59467c0bd1e24ccfd84c4272d324ac1330..096dce75aaa6e1b899989aed3fd6280b713a7719 100644 (file)
@@ -3,7 +3,7 @@
 /*
  * Parent class of all ADODB objects.
  *
- * $Id: ADODB_base.php,v 1.19 2004/07/19 03:01:53 chriskl Exp $
+ * $Id: ADODB_base.php,v 1.19.2.1 2004/12/06 02:50:24 chriskl Exp $
  */
 
 include_once('./libraries/errorhandler.inc.php');
@@ -310,6 +310,8 @@ class ADODB_base {
         * @return A PHP array
         */
        function phpArray($arr) {
+               if ($arr == '{}') return array();
+               
                $temp = explode(',', substr($arr, 1, strlen($arr) - 2));
                // Remove any quoting
                for ($i = 0; $i < sizeof($temp); $i++) {
index 8b1ff6a26ba0688381543b933e65ea7548cd5042..8105acfa1d97fa508fb503fceea1b19827d6fd37 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres73.php,v 1.140.2.1 2004/11/29 04:52:33 chriskl Exp $
+ * $Id: Postgres73.php,v 1.140.2.2 2004/12/06 02:50:24 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -89,7 +89,11 @@ class Postgres73 extends Postgres72 {
         */
        function setSearchPath($paths) {
                if (!is_array($paths)) return -1;
-               elseif (sizeof($paths) == 0) return -2;
+               elseif (sizeof($paths) == 0) return -2;         
+               elseif (sizeof($paths) == 1 && $paths[0] == '') {
+                       // Need to handle empty paths in some cases
+                       $paths[0] = 'pg_catalog';
+               }
                $this->fieldArrayClean($paths);
 
                $sql = 'SET SEARCH_PATH TO "' . implode('","', $paths) . '"';
@@ -103,6 +107,7 @@ class Postgres73 extends Postgres72 {
         */
        function getSearchPath() {
                $sql = 'SELECT current_schemas(false) AS search_path';
+               
                return $this->phpArray($this->selectField($sql, 'search_path'));
        }