Centralize specification of expected Result class base in the codebase
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / IdentityInsert.pm
index 0ab37d2..c66508d 100644 (file)
@@ -5,8 +5,6 @@ use warnings;
 use base 'DBIx::Class::Storage::DBI';
 use mro 'c3';
 
-use namespace::clean;
-
 =head1 NAME
 
 DBIx::Class::Storage::DBI::IdentityInsert - Storage Component for Sybase ASE and
@@ -41,6 +39,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);