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 Apr 15, 2023
2 parents 0461808 + 8968147 commit 1a008f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions adodb-csvlib.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function _rs2serialize(&$rs,$conn=false,$sql='')

$savefetch = isset($rs->adodbFetchMode) ? $rs->adodbFetchMode : $rs->fetchMode;
$class = $rs->connection->arrayClass;
/** @var ADORecordSet $rs2 */
$rs2 = new $class(ADORecordSet::DUMMY_QUERY_ID);
$rs2->timeCreated = $rs->timeCreated; # memcache fix
$rs2->sql = $rs->sql;
Expand Down
12 changes: 6 additions & 6 deletions adodb-loadbalancer.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ class ADOdbLoadBalancer
/**
* @var bool|array All connections to each database.
*/
protected $connections = false;
protected $connections = [];

/**
* @var bool|array Just connections to the write capable database.
*/
protected $connections_write = false;
protected $connections_write = [];

/**
* @var bool|array Just connections to the readonly database.
*/
protected $connections_readonly = false;
protected $connections_readonly = [];

/**
* @var array Counts of all connections and their types.
Expand All @@ -73,12 +73,12 @@ class ADOdbLoadBalancer
/**
* @var bool Session variables that must be maintained across all connections, ie: SET TIME ZONE.
*/
protected $session_variables = false;
protected $session_variables = [];

/**
* @var bool Called immediately after connecting to any DB.
*/
protected $user_defined_session_init_sql = false;
protected $user_defined_session_init_sql = [];


/**
Expand Down Expand Up @@ -403,7 +403,7 @@ public function setSessionVariable($name, $value, $execute_immediately = true)
*/
private function executeSessionVariables($adodb_obj = false)
{
if (is_array($this->session_variables)) {
if (is_array($this->session_variables) && count($this->session_variables) > 0) {
$sql = '';
foreach ($this->session_variables as $name => $value) {
// $sql .= 'SET SESSION '. $name .' '. $value;
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Older changelogs:

- Creation of dynamic property deprecated warning in PHP 8.2
[#954](https://github.com/ADOdb/ADOdb/issues/954)
- loadbalancer: PHP 8.2 warnings
[#951](https://github.com/ADOdb/ADOdb/issues/951)


## [5.22.5] - 2023-04-03
Expand Down

0 comments on commit 1a008f9

Please sign in to comment.