mysql> select count from csresult where sig = '024b1680d57f61df3b3236f0c9321ce7'; +-------+ | count | +-------+ | -1 | +-------+ 1 row in set (0.00 sec) mysql> show create table csresult\G *************************** 1. row *************************** Table: csresult Create Table: CREATE TABLE `csresult` ( `sig` varchar(32) NOT NULL default '', `count` int(10) default NULL, `results` mediumblob, `extrainfo` text, PRIMARY KEY (`sig`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 1 row in set (0.01 sec) mysql> show indexes from csresult\G *************************** 1. row *************************** Table: csresult Non_unique: 0 Key_name: PRIMARY Seq_in_index: 1 Column_name: sig Collation: A Cardinality: 204 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: 1 row in set (0.00 sec) mysql> select version(); +------------+ | version() | +------------+ | 4.1.16-log | +------------+ 1 row in set (0.00 sec)
#### #!/usr/bin/perl -w use strict; use DBI; my $dbh = DBI->connect("dbi:mysql:db:dbserver", "user", "password") or die "could not connect\n"; my $sth = $dbh->prepare("Select count from csresult where sig = '024b1680d57f61df3b3236f0c9321ce7'"); $sth->execute(); while(my $data = $sth->fetchrow_hashref()) { print "count:$data->{count}\n"; } ####
[samar@malena perl]$ uname -a Linux malena.XXX 2.6.18-128.el5 #1 SMP Wed Jan 21 10:41:14 EST 2009 x86_64 x86_64 x86_64 GNU/Linux [samar@malena perl]$ perl -version This is perl, v5.8.8 built for x86_64-linux-thread-multi Copyright 1987-2006, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. [samar@malena perl]$ perl -MDBI -e 'print "$DBI::VERSION\n"' 1.57 [samar@malena perl]$ perl dbi-test.pl count:-1
##
##
[samar@maria perl]$ uname -a Linux maria.XXX 2.6.9-22.0.1.XXX #1 SMP Mon Dec 5 17:33:30 IST 2005 x86_64 x86_64 x86_64 GNU/Linux [samar@maria perl]$ perl -version This is perl, v5.8.3 built for x86_64-linux-thread-multi Copyright 1987-2003, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. [samar@maria perl]$ perl -MDBI -e 'print "$DBI::VERSION\n"' 1.57 [samar@maria perl]$ perl dbi-test.pl count:4294967295