Skip to content

Commit 7b42a12

Browse files
authored
Merge pull request #6036 from iRedds/fix-sqlsrv-port
Bug: The SQLSRV driver ignores the port value from the config.
2 parents 5395498 + a6d9eef commit 7b42a12

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

system/Database/SQLSRV/Connection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ public function connect(bool $persistent = false)
120120
unset($connection['UID'], $connection['PWD']);
121121
}
122122

123+
if (strpos($this->hostname, ',') === false && $this->port !== '') {
124+
$this->hostname .= ', ' . $this->port;
125+
}
126+
123127
sqlsrv_configure('WarningsReturnAsErrors', 0);
124128
$this->connID = sqlsrv_connect($this->hostname, $connection);
125129

user_guide_src/source/changelogs/v4.2.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,6 @@ Deprecations
119119

120120
Bugs Fixed
121121
**********
122+
- The SQLSRV driver ignores the port value from the config.
122123

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

0 commit comments

Comments
 (0)