summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/docs-adodb.htm1
-rw-r--r--drivers/adodb-postgres64.inc.php18
-rw-r--r--drivers/adodb-postgres7.inc.php18
3 files changed, 34 insertions, 3 deletions
diff --git a/docs/docs-adodb.htm b/docs/docs-adodb.htm
index de19196f..1b8b0239 100644
--- a/docs/docs-adodb.htm
+++ b/docs/docs-adodb.htm
@@ -6175,6 +6175,7 @@ PHP</a>. </p>
<p>adodb: Fix regex in Version(). See Github #16
<p>memcache: use include_once() to avoid issues with PHPUnit. See http://phplens.com/lens/lensforum/msgs.php?id=19489
<p>mssqlnative: Use ADOConnection::outp instead of error_log. See Github #12
+<p>postgres7: fix system warning in MetaColumns() with schema. See http://phplens.com/lens/lensforum/msgs.php?id=19481
<p><a name=5.19><b>5.19 - 23-Apr-2014</b>
<p>adodb: GetRowAssoc will return null as required. See http://phplens.com/lens/lensforum/msgs.php?id=19289
diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php
index acca56f0..896458d7 100644
--- a/drivers/adodb-postgres64.inc.php
+++ b/drivers/adodb-postgres64.inc.php
@@ -470,6 +470,21 @@ a different OID if a database must be reloaded. */
#return "($date+interval'$dayFraction days')";
}
+ /**
+ * Generate the SQL to retrieve MetaColumns data
+ * @param string $table Table name
+ * @param string $schema Schema name (can be blank)
+ * @return string SQL statement to execute
+ */
+ protected function _generateMetaColumnsSQL($table, $schema)
+ {
+ if ($schema) {
+ return sprintf($this->metaColumnsSQL1, $table, $table, $schema);
+ }
+ else {
+ return sprintf($this->metaColumnsSQL, $table, $table, $schema);
+ }
+ }
// for schema support, pass in the $table param "$schema.$tabname".
// converts field names to lowercase, $upper is ignored
@@ -488,8 +503,7 @@ a different OID if a database must be reloaded. */
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- if ($schema) $rs = $this->Execute(sprintf($this->metaColumnsSQL1,$table,$table,$schema));
- else $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table,$table,$table));
+ $rs = $this->Execute($this->_generateMetaColumnsSQL($table, $schema));
if (isset($savem)) $this->SetFetchMode($savem);
$ADODB_FETCH_MODE = $save;
diff --git a/drivers/adodb-postgres7.inc.php b/drivers/adodb-postgres7.inc.php
index 6cb7226f..6efc599b 100644
--- a/drivers/adodb-postgres7.inc.php
+++ b/drivers/adodb-postgres7.inc.php
@@ -126,7 +126,23 @@ class ADODB_postgres7 extends ADODB_postgres64 {
}
return $sql;
}
- */
+ */
+
+ /**
+ * Generate the SQL to retrieve MetaColumns data
+ * @param string $table Table name
+ * @param string $schema Schema name (can be blank)
+ * @return string SQL statement to execute
+ */
+ protected function _generateMetaColumnsSQL($table, $schema)
+ {
+ if ($schema) {
+ return sprintf($this->metaColumnsSQL1, $table, $table, $table, $schema);
+ }
+ else {
+ return sprintf($this->metaColumnsSQL, $table, $table, $schema);
+ }
+ }
/**
* @returns assoc array where keys are tables, and values are foreign keys