Skip to content

Commit f10fa82

Browse files
author
Stanislav Idolov
authored
ENGCOM-1258: Fix bug with retry connect and custom db port #14435
2 parents eaf17db + 559faa9 commit f10fa82

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
@@ -549,6 +549,15 @@ protected function _query($sql, $bind = [])
549549
$retry = true;
550550
$triesCount++;
551551
$this->closeConnection();
552+
553+
/**
554+
* _connect() function does not allow port parameter, so put the port back with the host
555+
*/
556+
if (!empty($this->_config['port'])) {
557+
$this->_config['host'] = implode(':', [$this->_config['host'], $this->_config['port']]);
558+
unset($this->_config['port']);
559+
}
560+
552561
$this->_connect();
553562
}
554563

0 commit comments

Comments
 (0)