From: Rafael Kitover Date: Thu, 1 Dec 2011 17:29:51 +0000 (-0500) Subject: Add live Firebird test for paging fix 8b31f62e X-Git-Tag: v0.08197~138 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5346c8ff29968a334e9b3269be7c06c3e3235d08;p=dbsrgits%2FDBIx-Class.git Add live Firebird test for paging fix 8b31f62e --- diff --git a/t/750firebird.t b/t/750firebird.t index ec45419..d55474b 100644 --- a/t/750firebird.t +++ b/t/750firebird.t @@ -4,9 +4,10 @@ use warnings; use Test::More; use Test::Exception; use DBIx::Class::Optional::Dependencies (); +use Scope::Guard (); +use Try::Tiny; use lib qw(t/lib); use DBICTest; -use Scope::Guard (); my $env2optdep = { DBICTEST_FIREBIRD => 'test_rdbms_firebird', @@ -46,8 +47,7 @@ for my $prefix (keys %$env2optdep) { SKIP: { $schema = DBICTest::Schema->connect($dsn, $user, $pass, { auto_savepoint => 1, - quote_char => q["], - name_sep => q[.], + quote_names => 1, ($dsn !~ /ODBC/ ? (on_connect_call => 'use_softcommit') : ()), }); my $dbh = $schema->storage->dbh; @@ -206,6 +206,24 @@ EOF is( eval { $lim->next->artistid }, 102, "iterator->next ok" ); is( $lim->next, undef, "next past end of resultset ok" ); +# test bug in paging + my $paged = $ars->search({ name => { -like => 'Artist%' } }, { + page => 1, + rows => 2, + order_by => 'artistid', + }); + + my $row; + lives_ok { + $row = $paged->next; + } 'paged query survived'; + + is try { $row->artistid }, 5, 'correct row from paged query'; + + # DBD bug - if any unfinished statements are present during + # DDL manipulation (test blobs below)- a segfault will occur + $paged->reset; + # test nested cursors { my $rs1 = $ars->search({}, { order_by => { -asc => 'artistid' }}); @@ -307,8 +325,11 @@ sub cleanup { diag $@ if $@; } - foreach my $table (qw/artist bindtype_test sequence_test/) { + foreach my $table (qw/artist sequence_test/) { eval { $dbh->do(qq[DROP TABLE "$table"]) }; diag $@ if $@; } + + eval { $dbh->do(q{DROP TABLE "bindtype_test"}) }; + diag $@ if $@; }