summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Theuninck <andy@gohanman.com>2016-05-11 16:22:25 -0500
committerDamien Regad <dregad@mantisbt.org>2016-05-25 20:20:19 +0200
commit12fe54df5b5e3363697aa8cffecfd6b85aded672 (patch)
tree25eaf0830e95ba3d3f3491df408411b690497192
parenta2ac4be2bf0a2a79661db3f26b9c4e492db984b2 (diff)
downloadadodb-12fe54df5b5e3363697aa8cffecfd6b85aded672.tar.gz
adodb-12fe54df5b5e3363697aa8cffecfd6b85aded672.tar.bz2
adodb-12fe54df5b5e3363697aa8cffecfd6b85aded672.zip
PDO: let driver handle SelectDB() and SQLDate() calls
Calls to ADODB_pdo::SelectDB() and ADODB_pdo::SQLDate() should be passed through to the underlying $_driver object. If the $database property of the underlying $_driver object isn't initialized correctly, the 1st call to MetaColumns using "schemaName.tableName" as an argument may alter the connection's currently selected database. Fixes #242, related to #40. Signed-off-by: Damien Regad <dregad@mantisbt.org>
-rw-r--r--drivers/adodb-pdo.inc.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/adodb-pdo.inc.php b/drivers/adodb-pdo.inc.php
index 91e98b77..7d3b4957 100644
--- a/drivers/adodb-pdo.inc.php
+++ b/drivers/adodb-pdo.inc.php
@@ -196,6 +196,7 @@ class ADODB_pdo extends ADOConnection {
$this->_driver->_connectionID = $this->_connectionID;
$this->_UpdatePDO();
+ $this->_driver->database = $this->database;
return true;
}
$this->_driver = new ADODB_pdo_base();
@@ -266,6 +267,16 @@ class ADODB_pdo extends ADOConnection {
return $this->_driver->OffsetDate($dayFraction,$date);
}
+ function SelectDB($dbName)
+ {
+ return $this->_driver->SelectDB($dbName);
+ }
+
+ function SQLDate($fmt, $col=false)
+ {
+ return $this->_driver->SQLDate($fmt, $col);
+ }
+
function ErrorMsg()
{
if ($this->_errormsg !== false) {