K
KomsBomb
Perl 5.8.0
Newest DBD::AnyData and AnyData just downloaded from CPAN.
When export a test database to xml, the script hangs and seems
it's in a dead loop.
********My Code start*************
use strict;
use warnings;
use DBI;
my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):');
my ($table, $format, $file, $flags) = (
'test', 'XML', 'cars.csv', { col_names => 'make,model,year' }
);
$dbh->do("CREATE TABLE test (id TEXT,phrase TEXT)");
$dbh->do("INSERT INTO test VALUES (1,'foonadfjlsdj')");
$dbh->do("INSERT INTO test VALUES (2,'bar')");
$dbh->func( $table, $format, $file, 'ad_export'); #hangs here
********My Code end*************
By doing more investigation, I found where it hangs,
In package AnyData (note not the DBD::AnyData), line 639, in sub
adConvert, there is a line
" @cols = @{ shift @{ $source_data } };"
When I execute step by step there, the program hangs at that line.
Any one got such problem? Is it a bug in Perl?
How to solve it?
PS: I've also tested CSV format and it's OK. No any problem.
Newest DBD::AnyData and AnyData just downloaded from CPAN.
When export a test database to xml, the script hangs and seems
it's in a dead loop.
********My Code start*************
use strict;
use warnings;
use DBI;
my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):');
my ($table, $format, $file, $flags) = (
'test', 'XML', 'cars.csv', { col_names => 'make,model,year' }
);
$dbh->do("CREATE TABLE test (id TEXT,phrase TEXT)");
$dbh->do("INSERT INTO test VALUES (1,'foonadfjlsdj')");
$dbh->do("INSERT INTO test VALUES (2,'bar')");
$dbh->func( $table, $format, $file, 'ad_export'); #hangs here
********My Code end*************
By doing more investigation, I found where it hangs,
In package AnyData (note not the DBD::AnyData), line 639, in sub
adConvert, there is a line
" @cols = @{ shift @{ $source_data } };"
When I execute step by step there, the program hangs at that line.
Any one got such problem? Is it a bug in Perl?
How to solve it?
PS: I've also tested CSV format and it's OK. No any problem.