[Dbix-class] Update sometimes barfing...

Matt S Trout dbix-class at trout.me.uk
Sun Oct 14 21:31:46 GMT 2007


On Fri, Oct 12, 2007 at 03:51:22PM -0700, Mark Ethan Trostler wrote:
> any idea why this:
> 
> $row->update({ output => \"CONCAT(output, $value)" })
> 
> would sometimes throw this:
> 
> DBIx::Class::InflateColumn::update(): Error executing 'UPDATE .... 
> WHERE ( id = ? )': called with 1 bind variables when 0 are needed
> 
> ??
> 
> 
> the output column can get large so I don't want to re-set it fully 
> everytime to just append to it...
> 
> maybe $value is not being escaped properly??
> However I do this before that 'update' call:
> 
> $value = $db->storage->dbh->quote($value);
> $value =~ s/(?<!\\)\?/\\?/g;
> 
> any ideas greatly appreciated... thanks!

First idea: Stick a warn statement immediately above it with an eval, and
output the data and whether the update fails or not.

Then, come back to us with the results.

-Then- we can help.

It's what I'd be doing if it was my code, not a lot that can be done without
seeing what's actually going on ...

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list