[Dbix-class] Parameter ordering in exceptions

Ovid publiustemp-dbic at yahoo.com
Wed Nov 26 15:56:33 GMT 2008


Routinely I get error messages like this:

DBIx::Class::Row::insert():
DBI Exception: DBD::mysql::st execute failed: Duplicate entry
\'05a18ab65b354b2c4112de48f45419bf\' for key 1 [for Statement "INSERT
INTO identifier (authority, created, entity_pid, identifier_id,
modified, type, value) VALUES (?, ?, ?, ?, ?, ?, ?)" with ParamValues:
6=\'crid://bbc.co.uk/b/25027\', 4=\'2008-11-26 15:34:10\',
1=\'2008-11-26 15:34:10\', 3=\'05a18ab65b354b2c4112de48f45419bf\',
0=\'bds\', 2=\'b0000v1b\', 5=\'crid\'] at ...


I know
exactly what caused this and why, but I constantly find myself
reformatting that message to order the bind values correctly (I'm
guessing they're in hash order now).  With their pseudo-random order,
particularly if you have lots of values, it can be quite painful to
manually count which parameter goes with which place holder.  I've
given up looking for the code which does this, otherwise I'd submit a
patch.

Is there any inclination to change this?

Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6




More information about the DBIx-Class mailing list