Revert 2131aa2, cf52a9a and 2aa3f4c
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Informix.pm
index 90587d0..e8c123d 100644 (file)
@@ -11,6 +11,10 @@ use namespace::clean;
 
 __PACKAGE__->sql_limit_dialect ('SkipFirst');
 __PACKAGE__->sql_quote_char ('"');
+__PACKAGE__->datetime_parser_type (
+  'DBIx::Class::Storage::DBI::Informix::DateTime::Format'
+);
+
 
 __PACKAGE__->mk_group_accessors('simple' => '__last_insert_id');
 
@@ -28,11 +32,11 @@ This class implements storage-specific support for the Informix RDBMS
 
 sub _execute {
   my $self = shift;
-  my ($op) = @_;
   my ($rv, $sth, @rest) = $self->next::method(@_);
-  if ($op eq 'insert') {
-    $self->__last_insert_id($sth->{ix_sqlerrd}[1]);
-  }
+
+  $self->__last_insert_id($sth->{ix_sqlerrd}[1])
+    if $self->_perform_autoinc_retrieval;
+
   return (wantarray ? ($rv, $sth, @rest) : $rv);
 }
 
@@ -40,19 +44,19 @@ sub last_insert_id {
   shift->__last_insert_id;
 }
 
-sub _svp_begin {
+sub _exec_svp_begin {
     my ($self, $name) = @_;
 
-    $self->_get_dbh->do("SAVEPOINT $name");
+    $self->_dbh->do("SAVEPOINT $name");
 }
 
 # can't release savepoints
-sub _svp_release { 1 }
+sub _exec_svp_release { 1 }
 
-sub _svp_rollback {
+sub _exec_svp_rollback {
     my ($self, $name) = @_;
 
-    $self->_get_dbh->do("ROLLBACK TO SAVEPOINT $name")
+    $self->_dbh->do("ROLLBACK TO SAVEPOINT $name")
 }
 
 sub with_deferred_fk_checks {
@@ -117,10 +121,6 @@ sub connect_call_datetime_setup {
   $ENV{GL_DATETIME} = "%Y-%m-%d %H:%M:%S%F5";
 }
 
-sub datetime_parser_type {
-  'DBIx::Class::Storage::DBI::Informix::DateTime::Format'
-}
-
 package # hide from PAUSE
   DBIx::Class::Storage::DBI::Informix::DateTime::Format;
 
@@ -169,14 +169,18 @@ sub format_date {
   return $date_parser->format_datetime(shift);
 }
 
-1;
-
-=head1 AUTHOR
+=head1 FURTHER QUESTIONS?
 
-See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
+Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
 
-=head1 LICENSE
+=head1 COPYRIGHT AND LICENSE
 
-You may distribute this code under the same terms as Perl itself.
+This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
+by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
+redistribute it and/or modify it under the same terms as the
+L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
 
 =cut
+
+1;
+