Hello,

I am trying to move to related_count() method calls in my RDBO (0.764)
app, they seem so convenient and quick. I am running into two separate
bugs, however:

1. A fatal error is thrown when the object count is zero. I believe
this is happening around line 2749 of MakeMethods::Generic:

$count =
            $ft_manager->$ft_count_method(query => [EMAIL PROTECTED], db =>
$self->db, %args)
              or die $ft_manager->error;

Which dies because $count is assigned zero, making the statement evaluate false.

2. If I am counting objects related by a many-to-many where the
mapping table has a multi-valued primary key, the query generated is
something like

SELECT
        COUNT(DISTINCT t1.a_id, t1.b_id)
        FROM
          a_b_map t1
          JOIN b t2 ON (t1.b_id = t2.id)
        WHERE
          t1.a_id=xxx

But Postgres says

ERROR:  function count(integer, integer) does not exist at character 9

Thanks in advance,

Derek

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to