SQL Function ROUND is not parsed in Query\Parser #5826

Closed
opened 2026-01-22 15:18:58 +01:00 by admin · 10 comments
Owner

Originally created by @cgardiennet on GitHub (Dec 28, 2017).

Originally assigned to: @Ocramius on GitHub.

The SQL function ROUND is not parsed in Query\Parser.
Need to be added.

Originally created by @cgardiennet on GitHub (Dec 28, 2017). Originally assigned to: @Ocramius on GitHub. The SQL function ROUND is not parsed in Query\Parser. Need to be added.
admin added the New FeatureWon't Fix labels 2026-01-22 15:18:58 +01:00
admin closed this issue 2026-01-22 15:18:58 +01:00
Author
Owner

@cgardiennet commented on GitHub (Jan 2, 2018):

Need this in a future 2.5 version

@cgardiennet commented on GitHub (Jan 2, 2018): Need this in a future 2.5 version
Author
Owner

@Ocramius commented on GitHub (Jan 2, 2018):

@cgardiennet this is available in DoctrineExtensions

@Ocramius commented on GitHub (Jan 2, 2018): @cgardiennet this is available in [DoctrineExtensions](https://github.com/beberlei/DoctrineExtensions/blob/f592c495f1c43851f5e3418cf9c2514e61d67e64/src/Query/Mysql/Round.php)
Author
Owner

@cgardiennet commented on GitHub (Jan 2, 2018):

@Ocramius The solution to use DoctrineExtension is not a good one for me:

  • Need to add another bundle in your project
  • need to declare functions as custom dql functions when ROUND is standard SQL function
  • Round function class is not created for every database platform (ie : doesn't exist for PostgreSql ???!!!)
@cgardiennet commented on GitHub (Jan 2, 2018): @Ocramius The solution to use DoctrineExtension is not a good one for me: * Need to add another bundle in your project * need to declare functions as custom dql functions when ROUND is standard SQL function * Round function class is not created for every database platform (ie : doesn't exist for PostgreSql ???!!!)
Author
Owner

@Ocramius commented on GitHub (Jan 2, 2018):

Round function class is not created for every database platform (ie : doesn't exist for PostgreSql ???!!!)

Yep, you should send a patch to DoctrineExtensions then :-)

Patches here also welcome, as long as behavior is consistent on all platforms.

@Ocramius commented on GitHub (Jan 2, 2018): > Round function class is not created for every database platform (ie : doesn't exist for PostgreSql ???!!!) Yep, you should send a patch to `DoctrineExtensions` then :-) Patches here also welcome, as long as behavior is consistent on all platforms.
Author
Owner

@cgardiennet commented on GitHub (Jan 2, 2018):

The most important annoying fact for me is that i have to declare a custom DQL function (ROUND) when this is a standard SQL function...

@cgardiennet commented on GitHub (Jan 2, 2018): The most important annoying fact for me is that i have to declare a custom DQL function (ROUND) when this is a standard SQL function...
Author
Owner

@Ocramius commented on GitHub (Jan 2, 2018):

That holds true for most SQL functions. DQL is kinda like a subset of SQL, and we can only expand it where functionality applies to all DB vendors.

@Ocramius commented on GitHub (Jan 2, 2018): That holds true for most SQL functions. DQL is kinda like a subset of SQL, and we can only expand it where functionality applies to all DB vendors.
Author
Owner

@cgardiennet commented on GitHub (Jan 2, 2018):

ROUND exist in all DB !

@cgardiennet commented on GitHub (Jan 2, 2018): ROUND exist in all DB !
Author
Owner

@cgardiennet commented on GitHub (Jan 2, 2018):

And most important, it is implemented in Doctrine DBAL for all platforms !

@cgardiennet commented on GitHub (Jan 2, 2018): And most important, it is implemented in Doctrine DBAL for all platforms !
Author
Owner

@Ocramius commented on GitHub (Jan 2, 2018):

Send a patch then 👍

@Ocramius commented on GitHub (Jan 2, 2018): Send a patch then :+1:
Author
Owner

@cgardiennet commented on GitHub (Jan 2, 2018):

Already done : https://github.com/doctrine/doctrine2/pull/6954

@cgardiennet commented on GitHub (Jan 2, 2018): Already done : https://github.com/doctrine/doctrine2/pull/6954
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5826