Skip to content

When in async mode, fetchall_arrayref's $slice functionality is broken [rt.cpan.org #80036] #192

Open
@mbeijen

Description

@mbeijen

Migrated from rt.cpan.org#80036 (status was 'open')

Requestors:

From [email protected] on 2012-10-06 06:37:05:

Description: When in async mode, fetchall_arrayref's $slice functionality is broken because $sth's attributes cannot be fetched. 

Environment: 

perl 5.12.4
DBI::mysql 4.22
OS: Mac OSX 10.8.2, Linux Mint 12


Here is the code snippet to reproduce it

my $dbh = DBI->connect($dsn, $user, $pass);

my $sth = $dbh->prepare("select sleep(3) as sleep, 3 as number", { async => 1});
$sth->execute;

my $attr = $sth->FETCH('FetchHashKeyName');
print Dumper($attr);

# the NAME attribute is not populated
my $names = $sth->FETCH($attr); # $names is undef. In sync mode, this will be populated with the column names [ 'sleep', 'number']
print Dumper($names), "\n";


until($sth->mysql_async_ready) {
   say 'not ready yet!';
   sleep 1;
}

my $rows = $sth->fetchall_arrayref( {} ); # Fail with the following error
# Can't use an undefined value as an ARRAY reference at /Library/Perl/5.12/darwin-thread-multi-2level/DBI.pm line 2054.

Thanks

From https://www.google.com/accounts/o8/id?id=aitoawmmgszlzzbgfzbgcq1gk0p8kiw2p0pzuw8 on 2012-10-10 22:13:46


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions