Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL++ - Programming with the C++ API to MySQL
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
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
Reply:     1     2  

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)