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

Hyphens in parameter placeholder names break the query on Mysql 8 #75

Closed
hknezevic opened this issue Jan 17, 2022 · 1 comment · Fixed by #74
Closed

Hyphens in parameter placeholder names break the query on Mysql 8 #75

hknezevic opened this issue Jan 17, 2022 · 1 comment · Fixed by #74
Assignees
Labels

Comments

@hknezevic
Copy link
Member

hknezevic commented Jan 17, 2022

For example:

public function findByCollectionId($collectionId)
{
    $qb = $this->createQueryBuilder('eica');

    return $qb->select('eica')
        ->where('eica.informationCollectionId = :collection-id')
        ->setParameter('collection-id', $collectionId)
        ->getQuery()
        ->getResult();
}

throws a following error:

[Semantical Error] line 0, col 146 near 'id': Error: 'id' is not defined.

This was first noticed in setup using Mysql 8 with default configuration, PHP, Symfony and Doctrine versions match some of the previous projects where the issue was not occuring. The only difference is Mysql 8 being used instead of Mysql 5.7

Course of action: replace all placeholder names in all of the queries with camel case format

Error present in both 1.x and master/2.x versions

@hknezevic
Copy link
Member Author

Thank you @leohajder !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants