Skip to content

Commit

Permalink
Merge branch 'hotfix/5.22'
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed May 18, 2023
2 parents 928936a + 913c802 commit 9f1f997
Show file tree
Hide file tree
Showing 24 changed files with 101 additions and 84 deletions.
2 changes: 2 additions & 0 deletions adodb-time.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* ADOdb Date Library.
*
* @deprecated 5.22.6 Use 64-bit PHP native functions instead.
*
* PHP native date functions use integer timestamps for computations.
* Because of this, dates are restricted to the years 1901-2038 on Unix
* and 1970-2038 on Windows due to integer overflow for dates beyond
Expand Down
14 changes: 13 additions & 1 deletion adodb.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ function HasFailedTrans() {
* @param array|bool $inputarr holds the input data to bind to.
* Null elements will be set to null.
*
* @return ADORecordSet|bool
* @return ADORecordSet|false
*/
public function Execute($sql, $inputarr = false) {
if ($this->fnExecute) {
Expand Down Expand Up @@ -1718,6 +1718,18 @@ function _Execute($sql,$inputarr=false) {
return $rs;
}

/**
* Execute a query.
*
* @param string|array $sql Query to execute.
* @param array $inputarr An optional array of parameters.
*
* @return mixed|bool Query identifier or true if execution successful, false if failed.
*/
function _query($sql, $inputarr = false) {
return false;
}

function CreateSequence($seqname='adodbseq',$startID=1) {
if (empty($this->_genSeqSQL)) {
return false;
Expand Down
17 changes: 16 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,27 @@ Older changelogs:

## [5.22.6] - Unreleased

### Deprecated

- Date/Time Library
[#970](https://github.com/ADOdb/ADOdb/issues/970)

### Fixed

- Creation of dynamic property deprecated warning in PHP 8.2
- Creation of dynamic property deprecated warning with PHP 8.2
[#954](https://github.com/ADOdb/ADOdb/issues/954)
- Remove unused oldProvider property in _rs2serialize()
[#957](https://github.com/ADOdb/ADOdb/issues/957)
- Fix ADOConnection::execute() documentation of return type
[#964](https://github.com/ADOdb/ADOdb/issues/964)
- Define _query() method in ADOConnection base class
[#966](https://github.com/ADOdb/ADOdb/issues/966)
- Restore rs2html() $htmlspecialchars param behavior
[#968](https://github.com/ADOdb/ADOdb/issues/968)
- loadbalancer: PHP 8.2 warnings
[#951](https://github.com/ADOdb/ADOdb/issues/951)
- pgsql: Fix PHP 8.1 deprecated warning
[#956](https://github.com/ADOdb/ADOdb/issues/956)


## [5.22.5] - 2023-04-03
Expand Down
6 changes: 1 addition & 5 deletions drivers/adodb-ado.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,6 @@ function MetaColumns($table, $normalize=true)
return empty($arr) ? $false : $arr;
}




/* returns queryID or false */
function _query($sql,$inputarr=false)
{

Expand Down Expand Up @@ -504,7 +500,7 @@ function MetaType($t,$len=-1,$fieldobj=false)
$t = $fieldobj->type;
$len = $fieldobj->max_length;
}

if (array_key_exists($t,$this->connection->customActualTypes))
return $this->connection->customActualTypes[$t];

Expand Down
7 changes: 3 additions & 4 deletions drivers/adodb-ado5.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ function MetaColumns($table, $normalize=true)
return $arr;
}

/* returns queryID or false */
function _query($sql,$inputarr=false)
{
try { // In PHP5, all COM errors are exceptions, so to maintain old behaviour...
Expand Down Expand Up @@ -545,13 +544,13 @@ function MetaType($t,$len=-1,$fieldobj=false)
$t = $fieldobj->type;
$len = $fieldobj->max_length;
}

$t = strtoupper($t);

if (array_key_exists($t,$this->connection->customActualTypes))
return $this->connection->customActualTypes[$t];

if (!is_numeric($t))
if (!is_numeric($t))
return $t;

switch ($t) {
Expand Down
1 change: 0 additions & 1 deletion drivers/adodb-ads.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,6 @@ function Prepare($sql)
return array($sql, $stmt, false);
}

/* returns queryID or false */
function _query($sql, $inputarr = false)
{
$last_php_error = $this->resetLastError();
Expand Down
1 change: 0 additions & 1 deletion drivers/adodb-fbsql.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ function SelectDB($dbName)
}


// returns queryID or false
function _query($sql,$inputarr=false)
{
return fbsql_query("$sql;",$this->_connectionID);
Expand Down
20 changes: 10 additions & 10 deletions drivers/adodb-firebird.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,14 +483,14 @@ public function prepare($sql)
}

/**
* Return the query id.
*
* @param string|array $sql
* @param array $iarr
*
* @return bool|object
*/
function _query($sql, $iarr = false)
* Execute a query.
*
* @param string|array $sql Query to execute.
* @param array $inputarr An optional array of parameters.
*
* @return object|bool Query identifier or true if execution successful, false if failed.
*/
function _query($sql, $inputarr = false)
{
if (!$this->isConnected()) {
return false;
Expand All @@ -512,8 +512,8 @@ function _query($sql, $iarr = false)
$fn = 'fbird_query';
$args = [$conn, $sql];
}
if (is_array($iarr)) {
$args = array_merge($args, $iarr);
if (is_array($inputarr)) {
$args = array_merge($args, $inputarr);
}
$ret = call_user_func_array($fn, $args);

Expand Down
18 changes: 9 additions & 9 deletions drivers/adodb-ibase.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function Prepare($sql)

// returns query ID if successful, otherwise false
// there have been reports of problems with nested queries - the code is probably not re-entrant?
function _query($sql,$iarr=false)
function _query($sql, $inputarr = false)
{
if (!$this->autoCommit && $this->_transactionID) {
$conn = $this->_transactionID;
Expand All @@ -344,23 +344,23 @@ function _query($sql,$iarr=false)
if (is_array($sql)) {
$fn = 'ibase_execute';
$sql = $sql[1];
if (is_array($iarr)) {
if (!isset($iarr[0])) {
$iarr[0] = ''; // PHP5 compat hack
if (is_array($inputarr)) {
if (!isset($inputarr[0])) {
$inputarr[0] = ''; // PHP5 compat hack
}
$fnarr = array_merge(array($sql), $iarr);
$fnarr = array_merge(array($sql), $inputarr);
$ret = call_user_func_array($fn, $fnarr);
} else {
$ret = $fn($sql);
}
} else {
$fn = 'ibase_query';

if (is_array($iarr)) {
if (sizeof($iarr) == 0) {
$iarr[0] = ''; // PHP5 compat hack
if (is_array($inputarr)) {
if (sizeof($inputarr) == 0) {
$inputarr[0] = ''; // PHP5 compat hack
}
$fnarr = array_merge(array($conn, $sql), $iarr);
$fnarr = array_merge(array($conn, $sql), $inputarr);
$ret = call_user_func_array($fn, $fnarr);
} else {
$ret = $fn($conn, $sql);
Expand Down
1 change: 0 additions & 1 deletion drivers/adodb-informix72.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ function Prepare($sql)
else return array($sql,$stmt);
}
*/
// returns query ID if successful, otherwise false
function _query($sql,$inputarr=false)
{
global $ADODB_COUNTRECS;
Expand Down
1 change: 0 additions & 1 deletion drivers/adodb-ldap.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ function _inject_bind_options( $options ) {
}
}

/* returns _queryID or false */
function _query($sql,$inputarr=false)
{
$rs = @ldap_search( $this->_connectionID, $this->database, $sql );
Expand Down
1 change: 0 additions & 1 deletion drivers/adodb-mssql.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,6 @@ function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
return $this->Execute($sql) != false;
}

// returns query ID if successful, otherwise false
function _query($sql,$inputarr=false)
{
$this->_errorMsg = false;
Expand Down
24 changes: 7 additions & 17 deletions drivers/adodb-mysqli.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1067,16 +1067,6 @@ function Prepare($sql)
return $sql;
}

/**
* Execute SQL
*
* @param string $sql SQL statement to execute, or possibly an array
* holding prepared statement ($sql[0] will hold sql text)
* @param array|bool $inputarr holds the input data to bind to.
* Null elements will be set to null.
*
* @return ADORecordSet|bool
*/
public function execute($sql, $inputarr = false)
{
if ($this->fnExecute) {
Expand Down Expand Up @@ -1165,14 +1155,14 @@ private function getBindParamWithType($inputArr): array
}

/**
* Return the query id.
*
* @param string|array $sql
* @param array $inputarr
*
* @return bool|mysqli_result
* Execute a query.
*
* @param string|array $sql Query to execute.
* @param array $inputarr An optional array of parameters.
*
* @return mysqli_result|bool
*/
function _query($sql, $inputarr)
function _query($sql, $inputarr = false)
{
global $ADODB_COUNTRECS;

Expand Down
18 changes: 7 additions & 11 deletions drivers/adodb-oci8.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -996,16 +996,6 @@ function UpdateBlobFile($table,$column,$val,$where,$blobtype='BLOB')
return $rez;
}

/**
* Execute SQL
*
* @param string|array $sql SQL statement to execute, or possibly an array holding
* prepared statement ($sql[0] will hold sql text).
* @param array|false $inputarr holds the input data to bind to.
* Null elements will be set to null.
*
* @return ADORecordSet|false
*/
function Execute($sql,$inputarr=false)
{
if ($this->fnExecute) {
Expand Down Expand Up @@ -1307,7 +1297,8 @@ function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false)
}

/**
* returns query ID if successful, otherwise false
* Execute a query.
*
* this version supports:
*
* 1. $db->execute('select * from table');
Expand All @@ -1320,6 +1311,11 @@ function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false)
* 4. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)');
* $db->bind($stmt,1); $db->bind($stmt,2); $db->bind($stmt,3);
* $db->execute($stmt);
*
* @param string|array $sql Query to execute.
* @param array $inputarr An optional array of parameters.
*
* @return mixed|bool Query identifier or true if execution successful, false if failed.
*/
function _query($sql,$inputarr=false)
{
Expand Down
11 changes: 10 additions & 1 deletion drivers/adodb-oci8po.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,16 @@ function SelectLimit($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs2cache=0
return ADOConnection::SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache);
}

// emulate handling of parameters ? ?, replacing with :bind0 :bind1
/**
* Execute a query.
*
* Emulate handling of parameters ? ?, replacing with :bind0 :bind1
*
* @param string|array $sql Query to execute.
* @param array $inputarr An optional array of parameters.
*
* @return mixed|bool Query identifier or true if execution successful, false if failed.
*/
function _query($sql,$inputarr=false)
{
if (is_array($inputarr)) {
Expand Down
9 changes: 4 additions & 5 deletions drivers/adodb-odbc.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/*
* These constants are used to set define MetaColumns() method's behavior.
* - METACOLUMNS_RETURNS_ACTUAL makes the driver return the actual type,
* - METACOLUMNS_RETURNS_ACTUAL makes the driver return the actual type,
* like all other drivers do (default)
* - METACOLUMNS_RETURNS_META is provided for legacy compatibility (makes
* driver behave as it did prior to v5.21)
Expand All @@ -35,7 +35,7 @@
*/
DEFINE('METACOLUMNS_RETURNS_ACTUAL', 0);
DEFINE('METACOLUMNS_RETURNS_META', 1);

/*--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------*/

Expand All @@ -57,7 +57,7 @@ class ADODB_odbc extends ADOConnection {
var $_autocommit = true;
var $_lastAffectedRows = 0;
var $uCaseTables = true; // for meta* functions, uppercase table names

/*
* Tells the metaColumns feature whether to return actual or meta type
*/
Expand Down Expand Up @@ -473,7 +473,7 @@ function MetaColumns($table, $normalize=true)
$fld = new ADOFieldObject();
$fld->name = $rs->fields[3];
if ($this->metaColumnsReturnType == METACOLUMNS_RETURNS_META)
/*
/*
* This is the broken, original value
*/
$fld->type = $this->ODBCTypes($rs->fields[4]);
Expand Down Expand Up @@ -518,7 +518,6 @@ function Prepare($sql)
return array($sql,$stmt,false);
}

/* returns queryID or false */
function _query($sql,$inputarr=false)
{
$last_php_error = $this->resetLastError();
Expand Down
1 change: 0 additions & 1 deletion drivers/adodb-oracle.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
}


// returns query ID if successful, otherwise false
function _query($sql,$inputarr=false)
{
// <G. Giunta 2003/03/03/> Reset error messages before executing
Expand Down
1 change: 0 additions & 1 deletion drivers/adodb-pdo.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ function GenID($seqname='adodbseq',$startID=1)
}


/* returns queryID or false */
function _query($sql,$inputarr=false)
{
$ok = false;
Expand Down
1 change: 0 additions & 1 deletion drivers/adodb-postgres64.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ function _pconnect($str,$user='',$pwd='',$db='')
}


// returns queryID or false
function _query($sql,$inputarr=false)
{
$this->_pnum = 0;
Expand Down
1 change: 0 additions & 1 deletion drivers/adodb-sqlite.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
return true;
}

// returns query ID if successful, otherwise false
function _query($sql,$inputarr=false)
{
$rez = sqlite_query($sql,$this->_connectionID);
Expand Down

0 comments on commit 9f1f997

Please sign in to comment.