Fix silent failures on autoinc PK without an is_auto_increment attribute
authorPeter Rabbitson <ribasushi@cpan.org>
Tue, 13 Sep 2016 04:41:16 +0000 (06:41 +0200)
committerPeter Rabbitson <ribasushi@cpan.org>
Tue, 13 Sep 2016 15:34:19 +0000 (17:34 +0200)
commit7305f6f933813eaa1a4a7b65bfc5f158d0d65c4d
tree0eee8e2837df89e19c692b5c9aa843c20ca02e17
parent3aa25d8b47104964c689be4ca8c1fc5b17781a7f
Fix silent failures on autoinc PK without an is_auto_increment attribute

Back in fabbd5cc the refactor of the subsystem left out this corner case,
resulting in drivers without a functioning last_insert_id() to either fail to
retrieve the autoinc value, or in case of the suboptimal ->_identity()-based
implementations ( MSSQL / Sybase ) to *reuse* the last successfully retrieved
value (sigh)

Since the entire codepath is a hot mess, not changing much aside from an extra
pass to enable implicit inferrence of an is_auto_increment setting.

Several different codepaths in the test suite were used to ensure everything
meshes correctly with retrieve_on_insert and similar
16 files changed:
Changes
lib/DBIx/Class/Storage/DBI.pm
t/46where_attribute.t
t/72pg.t
t/746mssql.t
t/cdbi/copy.t
t/cdbi/testlib/Actor.pm
t/cdbi/testlib/ActorAlias.pm
t/cdbi/testlib/ColumnObject.pm
t/cdbi/testlib/Film.pm
t/cdbi/testlib/ImplicitInflate.pm
t/cdbi/testlib/Log.pm
t/cdbi/testlib/MyFoo.pm
t/lib/DBICTest/Schema/BooksInLibrary.pm
t/lib/DBICTest/Schema/TimestampPrimaryKey.pm
t/row/inflate_result.t