Skip to content

Commit

Permalink
Merge pull request #6036 from iRedds/fix-sqlsrv-port
Browse files Browse the repository at this point in the history
Bug: The SQLSRV driver ignores the port value from the config.
  • Loading branch information
kenjis authored May 27, 2022
2 parents 5395498 + a6d9eef commit 7b42a12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions system/Database/SQLSRV/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ public function connect(bool $persistent = false)
unset($connection['UID'], $connection['PWD']);
}

if (strpos($this->hostname, ',') === false && $this->port !== '') {
$this->hostname .= ', ' . $this->port;
}

sqlsrv_configure('WarningsReturnAsErrors', 0);
$this->connID = sqlsrv_connect($this->hostname, $connection);

Expand Down
1 change: 1 addition & 0 deletions user_guide_src/source/changelogs/v4.2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,6 @@ Deprecations

Bugs Fixed
**********
- The SQLSRV driver ignores the port value from the config.

See the repo's `CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_ for a complete list of bugs fixed.

0 comments on commit 7b42a12

Please sign in to comment.