  | | | Fix bind_param() bug in DBD-mysql-2.9008 | Fix bind_param() bug in DBD-mysql-2.9008 2005-06-21 - By Steve Hay
Back Hi all,
DBD-mysql-2 (See http://sql-2.ora-code.com).9007 introduced a fix for a bug that I had reported, in which non-numeric values bound to numeric types could break the SQL by placing arbitrary unquoted strings into the SQL.
However, the bug fix seems to have a problem of its own -- it prevents you from using the value "undef" in such places. AFAIK this use of "undef" is a perfectly valid way of setting the value of a numeric column to NULL, so should not be prevented from running.
Attached is a short test program that illustrates the problem. Using 2.9008 this outputs
ROW 1: 1, 1 DBD::mysql::st bind_param failed: Binding non-numeric field 1, value undef as a numeric! at C:\Temp\dbi.pl line 29.
Attached is also a patch against 2.9008 that fixes this. With the patch, the test program now correctly outputs
ROW 1: 1, 1 UPDATE affected 1 rows Use of uninitialized value in join or string at C:\Temp\dbi.pl line 38. ROW 1: 1,
A new release with this patch in place would be appreciated as this is quite an issue for me. My database code makes frequent use of NULL'ing numeric columns by this means, and is completely broken with the current release :-(
Cheers, - Steve
-- ---- ---- ---- ---- ---- ---- ---- ---- ----- Radan Computational Ltd.
The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.
-- MySQL Perl Mailing List For list archives: http://lists.mysql.com/perl To unsubscribe: http://lists.mysql.com/perl?unsub=mysql@(protected)
|
|
 |