Hi Paul,
This is an actual bug introduced by (I think) https://github.com/dbsrgits/dbix-class/commit/d0cefd99a. I will fix that shortly after the current permission dispute is resolved and I can get back to actually working on things.
In the meantime - use create() instead, it will be a tad (not much) slower, and will DTRT.
Minimal reproduction based on the DBIC test suite:
~$ perl -It/lib -MDBICTest -e '
DBICTest->init_schema->resultset("Artist")->populate([{
name => "beh",
cds => [{
cdid => 666,
year => 0,
title => "buh",
tracks => [{
title => "eeeh"
}]
}]
}])
'
The working example with create() instead:
~$ DBIC_TRACE_PROFILE=console perl -It/lib -MDBICTest -e '
my $s = DBICTest->init_schema;
$s->storage->debug(1);
$s->resultset("Artist")->create({
name => "beh",
cds => [{
cdid => 666,
year => 0,
title => "buh",
tracks => [{
title => "eeeh"
}]
}]
})
'
BEGIN WORK
INSERT INTO artist( name )
VALUES( 'beh' )
INSERT INTO cd( artist, cdid, title, year )
VALUES( '4', '666', 'buh', '0' )
SELECT me.position
FROM track me
WHERE cd = '666'
ORDER BY position DESC
LIMIT '1'
INSERT INTO track( cd, position, title )
VALUES( '666', '1', 'eeeh' )
COMMIT
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.