Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mzstic opened this issue Dec 1, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@mzstic
Copy link

commented Dec 1, 2015

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.

@dg dg closed this in 9f4b829 Dec 3, 2015

dg added a commit that referenced this issue Dec 3, 2015

@dg

This comment has been minimized.

Copy link
Member

commented Dec 3, 2015

@mzstic can you check it?

@mzstic

This comment has been minimized.

Copy link
Author

commented Dec 3, 2015

Seems to be working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.