[MojoMojo] Re: Postgresql problem with GROUP BY clauses
Mateu X. Hunter
hunter at missoula.org
Wed Jan 12 02:17:44 GMT 2011
Hello,
I believe I have a fix for the query issue you encountered. It is part of
the commit listed below:
https://github.com/marcusramberg/mojomojo/commit/74d0774e182ecf2518affeb53f=
3fe3561e53b71
- Mateu
2011/1/11 mschumann <mojomojo at hidden-primary.net>
>
> Hi,
>
> when the test script t/schema_DBIC_Page.t is tried, it throws the excepti=
on
> mentioned in my first post. Unfortunately is has to be patched to not
> destroy the database:
>
> --- t/schema_DBIC_Page.t.orig 2011-01-02 07:53:55.529421000 +0100
> +++ t/schema_DBIC_Page.t 2011-01-11 21:15:08.166922962 +0100
> @@ -16,7 +16,8 @@
> use lib 't/lib';
> use MojoMojoTestSchema;
>
> -my $schema =3D MojoMojoTestSchema->init_schema(populate =3D> 1);
> +#my $schema =3D MojoMojoTestSchema->init_schema(populate =3D> 1);
> +my $schema =3D MojoMojoTestSchema->get_schema;
>
> my ($root_path_pages, $root_proto_pages) =3D
> $schema->resultset('Page')->path_pages('/');
> my $root_path_pages_count =3D @$root_path_pages;
>
> Then I get the result:
>
> t/schema_DBIC_Page.t .. 1/11
> ...
> # Failed test 'Got 1 tagged descendant.'
> # at t/schema_DBIC_Page.t line 62.
> # got: '2'
> # expected: '1'
> DBIx::Class::ResultSet::search(): DBI Exception: DBD::Pg::st execute
> failed:
> column "content.created" must appear in the GROUP BY clause or be used in
> an
> aggregate function
> LINE 1: ...epth, me.lft, me.rgt, me.content_version ORDER BY content.cr...
> ^ [for
> Statement "SELECT me.id, me.version, me.parent, me.name, me.name_orig,
> me.depth, me.lft, me.rgt, me.content_version FROM page as me, page as
> ancestor, tag, content WHERE ( ( ( me.id =3Dancestor.id OR ( me.lft >
> ancestor.lft AND me.rgt < ancestor.rgt ) ) AND ancestor.id =3D ? AND
> content.page =3Dme.id AND content.version =3Dme.content_version AND me.id
> =3Dtag.page AND tag =3D ? ) ) GROUP BY me.id, me.version, me.parent, me.n=
ame,
> me.name_orig, me.depth, me.lft, me.rgt, me.content_version ORDER BY
> content.created DESC" with ParamValues: 1=3D'1', 2=3D'test'] at
> .../libmojomojo-perl-devel/lib/MojoMojo/Schema/Result/Page.pm line 219
> # Looks like you planned 11 tests but ran 10.
> # Looks like you failed 3 tests of 10 run.
> # Looks like your test exited with 255 just after 10.
> t/schema_DBIC_Page.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
> Failed 4/11 subtests
>
> Test Summary Report
> -------------------
> t/schema_DBIC_Page.t (Wstat: 65280 Tests: 10 Failed: 3)
> Failed tests: 4-5, 9
> Non-zero exit status: 255
> Parse errors: Bad plan. You planned 11 tests but ran 10.
> Files=3D1, Tests=3D10, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.54 cusr
> 0.03
> csys =3D 0.59 CPU)
> Result: FAIL
>
> I keep on tracking down this issue...
> --
> View this message in context:
> http://mojomojo.2358427.n2.nabble.com/Postgresql-problem-with-GROUP-BY-cl=
auses-tp5908804p5912401.html
> Sent from the mojomojo mailing list archive at Nabble.com.
>
> _______________________________________________
> Mojomojo mailing list
> Mojomojo at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/mojomojo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/mojomojo/attachments/20110111/21518=
d19/attachment.htm
More information about the Mojomojo
mailing list