Skip to content

Missing Group by in dev-main #548

@hrach

Description

@hrach

Hi, I tried the dev version and the following now doesn't work (in both mysql and postgres) while in 4.0 it worked fine.

$books = $this->orm->books->findBy([
    'tags->id' => 1,
    'publisher->name' => 'Nextras publisher A'
]);
Assert::same($books->count(), 1);

MySQL: Unknown column 'publisher.name' in 'having clause'
Postgres: ERROR: column "publisher.name" must appear in the GROUP BY clause or be used in an aggregate function

It's probably solvable by using simple JOIN for publisher table and including publisher.name in ON clause.

Originally posted by @stepapo in #526 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions