On 9/20/06, Robert Dobbs <[EMAIL PROTECTED]> wrote:
> >From: mike <[EMAIL PROTECTED]>
> >Date: Wed, 20 Sep 2006 18:22:42 -0500
> >
> > LEFT JOIN `authorizations` `authorizations` ON (
> >`authorizations`.`product_id` = `me`.`product_id` AND
> >`authorizations.active` = 1 )
> >
> >the affected part is the second condition for the JOIN. without this
> >patch, the 1 is quoted as `1`, which is undesired. with the patch,
> >passing the 1 as a scalar reference allows it to be passed unquoted.
> >the associated search construct is:
> >
> >$rs->search
> >(
> > {
> > 'me.publisher_id' => $publisher->id,
> > 'me.active' => 1,
> > 'authorizations.authorization_id' => undef
> > },
>
> Isn't it supposed to figure out on its own whether to quote or not based on
> the field type in the schema?
quoting with backticks in mysql designates the enclosed value as an
identifier; thus, quoting the value in this example with a backtick,
regardless of field type, would be incorrect behavior.
i am fairly certain that the "don't quote if scalar ref" behavior that
is supported for where conditions simply isn't implemented for
join_condition due to lack of usage. most are likely to not be using
the custom from stuff for joins not directly comparing two columns.
but i could be wrong.
-mike
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/