[Dbix-class] Reducing $SIG{__DIE__} errors in find()

Ton Voon tonvoon at gmail.com
Thu Dec 9 11:43:14 GMT 2010


Hi!

We updated Opsview to the latest DBIx::Class 0.08124 and got loads of  
unexpected errors.

In one script, we set $SIG{__DIE__} to catch any unexpected conditions  
and store those. With the update, we were getting lots of errors with:

DBIx::Class::InflateColumn::get_inflated_column(): Unable to satisfy  
requested constraint 'name', no values for column(s): 'name' at (eval  
1396) line 2

This is due to _build_unique_cond issuing a throw_exception when  
conditions are passed in that do not match with the unique_conditions  
it expects. However, a call like $rs->find(1) will try all the  
different unique constraints to see if it can find something, thus  
causing the above message to get thrown in non-exceptional  
circumstances.

I've made a patch below which tells _build_unique_cond to avoid  
throwing this error if a flag is set. There is also an update to t/ 
60core.t to catch this situation.

Can this go in a future DBIx-Class release? If so, can this be  
credited to "Ton Voon, Opsera Limited".

Ton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbix_class_with_less_dies.patch
Type: application/octet-stream
Size: 2085 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20101209/4f6eda8a/dbix_class_with_less_dies.obj


More information about the DBIx-Class mailing list