perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Brooks <db...@yahoo.com>
Subject DBIx::Recordset - problem with !Tables and !TabJoin
Date Tue, 26 Oct 2004 18:56:31 GMT
I'm using DBIx::Record set to great effect, but I've discovered a bug 
which annoys me. An SQL statement with joins in it doesn't need to name 
any tables, but if I leave out the !Tables parameter it produces a 
statement like 'SELECT * FROM', which the server rightly rejects with an 
error. I'd like it to look for a !TabJoin (or other parameters that make 
it use a join) and not generate an invalid statement when they're 
present but !Tables is not. As it is, it doesn't matter what I put in 
!Tables beccause it's not used.

Here's an example of one place this occurs:

  *set = DBIx::Recordset->Search({'!DataSource'      => $self->mydatabase,
                                  '!Table'           => 'spurious',
                                  '!TabJoin'         => '((users JOIN membership ON users.id
= membership.users_id) JOIN groups ON membership.groups_id = groups.id) JOIN permissions ON
(users.id = permissions.users_id AND user_r) OR (groups.id = permissions.groups_id AND group_r)
OR member_r OR anonymous_r',
                                  '!Fields'          => 'true',
                                  'users.id'         => $userid,
                                  'permissions.page' => $pn});


Is this feasable?

db48x

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message