Skip to content

Connection: Insert can return wrong identifier #6

Description

@glady

Given:

  • We have an Connection to any Database with any Table with autoincrement ID column.
  • We have an post-insert Event on this Connection

When I insert a row, the result of Connection->getLastInsertId() can actually be dependent of what exactly is done within post-insert-Event.

  1. insert: UnitOfWork\UnitOfWork.php:466
  2. correct identifier: Connection\Connection.php:591
  3. post-insert-Event: Connection\Connection.php:593
  4. possibly wrong identifier: UnitOfWork\UnitOfWork.php:470

used databases:
mysql 5.6
mysql 5.1

Possibly same issue with EVENT_POST_EXEC.

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions