From 12fe54df5b5e3363697aa8cffecfd6b85aded672 Mon Sep 17 00:00:00 2001 From: Andy Theuninck Date: Wed, 11 May 2016 16:22:25 -0500 Subject: 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 --- drivers/adodb-pdo.inc.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers') 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) { -- cgit v1.3