DBD-mysql icon indicating copy to clipboard operation
DBD-mysql copied to clipboard

mysql_bind_type_guessing broken for strings on update [rt.cpan.org #62458]

Open mbeijen opened this issue 8 years ago • 0 comments
trafficstars

Migrated from rt.cpan.org#62458 (status was 'open')

Requestors:

Attachments:

From [email protected] on 2010-10-26 12:22:49:

when mysql_bind_type_guessing attribute is turned on, strings containing
'e' may be cast as numbers on sql update. (insert works as expected).
test is attached.
perl 5.8.8
suse linux

From [email protected] on 2015-05-26 17:11:10:

Making matters worse, dates in the format "2015-05-10" count as numeric. 

CentOS 6
DBD::mysql 4.027
perl 5.10.1

From [email protected] on 2015-05-26 20:42:57:

Included patch does the following:
  - rename parse_number to is_number
  - fixes is_number so it more closesly follows what MySQL expects
  - exposes it as DBD::mysql::_is_number
  - adds a test for all sorts of valid and invalid numbers

Note that this patch still thinks the string "12345e6" is a number.  Debate could go either way on whether it should be one or not.  The argument against is that the string "12e3" is the number 12 in Perl, not 12000 as it is in MySQL.

mbeijen avatar Nov 15 '17 07:11 mbeijen