Some evil is afoot. The problem appears to be that the new bulk insert
(or SQLite) does not honor the columns specified in populate.

Taking from populate.t:

This:

> $schema->populate('Artist', [
> [ qw/artistid name/ ],
> [ 4, "b" ],
> [ 5, "c" ],
> [ 6, "d" ],
> [ 7, "e" ],


and this:

> $schema->populate('Artist', [
> [ qw/name artistid/ ],
> [ 4, "b" ],
> [ 5, "c" ],
> [ 6, "d" ],
> [ 7, "e" ],



both yield the same thing in the database:

artistid, name
4, b
5, c
6, d
7, e

Or to put it another way, the names and order of columns/data given to
populate are totally ignored, and the data inserted is assumed to be in
the order in which the fields appear in the database itself.

Depending on whether you create the database from a sql schema, or from
the DBIC Source classes using deploy, this could be a problem.

Another symptom that has cropped up is this type of thing:

> $schema->populate('Artist', [
> [ qw/artistid/ ],
> [ 4 ],
> [ 5 ],
> [ 6 ],
> [ 7 ],
> :db prepare_cached failed: table artist has 2 columns but 1 values were 
> supplied(1) at dbdimp.c line 269 at lib/DBIx/Cl
> ss/Storage/DBI.pm line 960.

If a table have 10 fields, but I only need to add 5 of them to fulfill
any NOT NULL or FK requirements, I can't.

-=Chris

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
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