Hi Jeff,

I'm still having a few problems. I tried 1.11, but the key lookups are still doing full file reads. Moving on to 1.12, I was happy to see the key lookups worked great, but I got unexpected results from queries.

Thanks for your help.
-Jim

Here's the test code:
----------------------------------
#!perl -w
$|=1;
use strict;
use DBI;
my $dbh = DBI->connect('dbi:DBM:type=GDBM_File;mldbm=Storable');
$dbh->do(q{ DROP TABLE IF EXISTS dbm_test });
$dbh->do(q{ CREATE table dbm_test (c1 INT, c2 TEXT, c3 TEXT) });
my $insert = $dbh->prepare(q{ INSERT INTO dbm_test VALUES(?,?,?) });
$insert->execute(1,'a','foo');
$insert->execute(2,'b','bar');
$insert->execute(3,'c','baz');
my $select = $dbh->prepare(q{ SELECT * FROM dbm_test });
$select->execute;
$select->dump_results;
$select = $dbh->prepare(q{ SELECT c1,c3 FROM dbm_test WHERE c1=? });
$select->execute(5); # should return nada.
$select->dump_results;
$select->execute(1); # should to columns
$select->dump_results;
print $dbh->dbm_versions;

---------------------------------------------------------
SQL-Statement-1.11 output
Correct results but optimized key lookups
isn't working (full file reads)
---------------------------------------------------------
$ perl tdbm.pl
'2', 'b', 'bar'
'3', 'c', 'baz'
'1', 'a', 'foo'
3 rows

0 rows
'1', 'foo'
1 rows
DBD::DBM         0.02 using GDBM_File + MLDBM + Storable
  DBD::File      0.33
  DBI::SQL::Nano 0.03
  SQL::Statement 1.11
DBI              1.48
OS               linux (2.4.22-1.2115.nptlsmp)
Perl             5.008003 (i686-linux-thread-multi)

---------------------------------------------------------
SQL-Statement-1.12 output
Incorrect results but optimized key lookups
works great
---------------------------------------------------------
$ perl tdbm.pl
'2', 'b', 'bar'
'3', 'c', 'baz'
'1', 'a', 'foo'
3 rows

0 rows
'1', 'foo'
1 rows
DBD::DBM         0.02 using GDBM_File + MLDBM + Storable
  DBD::File      0.33
  DBI::SQL::Nano 0.03
  SQL::Statement 1.11
DBI              1.48
OS               linux (2.4.22-1.2115.nptlsmp)
Perl             5.008003 (i686-linux-thread-multi)




Reply via email to