-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
accept more than 2 parameters in CONCAT function #583
Conversation
Hello, thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link: |
|
||
while ($parser->getLexer()->isNextToken(Lexer::T_COMMA)) { | ||
$parser->match(Lexer::T_COMMA); | ||
$this->concatExpressions[] = $parser->StringPrimary(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation by tab.
The new feature should be tested. |
|
If this depend on an unmerged PR in DBAL, please add the link in the description of the PR. |
$args[] = $sqlWalker->walkStringPrimary($expression); | ||
} | ||
|
||
return $platform->getConcatExpression( $args ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should remove the extra spaces around $args
you still need to add a unit test (in https://github.com/doctrine/doctrine2/blob/master/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php) for the case where you have more than 2 expressions |
Unit test |
…rguments is not known removing dependency to patch DBAL
I have pushed a new commit, which does not require doctrine/dbal#275 to be merged. |
Merged in 4841a06 |
The DBAL Platform supports more then 2 parameters but the ConcatFunction only validates 2 parameters to CONCAT. This commit allows to pass more than 2 parameters to CONCAT. Also this change would require that
getConcatExpression
accept array as a parameter. I have opened a pull request for that as well.Here is the pull request : doctrine/dbal#275
I also propose that the function
getConcatExpression
only accept array of string rather than multiple string arguments.