summaryrefslogtreecommitdiff
path: root/drivers/adodb-postgres7.inc.php
diff options
context:
space:
mode:
authorDamien Regad <dregad@mantisbt.org>2014-04-30 14:33:37 +0200
committerDamien Regad <dregad@mantisbt.org>2014-05-12 14:29:01 +0200
commitf54e496c19575027b1987c067554dd562f01bcf5 (patch)
tree9881c456fc0f5ebaf60bd58bc545db39bbf96d4f /drivers/adodb-postgres7.inc.php
parent701798f02ad2f06f7bba9e3922a2f6a9d8f05918 (diff)
downloadadodb-f54e496c19575027b1987c067554dd562f01bcf5.tar.gz
adodb-f54e496c19575027b1987c067554dd562f01bcf5.tar.bz2
adodb-f54e496c19575027b1987c067554dd562f01bcf5.zip
postgres7: fix system warning in MetaColumns() with schema
When calling MetaColumns with schema.table, the driver triggers a 'Warning: sprintf(): Too few arguments' because the metaColumnsSQL1 statement contains one more parameter in 7 compared to the 6.4 version. Resolved by adding a new protected _generateMetaColumnsSQL() method to handle the preparation of the appropriate SQL statement, and overriding it in the postgres7 driver. http://phplens.com/lens/lensforum/msgs.php?id=19481
Diffstat (limited to 'drivers/adodb-postgres7.inc.php')
-rw-r--r--drivers/adodb-postgres7.inc.php18
1 files changed, 17 insertions, 1 deletions
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