Works under SQLite.
Are you sure you are connecting to the same database in both test cases?
What happens if you change from
selectrow_array to
selectrow_hashref, and dump the output?
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
use Data::Dumper; $Data::Dumper::Useqq=1;
my $db_file = 'pm725924.sqlite';
unlink $db_file;
my $dbh = DBI->connect("dbi:SQLite:dbname=$db_file") or die;
$dbh->{PrintError} = 1;
$dbh->{PrintWarn } = 1;
$dbh->do($_) or die for split "\n", <<'END_OF_SQL';
create table images( id smallint, foo varchar(10) );
insert into images values( 61893, 'bar-man' );
insert into images values( 62437, 'baretta' );
insert into images values( 50000, 'a' );
insert into images values( 70000, 'c' );
END_OF_SQL
#print Dumper $dbh->selectrow_array(
print Dumper $dbh->selectrow_hashref(
"SELECT min(id),max(id) from images where foo like 'bar%'"
);
$dbh->disconnect or die;
Produces:
$VAR1 = {
"min(id)" => 61893,
"max(id)" => 62437
};