Skip Menu |

This queue is for tickets about the Class-DBI-Plugin-DeepAbstractSearch CPAN distribution.

Report information
The Basics
Id: 27061
Status: new
Priority: 0/
Queue: Class-DBI-Plugin-DeepAbstractSearch

People
Owner: Nobody in particular
Requestors: ckatz [...] cfa.harvard.edu
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.04
Fixed in: (no value)



Subject: error in resolving 'or' clause
Calling deep_search_where($where) on my CDBI class for my "projects" table, with a WHERE structure like $where = { 'type.code' => [ 'std', 'ddt', 'too'] } fails. Investigating a bit, I found that after this runs through _transform_where(), it becomes $where={'t_projects_type.code'=> [ 't_projects.std','ddt','t_projects.too',undef] } instead of the expected $where={'t_projects_type.code'=> [ 'std','ddt','too'] } It appears that within the ($ref eq 'ARRAY') clause in transform_where(), the else clause is being executed rather than the if clause which appears to be the correct choice. This can be worked around by specifying $where = { '-or' => [ 'type.code','std', 'type.code', 'ddt', 'type.code', 'too' ] }
From: ckatz [...] cfa.harvard.edu
Here's a better workaround: $where = { 'type.code' => [ -or => {'=', 'std'}, {'=', 'ddt'}, {'=', 'too'} ] };