in reply to Re: Does fetchall_arrayref() ever return a NULL?
in thread Does fetchall_arrayref() ever return a NULL?
My attempt to reproduce this has failed.
use strict; use warnings; use Test::More tests => 2; use DBI; use Data::Dumper; my $dbh = DBI->connect ('dbi:SQLite:dbname=:memory:', '', ''); my $sth = $dbh->prepare ('SELECT 1 = 1;'); $sth->execute; $sth->finish; ok ! $sth->{Active}, 'Handle is inactive'; my $res = $sth->fetchall_arrayref (); is $res, undef, 'Result is undef' or diag Dumper ($res); diag "DBI $DBI::VERSION";
$ perl inactive.t 1..2 ok 1 - Handle is inactive not ok 2 - Result is undef # Failed test 'Result is undef' # at /tmp/inactive2.t line 16. # got: 'ARRAY(0x2c41050)' # expected: undef # $VAR1 = []; # DBI 1.643 # Looks like you failed 1 test of 2.
On this apparently inactive handle it still returns an empty arrayref. Where am I going wrong?
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Does fetchall_arrayref() ever return a NULL?
by tangent (Parson) on May 06, 2022 at 20:01 UTC | |
|
Re^3: Does fetchall_arrayref() ever return a NULL?
by erix (Prior) on May 06, 2022 at 12:38 UTC | |
by hippo (Archbishop) on May 06, 2022 at 13:06 UTC | |
by erix (Prior) on May 06, 2022 at 13:12 UTC | |
|
Re^3: Does fetchall_arrayref() ever return a NULL?
by bartender1382 (Beadle) on May 07, 2022 at 15:23 UTC | |
by NERDVANA (Priest) on May 08, 2022 at 01:41 UTC |