DatabaseSelectComplexTestCase::testHavingCountQuery() does a query with a HAVING clause but no GROUP BY clause. Such queries are not valid in ANSI-SQL (see e.g. this discussion) and trigger an exception on SQLite and Postgres.

This patch fixes this problem. The test now passes on MySQL, SQLite and Postgres.

Comments

idaniellau’s picture

database-test-having-1.patch queued for re-testing.

idaniellau’s picture

retested, it has passed :)

droplet’s picture

Im facing the same problem at other issue. we can't / do not test on pgsql and sqlite on d.org bots, right ?

hosef’s picture

What I believe is that someone needs to setup simple test on their local environment, and run it against Drupal core with this patch, while D8 is installed on pgsql and sqlite. I would be happy to do this if no one else wants to.

hosef’s picture

Status: Needs review » Reviewed & tested by the community

I ran the database tests before and after applying this patch on all three of the database servers mentioned. Before the patch was applied SQLite and PostgreSQL both passed the exception noted by idaniellau. After the patch was applied non of the three passed the exception. So, it appears that the patch fixed the problem.

catch’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)
Issue tags: +Novice, +Needs backport to D7

droplet is right, we have no pgsql or sqlite test bots, and since not many people run tests themselves with either database either, they're broken most of the time. Thanks hosef for doing the testing on this.

Committed/pushed to 8.x, moving back to 7.x for backport. Should be a straightforward backport so marking Novice for the re-roll.

rdickert’s picture

Assigned: Unassigned » rdickert

Taking this for backporting to D7.

rdickert’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new552 bytes

Backport to D7.

hosef’s picture

Starting up my VMs. :P

EDIT:
I think I broke VirtualBox when I ran apt-get upgrade this morning, so I will be back later when I fix it.

hosef’s picture

Status: Needs review » Reviewed & tested by the community

Ok, I got everything working again and ran all of the tests again. D7 results are the same as the results in D8 so I believe this is done and ready to be committed.

I did have some other tests fail in my D7 Postgresql test run, but they appeared to be unrelated to this issue and they did not occur in my D8 tests. Therefore, my assumption is that they have already been fixed by some other patch.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Great, thanks for the fix + testing on this folks!

committed and pushed to 7.x.

Automatically closed -- issue fixed for 2 weeks with no activity.