I've found a reproducible failure that 
occurs in DBI-1.20 that does not occur in DBI-1.19. 
Using the 
DBD::mysql backend, by the way, and observed using
both mysql-3.23.37 
and mysql-3.23.46 (it's not asked about in the bug
report format).  Apologies if yahoo mail mangled the
newlines.

OK here's the bug report:

HERE is a script, intended to be saved as
'showbug.pl', that shows 
the problem under 1.20 but not under 1.19.  After the
__END__ of the 
script is the database schema for the test 'jl1'
database (that's 
jay-el-one, for those with ambiguous fonts).

--- begin showbug.pl ---
#!/usr/local/bin/perl -w
use strict;
use Data::Dumper;
use DBI;

=pod

=head1 SUMMARY

showbug.pl

this shows a bug in DBI-1.20 (or at least an
inconsistency vs. 
DBI-1.19)

The script here (along with the database definition
included at the 
end of this file -- no data is needed) works in
DBI-1.19, but not in 
DBI-1.20.

=head1 BUG REPORT

this is a bug report

=head1 Output of 'perl showbug.pl' on DBI-1.20 (this
script)

  ./showbug.pl
  Connected to data source DBI:mysql:jl1::db
  select linkid, e, f, UNIX_TIMESTAMP(firsttime),
                           a, b, c, d
                          from data, entries
                          where linkid=id and
day='2001-12-29'
                          order by c desc
  Use of uninitialized value in hash element at 
/usr/local/perl5.6.0/lib/site_perl/5.6.0/i686-linux/DBI.pm
line 1205.
  Use of uninitialized value in concatenation (.) at 
/usr/local/perl5.6.0/lib/site_perl/5.6.0/i686-linux/DBI.pm
line 1208.
  DBD::mysql::db selectall_hashref failed: Field ''
does not exist 
(not one of e f UNIX_TIMESTAMP(firsttime) a b c linkid
d) at 
../showbug.pl line 45.
  DBD::mysql::db selectall_hashref failed: Field ''
does not exist 
(not one of e f UNIX_TIMESTAMP(firsttime) a b c linkid
d) at 
../showbug.pl line 45.

=cut


my $data_source = "DBI:mysql:jl1::db"; #
my ($username, $auth) = ("user", "password");
my %attr = ();
my $dbh;

DBI->trace(2);

$dbh = DBI->connect($data_source, $username, $auth,
\%attr);
     # $dbh is global
$dbh->{RaiseError} = 1; # do this, or check every call
for errors
print "Connected to data source $data_source\n";
my $date = "2001-12-29";
my $cmd = "select linkid, e, f,
UNIX_TIMESTAMP(firsttime),
              a, b, c, d
             from data, entries
             where linkid=id and day='$date'
             order by c desc";
print "$cmd\n" if 1;
my $ary_ref = $dbh->selectall_hashref($cmd);
print Dumper($ary_ref);

__END__
# output of mysqldump --no-data jl1 data entries

# MySQL dump 8.13
#
# Host: localhost    Database: jl1
#--------------------------------------------------------
# Server version    3.23.37

#
# Table structure for table 'data'
#

CREATE TABLE data (
   linkid int(11) NOT NULL default '0',
   day date default '1999-01-01',
   a float NOT NULL default '0',
   b float NOT NULL default '0',
   c float NOT NULL default '0',
   d float NOT NULL default '0',
   lasttime timestamp(14) NOT NULL,
   KEY day (day),
   KEY linkid (linkid)
) TYPE=MyISAM;

#
# Table structure for table 'entries'
#

CREATE TABLE entries (
   id int(10) NOT NULL default '0',
   e varchar(255) NOT NULL default '',
   f varchar(255) NOT NULL default '',
   g text NOT NULL,
   h varchar(255) NOT NULL default '',
   firsttime datetime default NULL,
   lasttime timestamp(14) NOT NULL,
   i text NOT NULL,
   PRIMARY KEY  (id),
   KEY eindex (e),
   KEY findex (f),
   KEY hindex (h)
) TYPE=MyISAM PACK_KEYS=1;

-- end showbug.pl --



__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

Reply via email to