-
Notifications
You must be signed in to change notification settings - Fork 106
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
db query bugfix #202
base: devel
Are you sure you want to change the base?
db query bugfix #202
Conversation
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.
Except for the GROUP BY
vs. ORDER BY
issue, which I still have some questions about, the rest is essentially 100% correct (and necessary to avoid broken queries!).
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.
That sounds quite reasonable, considering that task_start_date
is a DATETIME
! Fixed on my own fork, too.
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.
As before... well caught, this is really not correct for a DATETIME
.
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.
I'm a bit confused by this change. 🤔
According to the comment, the decision to use GROUP BY
instead of ORDER BY
is deliberate, for performance reasons. But you seem to have reverted to ORDER BY
instead. I wonder why? Was the previously existing query giving errors — or not finding the expected results?
I'm just really asking for curiosity's sake, I have no way to accept or reject your PR anyway! 😹
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.
I think the issue is related to
Incompatible change: As of MySQL 8.0.13, the deprecated ASC or DESC qualifiers for GROUP BY clauses have been removed. Queries that previously relied on GROUP BY sorting may produce results that differ from previous MySQL versions. To produce a given sort order, provide an ORDER BY clause.
I think the fix should have been.
$q2->addGroup('p.project_id');
$q2->addOrder('f.file_version_id DESC');
some db query syntax error resolve