Skip to content

Commit cbf253d

Browse files
author
Stanislav Idolov
authored
ENGCOM-1317: [Backport] Fix bug with retry connect and custom db port #14753
2 parents 93752e3 + 4a31a0a commit cbf253d

File tree

1 file changed

+9
-0
lines changed
  • lib/internal/Magento/Framework/DB/Adapter/Pdo

1 file changed

+9
-0
lines changed

lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,15 @@ protected function _query($sql, $bind = [])
557557
) {
558558
$retry = true;
559559
$triesCount++;
560+
561+
/**
562+
* _connect() function does not allow port parameter, so put the port back with the host
563+
*/
564+
if (!empty($this->_config['port'])) {
565+
$this->_config['host'] = implode(':', [$this->_config['host'], $this->_config['port']]);
566+
unset($this->_config['port']);
567+
}
568+
560569
$this->closeConnection();
561570
$this->_connect();
562571
}

0 commit comments

Comments
 (0)