Hi Jochen,
Hi DBI developers,

I encountered a strange bug in DBD::mysql with parameter binding. If I 
use an arithmetic operator (e.g. > ) on a string value just before using
$dbh->prepare/execute, DBD::mysql guesses a numeric data type for this 
variable and omits the surrounding apostrophs, which naturally results 
in a MySQL syntax error. DBI->do works without problems in this case, 
only prepare/execute fails.

The attached example program should reproduce the bug.

I tested this with Perl 5.00503/5.6.1 and DBD::mysql 2.0419 and DBI 1.21
(using MySQL 3.23.49), and with Perl 5.6.1 and the latest DBD::mysql 
2.1017 and DBI 1.20 (using MySQL 3.23.46).

I also checked the program with DBD::Oracle and it worked, so I think 
this is a DBD::mysql issue.

Regards,

Joern

-- 
Joern Reder -- Software Development,  dimedis GmbH, 50672 Koeln
               http://www.dimedis.de/
supporting:    http://www.zyn.de/ http://www.exit1.org/
CPAN:          http://www.perl.com/CPAN/modules/by-module/CIPP/JRED/

Attachment: mysql_test.pl
Description: Binary data

Reply via email to