[Nitro] Postgres failures in Og test suite.

Bryan Soto bryan.a.soto at gmail.com
Thu Apr 6 02:22:22 EDT 2006

Because some of the tickets/patches we have are specifically for the
Postgres store, I need the test suite running so I know if they break
things. And so, I begin my new project.

With the postgres join table patch I sent earlier, I get to here.

E, [2006-04-05T22:23:56.328000 #4784] ERROR -- : DB error ERROR: 
column "o.title" must appear in the GROUP BY clause or be used in an
aggregate function, [
        SELECT o.*
          ogglue_tag AS t,
          ogtestogtaggable_article as o,
          ogj_glue_tag_testogtaggable_article as j
        WHERE o.oid = j.article_oid
          AND t.oid = j.tag_oid
          AND (t.name in ('navel','gmosx'))
        GROUP BY j.article_oid
        HAVING COUNT(j.article_oid) = 2;

Google explained to me that Postgres is a stickler and that it
requires the o.* fields to be in the group by clause. I don't know
that we have access to this info in taggable. That'll be the first way
I try to solve this, but perhaps there is a trick to make this work
one of you Postgres wizards know?

A snippet of the backtrace from the above:

E, [2006-04-05T23:08:14.000000 #6132] ERROR -- : K:/nitro.pristine/og/lib/og/sto
re/psql.rb:293:in `exec'
K:/nitro.pristine/og/lib/og/store/psql.rb:293:in `query'
K:/nitro.pristine/og/lib/og/store/sql.rb:484:in `select'
K:/nitro.pristine/og/lib/og/entity.rb:217:in `select'
K:/nitro.pristine/og/lib/glue/taggable.rb:189:in `find_with_tags'
./test/og/mixin/tc_taggable.rb:48:in `test_all'

I renamed the file to keep the test from running and then I got the
suite to pass with the following results.

  1) Error:
NoMethodError: undefined method `to_f' for ["58"]:Array
    K:/nitro.pristine/og/lib/og/store/sql.rb:532:in `calculate'
    K:/nitro.pristine/og/lib/og/store/psql.rb:139:in `each_row'
    K:/nitro.pristine/og/lib/og/store/psql.rb:138:in `each_row'
    K:/nitro.pristine/og/lib/og/store/sql.rb:531:in `calculate'
    K:/nitro.pristine/og/lib/og/entity.rb:267:in `calculate'
    K:/nitro.pristine/og/lib/og/entity.rb:305:in `sum'
    ./test/og/tc_aggregations_calculations.rb:39:in `test_all'

  2) Failure:
test_all(TC_OgInheritance) [./test/og/tc_inheritance.rb:87]:
<TC_OgInheritance::Photo> expected but was

  3) Failure:
test_sti_all(TC_Sti_OgType) [./test/og/store/tc_sti.rb:89]:
<2> expected but was

  4) Failure:
test_all(TestMultiple) [./test/og/tc_multiple.rb:37]:
<false> is not true.

43 tests, 216 assertions, 3 failures, 1 errors

The failure in number 4 is an incorrect test, in my opinion, and
should be removed. But the rest aren't.

Anyway, if someone has nothing to do, please help a postgres novice. :)

"Never tell people how to do things. Tell them what to do and they
will surprise you with their ingenuity." —General George S. Patton

More information about the Nitro-general mailing list