Skip to content

Commit

Permalink
Remove redundant implementation of PDO\SQLSrv\Connection::lastInsertI…
Browse files Browse the repository at this point in the history
…d($name)
  • Loading branch information
morozov committed Mar 31, 2021
1 parent 012569d commit 24b1f9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ jobs:
- "7.4"
- "8.0"
extension:
- "sqlsrv"
- "pdo_sqlsrv"
- "sqlsrv-5.9.0"
- "pdo_sqlsrv-5.9.0"
collation:
- "Latin1_General_100_CI_AS"
include:
Expand Down
8 changes: 1 addition & 7 deletions src/Driver/PDO/SQLSrv/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@ public function exec(string $sql): int
*/
public function lastInsertId($name = null)
{
if ($name === null) {
return $this->connection->lastInsertId($name);
}

return $this->prepare('SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?')
->execute([$name])
->fetchOne();
return $this->connection->lastInsertId($name);
}

/**
Expand Down

0 comments on commit 24b1f9a

Please sign in to comment.