Skip to content
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

Open
wants to merge 4 commits into
base: devel
Choose a base branch
from
Open

db query bugfix #202

wants to merge 4 commits into from

Conversation

FarukMZKC
Copy link

some db query syntax error resolve

Copy link
Contributor

@GwynethLlewelyn GwynethLlewelyn left a 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!).

Copy link
Contributor

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_dateis a DATETIME! Fixed on my own fork, too.

Copy link
Contributor

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.

Copy link
Contributor

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! 😹

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');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants