Skip Menu |
 

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

Report information
The Basics
Id: 62458
Status: new
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: yael.elan [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 4.013
  • 4.014
  • 4.015
  • 4.016
  • 4.017
Fixed in: (no value)



Subject: mysql_bind_type_guessing broken for strings on update
Download (untitled) / with headers
text/plain 182b
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
Subject: bind_type_guessing.diff
--- t/51bind_type_guessing.t.orig 2010-10-26 12:19:43.000000000 +0200 +++ t/51bind_type_guessing.t 2010-10-26 14:08:41.000000000 +0200 @@ -18,7 +18,7 @@ plan skip_all => "ERROR: $DBI::errstr. Can't continue test"; } -plan tests => 25; +plan tests => 34; ok $dbh->do("DROP TABLE IF EXISTS $table"), "drop table if exists $table"; @@ -82,4 +82,23 @@ ok $rows= $sth3->execute(' 1'); $sth3->finish(); +my $original_string = '123456e1'; +ok $sth3= $dbh->do("insert into $table (str, num) values (?, ?)", undef, $original_string, 9); +ok $sth3= $dbh->prepare("select * from $table where num = ?"); +ok $rows= $sth3->execute(9); +my ($str, $num) = $sth3->fetchrow_array; +is $str, $original_string, 'insert'; +$sth3->finish(); + +my $sth4; +ok $sth4= $dbh->prepare("update $table set str = ?, num = ?"); +ok $rows= $sth4->execute($original_string, '9'); +$sth4->finish(); + +ok $sth4= $dbh->prepare("select * from $table where num = ?"); +ok $rows= $sth4->execute(9); +($str, $num) = $sth4->fetchrow_array; +is $str, $original_string, 'update'; +$sth4->finish(); + ok $dbh->disconnect;


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.