diff --git a/adodb.inc.php b/adodb.inc.php index 48a59f070..bd6bb873c 100644 --- a/adodb.inc.php +++ b/adodb.inc.php @@ -458,7 +458,14 @@ abstract class ADOConnection { // var $dataProvider = 'native'; var $databaseType = ''; /// RDBMS currently in use, eg. odbc, mysql, mssql - var $database = ''; /// Name of database to be used. + + /** + * @var string Current database name. + * + * This used to be stored in the $databaseName property, which was marked + * as deprecated in 4.66 and removed in 5.22.5. + */ + public $database = ''; /** * @var string If the driver is PDO, then the dsnType is e.g. sqlsrv, otherwise empty diff --git a/drivers/adodb-db2.inc.php b/drivers/adodb-db2.inc.php index 16c4054f1..da65a540d 100644 --- a/drivers/adodb-db2.inc.php +++ b/drivers/adodb-db2.inc.php @@ -82,11 +82,6 @@ class ADODB_db2 extends ADOConnection { */ public $connectStmt = ''; - /* - * Holds the current database name - */ - private $databaseName = ''; - /* * Holds information about the stored procedure request * currently being built @@ -113,7 +108,7 @@ public function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename) private function doDB2Connect($argDSN, $argUsername, $argPassword, $argDatabasename, $persistent=false) { - + if (!function_exists('db2_connect')) { ADOConnection::outp("DB2 extension not installed."); return null; @@ -184,7 +179,7 @@ private function doDB2Connect($argDSN, $argUsername, $argPassword, $argDatabasen null, $db2Options); - + $this->_errorMsg = @db2_conn_errormsg(); if ($this->_connectionID && $this->connectStmt) @@ -207,7 +202,7 @@ private function doDB2Connect($argDSN, $argUsername, $argPassword, $argDatabasen private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatabasename) { - + $connectionParameters = array('dsn'=>'', 'uid'=>'', 'pwd'=>'', @@ -257,7 +252,7 @@ private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatab $errorMessage = 'Supply uncatalogued connection parameters '; $errorMessage.= 'in either the database or DSN arguments, '; $errorMessage.= 'but not both'; - + if ($this->debug) ADOConnection::outp($errorMessage); return null; @@ -282,7 +277,7 @@ private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatab { $errorMessage = 'For uncatalogued connections, provide '; $errorMessage.= 'both UID and PWD in the connection string'; - + if ($this->debug) ADOConnection::outp($errorMessage); return null; @@ -307,7 +302,7 @@ private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatab } elseif ($argDatabasename) { - $this->databaseName = $argDatabasename; + $this->database = $argDatabasename; $argDSN .= ';database=' . $argDatabasename; $argDatabasename = ''; $useCataloguedConnection = false; @@ -317,7 +312,7 @@ private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatab { $errorMessage = 'Uncatalogued connection parameters '; $errorMessage.= 'must contain a database= argument'; - + if ($this->debug) ADOConnection::outp($errorMessage); return null; @@ -347,9 +342,9 @@ private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatab } if ($argDatabasename) - $this->databaseName = $argDatabasename; - elseif (!$this->databaseName) - $this->databaseName = $this->getDatabasenameFromDsn($argDSN); + $this->database = $argDatabasename; + elseif (!$this->database) + $this->database = $this->getDatabasenameFromDsn($argDSN); $connectionParameters = array('dsn'=>$argDSN, @@ -1003,7 +998,7 @@ public function metaProcedures($procedureNamePattern = null, $catalog = null, $ */ public function metaDatabases(){ - $dbName = $this->getMetaCasedValue($this->databaseName); + $dbName = $this->getMetaCasedValue($this->database); return (array)$dbName; @@ -1618,10 +1613,10 @@ function _query(&$sql,$inputarr=false) { $this->_errorMsg = @db2_stmt_errormsg(); $this->_errorCode = @db2_stmt_error(); - + if ($this->debug) ADOConnection::outp($this->_errorMsg); - + return false; } } diff --git a/drivers/adodb-mssql.inc.php b/drivers/adodb-mssql.inc.php index 8fb92249c..269dd7ed3 100644 --- a/drivers/adodb-mssql.inc.php +++ b/drivers/adodb-mssql.inc.php @@ -541,7 +541,6 @@ function MetaTables($ttype=false,$showSchema=false,$mask=false) function SelectDB($dbName) { $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions if ($this->_connectionID) { return @mssql_select_db($dbName); } diff --git a/drivers/adodb-mssqlnative.inc.php b/drivers/adodb-mssqlnative.inc.php index 41bb7e3e8..f7e1bcc16 100644 --- a/drivers/adodb-mssqlnative.inc.php +++ b/drivers/adodb-mssqlnative.inc.php @@ -440,7 +440,6 @@ function RowLock($tables,$where,$col='1 as adodbignore') function SelectDB($dbName) { $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions if ($this->_connectionID) { $rs = $this->Execute('USE '.$dbName); if($rs) { diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php index 4948f1851..123b6d450 100644 --- a/drivers/adodb-mysqli.inc.php +++ b/drivers/adodb-mysqli.inc.php @@ -932,7 +932,7 @@ function MetaColumns($table, $normalize = true) $SQL = "SELECT column_name, column_type FROM information_schema.columns - WHERE table_schema='{$this->databaseName}' + WHERE table_schema='{$this->database}' AND table_name='$table'"; $schemaArray = $this->getAssoc($SQL); @@ -1017,7 +1017,6 @@ function SelectDB($dbName) { // $this->_connectionID = $this->mysqli_resolve_link($this->_connectionID); $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions if ($this->_connectionID) { $result = @mysqli_select_db($this->_connectionID, $dbName); diff --git a/drivers/adodb-odbtp.inc.php b/drivers/adodb-odbtp.inc.php index 41bd0873b..c352af55f 100644 --- a/drivers/adodb-odbtp.inc.php +++ b/drivers/adodb-odbtp.inc.php @@ -304,7 +304,6 @@ function SelectDB($dbName) return false; } $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions return true; } diff --git a/drivers/adodb-pdo_mysql.inc.php b/drivers/adodb-pdo_mysql.inc.php index c8812453f..a00c8595b 100644 --- a/drivers/adodb-pdo_mysql.inc.php +++ b/drivers/adodb-pdo_mysql.inc.php @@ -57,7 +57,7 @@ function OffsetDate($dayFraction, $date=false) return $date . ' + INTERVAL ' . $fraction . ' SECOND'; // return "from_unixtime(unix_timestamp($date)+$fraction)"; } - + /** * Get a list of indexes on the specified table. * @@ -266,7 +266,6 @@ function MetaColumns($table, $normalize=true) function SelectDB($dbName) { $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions $try = $this->Execute('use ' . $dbName); return ($try !== false); } @@ -275,7 +274,7 @@ function SelectDB($dbName) function SelectLimit($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs=0) { $nrows = (int) $nrows; - $offset = (int) $offset; + $offset = (int) $offset; $offsetStr =($offset>=0) ? "$offset," : ''; // jason judge, see PHPLens Issue No: 9220 if ($nrows < 0) { diff --git a/drivers/adodb-sybase.inc.php b/drivers/adodb-sybase.inc.php index b8db07479..9cc2cc77a 100644 --- a/drivers/adodb-sybase.inc.php +++ b/drivers/adodb-sybase.inc.php @@ -104,7 +104,6 @@ function RowLock($tables,$where,$col='top 1 null as ignore') function SelectDB($dbName) { $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions if ($this->_connectionID) { return @sybase_select_db($dbName); }