Subject: | fetching from nested cursor (returned from procedure) leads to application crash (abort) |
I make simple testing code "dbdbugtest.pl" (attached)
This script works fine with DBD::Oracle 1.22, but with version 1.23
script crashes (on fetch row from nested cursor)
with exit code 134 "Aborting"
Subject: | dbdbugtest.pl |
#!/usr/bin/env perl
use strict;
use warnings;
use DBI;
use DBD::Oracle 1.23;
my $dbh = DBI->connect("dbi:Oracle:dprod.netsafe.cz",
"tnt", "welcome1",
{ AutoCommit => 0, RaiseError => 1, PrintError => 1, ora_verbose => 0 }
);
eval { $dbh->do("DROP TABLE test_tb1"); };
eval { $dbh->do("DROP TABLE test_tb2"); };
$dbh->do("CREATE TABLE test_tb1 ( id INTEGER, name VARCHAR2(10))") or die $dbh->errstr;
$dbh->do("CREATE TABLE test_tb2 ( id INTEGER, item VARCHAR2(10))") or die $dbh->errstr;
for (my $i = 1; $i < 3; $i++) {
$dbh->do("INSERT INTO test_tb1 VALUES ('$i', 'name$i')") or die $dbh->errstr;
for (my $n = 1; $n < 3; $n++) {
$dbh->do("INSERT INTO test_tb2 VALUES ('$i', 'item$i')") or die $dbh->errstr;
}
}
my $sth = $dbh->prepare("SELECT id, name, CURSOR(SELECT * FROM test_tb2 t2 WHERE t1.id = t2.id) FROM test_tb1 t1");
$sth->execute();
while (my @row = $sth->fetchrow_array()) {
print "ROW: @row\n";
while (my @item = $row[2]->fetchrow_array()) {
print " item: @item\n";
}
}
$dbh->rollback();