-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
DBAL-1081: Paginator - Query Limit for SQL Server - SqlServerPlatform.php #1017
Comments
Comment created by @Ocramius: Seems like a bit of information is missing: Is this issue related to the paginator API or not? |
Comment created by mgrajcarek: First of all - thank you for formatting my issue. Here is a code which should help you to replicate the problem:
|
Comment created by @Ocramius: That doesn't involve the paginator, just DQL.
|
Comment created by mgrajcarek: If I will do it, it will result in a following query:
It's an incorrect query for an SQL Server. Take a look on this part:
SQL Server do not support aliasing in OVER clause. It should look like this, to work:
It looks like this is the copy of this issue: http://www.doctrine-project.org/jira/browse/[DBAL-788](http://www.doctrine-project.org/jira/browse/DBAL-788) |
Comment created by @deeky666: [~mgrajcarek] looks like it is an issue with your SUM function implementation. If you change your DQL to use ORDER BY COUNT(ypk.value) instead of ORDER BY SUM(ypk.value), does it work then? If so, there is something wrong with your SUM function and therefore not an issue with DBAL. |
Comment created by @deeky666: well forget about it I think I am wrong here. |
Comment created by mgrajcarek: Hi, But I already tried other aggregation functions before and the result was exactly the same. |
Comment created by luca.cerretani: I get a similar error using this sql:
using the doModifyLimitQuery i get the uncorrect sql
it should be
|
Comment created by caps_corp: Hi, I have a big problem when executing LIMIT query on SQL Server platform. See below: {color:red}SQLSTATE [42S22, 207]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Nom de colonne non valide�: 'alias1'. |
Comment created by ilijatovilo: Any news on issue? Any kind of help would be greatly appreciated. |
Comment created by ilijatovilo: Interestingly, using the |
@deeky666 I think this can be closed as fixed, no? |
fixed by #818 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Jira issue originally created by user mgrajcarek:
Hi!
I have a problem with Query results limit when ordering by SUM of a field.
My query looks like this:
First I was catching following error:
message:
"[Syntax Error] line 0, col 395: Error: Expected known function, got 'SUM'"
class:
Doctrine\ORM\Query\QueryException
It only accourse if SUM is used in ORDER BY clause.
I have registered new class Sum which extends FunctionNode.
Now, query is build and executed but it has an error:
The line :
should look like
In doModifyLimitQuery method I have modified:
to:
Now preg_match founds matching strings and
OVER
part of query is build correctly.I checked other issues about this problem (which are marked as already fixed) and I have no idea why it's not working for me.
Thanks in advance!
The text was updated successfully, but these errors were encountered: