Skip Menu |

This queue is for tickets about the DBD-CSV CPAN distribution.

Report information
The Basics
Id: 18477
Status: resolved
Priority: 0/
Queue: DBD-CSV

People
Owner: Nobody in particular
Requestors: mark.hackett [...] metoffice.gov.uk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.22
Fixed in: (no value)



Subject: use of prepare/execute with placeholders fails
I have a program that works with the following system components: perl-DBI-1.32-5 Text::CSV version 0.2002 (from the CSV.pm file) Yet it doesn' work with: perl-DBI-1.40-8 perl-Text-CSV_XS-0.23-1.1.fc3.rf perl-DBD-CSV-0.22-1.1.fc3.rf (RedHat9 with additions and FC3 stock, I believe). The command is: $select_command="select SEGNO, OWNER, TYPE, NAMESPACE, EXPERIMENT, STREAM, UPDATED, SIZE from $stream_tbl where NAMESPACE=? AND EXPERIMENT LIKE ? AND STREAM LIKE ?"; $select=$db->prepare($select_command); $select->execute(); However, if I change the last placeholder in the select_command string to a non placeholder, it works. I have tried changing the order of placeholders and it is the last one. I am currently off to find a simpler program that will show this up, but that might take a while, and if there is a known problem with the combination of modules I am using, then let me know. Ta.
I have closed this bug, as I do not have enough data to reproduce the error. $ cat sandbox/rt18477.csv segno,owner,type,namespace,experiment,stream,updated,size 14,root,bug,RT,"not really",fast,20090501,42 $ cat sandbox/rt18477.pl #!/pro/bin/perl use strict; use warnings; use Cwd; use DBI; (my $dir = getcwd) =~ s{(/sandbox)?/?$}{/sandbox}; my $dbh = DBI->connect ("dbi:CSV:", "", "", { dbd_verbose => 9, f_dir => $dir, f_ext => ".csv", }) or die "Cannot connect: $DBI::errstr\n"; my $sth = $dbh->prepare ("select * from rt18477") or die $dbh->errstr; $sth->execute or die $sth->errstr; my $rth = $dbh->prepare (qq; select SEGNO, OWNER, TYPE, NAMESPACE, EXPERIMENT, STREAM, UPDATED, SIZE from rt18477 where NAMESPACE = ? and EXPERIMENT LIKE ? and STREAM LIKE ? ;) or die $dbh->errstr; $rth->execute ("RT", "%", "%") or die $rth->errstr; while (my $row = $rth->fetch) { print "(@$row)\n"; } $ perl -Ilib sandbox/rt18477.pl (14 root bug RT not really fast 20090501 42) $