Say I create a ResultSet object with 

   search({ some_field => [ @possibilities ] }).

@possibilities happens to be only ( 'x' ) at the moment.

'x' doesn't happen to be in the database, but I'm lazily 
populating, so I do 

   my $thing = $rs->find_or_create({ some_field => 'x' });

In new_result, before the foreach on $self->{cond}, %new is 
right, and the entry is some_field => 'x'.

After the foreach on $self->{cond}, %new contains

    some_field => ['x']

This causes the SQL to break, placing x as an unquoted scalar 
instead of a ? in the VALUES part of the query.

My workaround is to get a new ResultSet before find_or_create.
Or is that what I'm "supposed to do"?

Mark

_______________________________________________
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]/

Reply via email to