frioux / DBIx-Class-Helpers

https://metacpan.org/pod/DBIx::Class::Helpers
20 stars 38 forks source link

Simply loading AutoRemoveColumns seems to interfere with DBICs group_by inferrence #83

Closed ribasushi closed 6 years ago

ribasushi commented 6 years ago
~dbic_repo$ perl -Ilib -It/lib -MDBICTest -MDevel::Dwarn -e '
  Dwarn [ DBICTest->init_schema
                   ->resultset("Artist")
                    ->search({}, { group_by => "name" })
                     ->count_rs
                      ->as_query ]
'

vs

~dbic_repo$ perl -Ilib -It/lib -MDBICTest -MDevel::Dwarn -e '
  require DBICTest::BaseResultSet;
  DBICTest::BaseResultSet->load_components("Helper::ResultSet::AutoRemoveColumns");
  Dwarn [ DBICTest->init_schema
                   ->resultset("Artist")
                    ->search({}, { group_by => "name" })
                     ->count_rs
                      ->as_query ]
'

P.S. This is the problem with http://lists.scsys.co.uk/pipermail/dbix-class/2017-October/012682.html, user has already been informed about this issue.

khmarochos commented 6 years ago

Thanks a lot!

ribasushi commented 6 years ago

Had a moment to look: @frioux the problem is here. You must check for presence of a select as a reset in addition to columns

ribasushi commented 6 years ago

@melnik13 this is an easy fix, I am pretty sure @frioux would appreciate a PR with a test similar to what I showed above.

khmarochos commented 6 years ago

Aye, the test is ready, the PR has been submitted!

frioux commented 6 years ago

Fixed, will release after testing on travis.

frioux commented 6 years ago

FYI I keep coming back to this and running into stupid unrelated problems. Apparently there were enough environmental changes since my last helpers release that I can't pass my own stress tests 😢 anyway not forgotten, just slow progress

-- Sent from a rotary phone rented from Ma Bell

On Oct 10, 2017 9:11 PM, "Vladimir Melnik" notifications@github.com wrote:

Aye, the test is ready, the PR has been submitted!

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/frioux/DBIx-Class-Helpers/issues/83#issuecomment-335677012, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAf4-eqK-MZYAo9Zi9zEtJb8debXN2Iks5srEADgaJpZM4P0fgZ .

frioux commented 6 years ago

Finally got tests passing on travis. I am going to give myself 30m when my kid is taking a nap to try to roll in some other fixes and features, and the cut bait and release this.