You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL Server handles auto-incrementing values differently than other RDBMS. I accidentally forgot to change the value of the $incrementing property of Model that is not auto-incremented. In this case, PDO::lastInsertId() is unexpectedly called and its call will fail. This is the intended design.
However, I found that after PDO::lastInsertId() failed, PDO::ATTR_ERRMODE was implicitly changed to PDO::ERRMODE_EXCEPTION and never restored. I'm convinced that this is a bug, so I submit a pull request to the pdo_sqlsrv repository.
Expected behavior and actual behavior
After PDO::lastInsertId() fails,
Expected
PDO::ERRMODE_SILENT is replaced by PDO::ERRMODE_EXCEPTION to restore original value.
PHP version
PHP 8.1.0RC6
Note that GitHub Actions PHP image looks to use...
pdo_sqlsrv
on PHP 8.1 and laterpdo_dblib
on PHP 8.0 and beforeDriver and SQL Server versions
PDO
dump Information provided Laravel'sdump()
function:Problem description
Described here: [PoC] PDO::ATTR_ERRMODE is implicitly changed to PDO::ERRMODE_SILENT after PDO::lastInsertId() call fails by mpyw · Pull Request #1 · mpyw/laravel-retry-on-duplicate-key
Expected behavior and actual behavior
After
PDO::lastInsertId()
fails,Expected
PDO::ERRMODE_SILENT
is replaced byPDO::ERRMODE_EXCEPTION
to restore original value.Actual
PDO::ERRMODE_SILENT
is never replaced.Repro code or steps to reproduce
https://github.com/mpyw/laravel-retry-on-duplicate-key/blob/8fe6bc3ec72c37886e85b9e0817d6cedbe089db3/tests/Test.php
The text was updated successfully, but these errors were encountered: