[Dbix-class] Bug in resultset?

Chris Cole chris at compbio.dundee.ac.uk
Wed Jul 7 09:18:36 GMT 2010


I'm finding when restricting a search on the same column for multiple 
criteria only one of them is being applied. e.g.

my $rs = $self->resultset('NgsMappings')->search(
    {
       'mp_start'  => {'>=', $start},
       'mp_start'  => {'<', $end},
       'rs_name'   => $chr,
       'me_sample' => {'like', $dataset},
    },
    {
       columns => [qw/mp_strand mp_start mp_end mp_freq/],
       join => [qw/mp_me_id mp_ref_id/],
    }
);

Gives this SQL (note the single use of 'mp_start'):
SELECT me.mp_strand, me.mp_start, me.mp_end, me.mp_freq
FROM ngs_mappings me
JOIN ngs_map_exps mp_me_id ON mp_me_id.me_id = me.mp_me_id
JOIN ngs_ref_seqs mp_ref_id ON mp_ref_id.rs_id = me.mp_ref_id
WHERE ( ( me_sample LIKE ? AND mp_start < ? AND rs_name = ? ) ) : 
'FPAox%', '5446714', 'chr1'

I can't find anything in the documentation regarding this, so is it a 
bug or am I missing something (probably)?



More information about the DBIx-Class mailing list