(sources not yet registered with a schema)
- Automatically require the requested cursor class before use
(RT#64795)
+ - Work around a Firebird ODBC driver bug exposed by DBD::ODBC 1.29
* Misc
- Only load Class::C3 and friends if necessary ($] < 5.010)
my $rdbms_db2 = {
'DBD::DB2' => '0',
};
+my $rdbms_firebird_odbc = {
+ 'DBD::ODBC' => '0',
+};
my $reqs = {
dist => {
},
},
+ test_rdbms_firebird_odbc => {
+ req => {
+ $ENV{DBICTEST_FIREBIRD_ODBC_DSN}
+ ? (
+ %$rdbms_firebird_odbc,
+ ) : ()
+ },
+ },
+
test_memcached => {
req => {
$ENV{DBICTEST_MEMCACHED}
}
sub _svp_begin {
- my ($self, $name) = @_;
+ my ($self, $name) = @_;
- $self->_get_dbh->do("SAVEPOINT $name");
+ $self->_dbh->do("SAVEPOINT $name");
}
sub _svp_release {
- my ($self, $name) = @_;
+ my ($self, $name) = @_;
- $self->_get_dbh->do("RELEASE SAVEPOINT $name");
+ $self->_dbh->do("RELEASE SAVEPOINT $name");
}
sub _svp_rollback {
- my ($self, $name) = @_;
+ my ($self, $name) = @_;
- $self->_get_dbh->do("ROLLBACK TO SAVEPOINT $name")
+ $self->_dbh->do("ROLLBACK TO SAVEPOINT $name")
}
sub _ping {
You may distribute this code under the same terms as Perl itself.
=cut
+# vim:sts=2 sw=2:
use strict;
use warnings;
-use base qw/DBIx::Class::Storage::DBI::InterBase/;
+use base 'DBIx::Class::Storage::DBI::InterBase';
use mro 'c3';
+use Try::Tiny;
+use namespace::clean;
=head1 NAME
# ODBC uses dialect 3 by default, good
sub _set_sql_dialect { 1 }
-# releasing savepoints doesn't work, but that shouldn't matter
+# releasing savepoints doesn't work for some reason, but that shouldn't matter
sub _svp_release { 1 }
+sub _svp_rollback {
+ my ($self, $name) = @_;
+
+ try {
+ $self->_dbh->do("ROLLBACK TO SAVEPOINT $name")
+ }
+ catch {
+ # Firebird ODBC driver bug, ignore
+ if (not /Unable to fetch information about the error/) {
+ $self->throw_exception($_);
+ }
+ };
+}
+
package # hide from PAUSE
DBIx::Class::Storage::DBI::ODBC::Firebird::DateTime::Format;
You may distribute this code under the same terms as Perl itself.
=cut
+# vim:sts=2 sw=2:
my $st = $schema->resultset('SequenceTest')->create({ name => 'foo', pkid1 => 55 });
is($st->pkid1, 55, "Firebird Auto-PK without trigger: First primary key set manually");
+# test transaction commit
+ $schema->txn_do(sub {
+ $ars->create({ name => 'in_transaction' });
+ });
+ ok (($ars->search({ name => 'in_transaction' })->first),
+ 'transaction committed');
+ is $schema->storage->_dbh->{AutoCommit}, 1,
+ '$dbh->{AutoCommit} is correct after transaction commit';
+
+ $ars->search({ name => 'in_transaction' })->delete;
+
# test savepoints
throws_ok {
$schema->txn_do(sub {
} qr/rolling back outer txn/,
'correct exception for rollback';
+ is $schema->storage->_dbh->{AutoCommit}, 1,
+ '$dbh->{AutoCommit} is correct after transaction rollback';
+
ok ((not $ars->search({ name => 'in_outer_txn' })->first),
'outer txn rolled back');