Trap exact condition of reported, yet undiagnosed IDENTITY_SELECT
Peter Rabbitson [Thu, 10 Sep 2015 15:56:55 +0000 (17:56 +0200)]
Something is popagating the _autoinc_supplied_for_op flag where it shouldn't

lib/DBIx/Class/Storage/DBI/IdentityInsert.pm

index 0ab37d2..8485e86 100644 (file)
@@ -41,6 +41,11 @@ sub _prep_for_execute {
   my $table = $self->sql_maker->_quote($ident->name);
   $op = uc $op;
 
+  DBIx::Class::Exception->throw(
+    "Unexpected _autoinc_supplied_for_op flag in callstack - please file a bug including the stacktrace ( @{[ DBIx::Class::_ENV_::HELP_URL() ]} ):\n\n STACKTRACE STARTS",
+    'stacktrace'
+  ) if $op ne 'INSERT' and $op ne 'UPDATE';
+
   my ($sql, $bind) = $self->next::method(@_);
 
   return (<<EOS, $bind);