Skip to content

Loading…

DDC-2544: [GH-717] Allow query parameters starting with an underscore #3269

Closed
doctrinebot opened this Issue · 5 comments

2 participants

@doctrinebot

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of hackedd:

Url: #717

Message:

Using a query parameter of which the name starts with an underscore results in a QueryException. For example:

$q = $em->createQueryBuilder()
    ->select("u")
    ->from("User", "u")
    ->where("u.username = :_name")
    ->setParameter("_name", "bar")
    ->getQuery();

Results in:

Invalid parameter format, : given, but :<name> or ?<num> expected.

This happens because of a bug in the Lexer, which recognizes :*name as two tokens (the : as the start of a input parameter, *name as an identifier). The attached patch changes the regular expression for input parameters to allow identifiers starting with a letter or underscore.

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-717] was closed:
#717

@doctrinebot

Comment created by @FabioBatSilva:

Merged : a53fe14

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-717] was assigned:
doctrine/dbal#717

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-717] was closed:
doctrine/dbal#717

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.5 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.