Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mbeijen opened this issue Nov 15, 2017 · 0 comments
Labels

Comments

@mbeijen
Copy link
Contributor

mbeijen commented Nov 15, 2017

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

Requestors:

From mytram2@gmail.com 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


@dveeden dveeden added the async label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants