Skip to content

PgSql driver - delimite() doesn't work correctly with FQN #108

Description

@mzstic

We encountered problem, during upgrade to newest version.
INSERTs suddenly stopped working., after some digging, we found following:

  1. INSERTs on their own work correctly
  2. problem is when trying to get lastInsertId()
    Nette\Database\Selection::764
$primaryKey = $this->context->getInsertId(
    !empty($primarySequenceName)
        ? $this->context->getConnection()->getSupplementalDriver()->delimite($primarySequenceName)
        : $primarySequenceName
);
  1. This throws following error: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "web.product_id_seq" does not exist
  2. When I modified delimite function to work same way as delimiteFQN function in PgSqlDriver, all problems disappeared.

Solution
In identifier names should'nt be any . characters. Move delimiteFQN logic into delimite function.
When asking for delimition of not FQN identifier, it won't cause any problem.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions