Greetings

I am trying to install mysql/DBI/DBD on a Dell Poweredge 6850 with quad 
dual-core Xeons running RedHat Enterprise v4. I removed the mysql rpms and 
installed 5.0.21 from source. I downloaded the 1.5 DBI and 3.003 DBD from CPAN 
and installed them from source. I have installed this software many times on 
many other machines without a hitch, but this time....

I have been chasing a problem with the perl interface to mysql for many days 
now. It began when I could not connect to mysql through /tmp/mysql.sock (and 
could not make the interface search there) and remains as what appears to be a 
corruption of data through the interface. I found a solution to the first 
problem on the mysql:install forum in the use of 127.0.0.1 instead of 
localhost. It bothers me that DBD/DBI are stuck on the location of the socket 
at /var/lib/mysql, but hey, at least it works now. I can't get any relief on 
the following problem. I have a simple test script I wrote to illustrate the 
problem:

      1 #! /usr/bin/perl -w
      2
      3 use strict;
      4 use FileHandle;
      5 use File::Basename;
      6 use Getopt::Long;
      7 use DBI;
      8
      9 #DBI->trace(4);
     10
     11 my $dbh = DBI->connect("DBI:mysql:database=test;host=127.0.0.1", 
'root', 'pw', {RaiseError => 1, PrintError => 0}) or die "
     11 Can't connect to database: $DBI::errstr\n";
     12 DBI->trace($ARGV[1]);
     13 my $sth = $dbh->prepare("$ARGV[0]");
     14 $sth->execute();
     15 while (my @row = $sth->fetchrow_array()) {
     16     print "@row\n";
     17 }
     18
     19 $sth->finish();
     20
     21 $dbh->disconnect or warn "Disconnection failed: $DBI::errstr\n";

It returns an uninitialized value:

    -> fetchrow_array for DBD::mysql::st (DBI::st=HASH(0x914bb0)~0x914af0) 
thr#504010
    -> dbd_st_fetch for 00914ce0, chopblanks 0
    <- dbd_st_fetch, 11 cols
    <- fetchrow_array= ( '1' '1' '32' '226053' '185536415' '185546755' '1' 
'3764977' 'protein_coding' 'KNOWN' 'test' ) [11 items] row1 at testdb.pl line 15
1 1 32 226053 185536415 185546755 1 3764977 protein_coding KNOWN test
    -> fetchrow_array for DBD::mysql::st (DBI::st=HASH(0x914bb0)~0x914af0) 
thr#504010
    -> dbd_st_fetch for 00914ce0, chopblanks 0
    <- dbd_st_fetch, 11 cols
    <- fetchrow_array= ( '2' '1' '32' '226053' '185538047' '185541942' '1' 
'3780981' 'protein_coding' 'KNOWN' undef ) [11 items] row2 at testdb.pl line 16
Use of uninitialized value in join or string at ./testdb.pl line 16.
2 1 32 226053 185538047 185541942 1 3780981 protein_coding KNOWN
    -> fetchrow_array for DBD::mysql::st (DBI::st=HASH(0x914bb0)~0x914af0) 
thr#504010
    -> dbd_st_fetch for 00914ce0, chopblanks 0

I seen in the documentation that inserting an uninitialized value will result 
in NULL (or whatever the default is), but shouldn't it return a string 'NULL'?

Any help will be appreciated.

Thanks

Mike

Reply via email to