Skip to content

DoctrineTokenProvider issue with postgresql #21467

Closed
@PF4Public

Description

@PF4Public
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? yes
Symfony version 3.2.1

There is an issue with DoctrineTokenProvider if using postgresql.

The problem is that by default postgresql is not case-sensitive unless you apply quotes to your arguments.
Thus creating lastUsed table as suggested might result in creating it all-lowercase. All is fine untill you hit:

    return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['lastUsed']));

which will throw exception as there's no such field in table. Looks like changing the field to be exactly lastUsed might help, but for me exceptions start happening even earlier, since this time some other queries could not obtain this field properly. I ended up replacing 'lastUsed' to be 'lastused' in that particular line.

Therefore I wonder is there any better approach to fix this?

As I'm afraid fixing this way might break this code for mysql or any other database.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions