Skip Menu |
 

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

Report information
The Basics
Id: 1717
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: tjmather [...] maxmind.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.1020
Fixed in: (no value)



Subject: Placeholders broken with mixed Integer/String usage
Download (untitled) / with headers
text/plain 1018b
I've had some problems using DBD::mysql 2.1020 with Apache::Session which took me a while to track down. The problem is that if a placeholder is "primed" using an integer-type value, and then later used with a string, the placeholder expansion is broken. For more details see: http://marc.theaimsgroup.com/?l=msql-mysql-modules&m=103014432822561&w=2 For example if I run: #!/usr/bin/perl use DBD::mysql; my $dbh = DBI->connect("dbi:mysql:test", undef, undef); $dbh->do("DROP TABLE IF EXISTS test"); $dbh->do("CREATE TABLE test ( content varchar(255) )"); my $sql_str = "INSERT INTO test SET content = ?"; my $sth = $dbh->prepare($sql_str); $sth->execute(1); $sth->execute("foo"); I get DBD::mysql::st execute failed: Unknown column 'foo' in 'field list' at dbd_mysql.pl line 9. The workaround is to replace the first execute statement with $sth->execute("1"); Please let me know if you would like a patch for the code, or a documentation patch to add this to the "Known Problems" section of the POD. Thanks, TJ


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.