Skip to content

[5.2] Work around lack of lastInsertId() for ODBC with PDO for MSSQL - #13423

Merged
taylorotwell merged 4 commits into
laravel:5.2from
darksaboteur:5.2
May 6, 2016
Merged

taylorotwell merged 4 commits into
laravel:5.2from
darksaboteur:5.2

Conversation

@darksaboteur

Copy link
Copy Markdown
Contributor

When using the ODBC driver for MSSQL an exception is thrown because the PDO driver does not implement lastInsertId().
This works around that by making an SQL call to return the id when using ODBC.

@GrahamCampbell GrahamCampbell changed the title Work around lack of lastInsertId() for ODBC with PDO for MSSQL [5.2] Work around lack of lastInsertId() for ODBC with PDO for MSSQL May 4, 2016
namespace Illuminate\Database\Query\Processors;

use Illuminate\Database\Query\Builder;
use Exception;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please order these by length

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortest first?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.

@taylorotwell
taylorotwell merged commit a084356 into laravel:5.2 May 6, 2016
@vlakoff

vlakoff commented Jun 24, 2016

Copy link
Copy Markdown
Contributor

Refs #14121 which brings 2 fixes for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants