Hi,
this is a followup on #48242
(https://rt.cpan.org/Public/Bug/Display.html?id=48242).
mysql_bind_type_guessing detects a value which consists of only a single
character (plus,minus,dot,e) as a number, resulting in an invalid mysql
statement.
Reproduce:
my $sth = $dbh->prepare('insert into test (test) values (?)');
$sth->execute(('+'));
$sth->execute(('.'));
$sth->execute(('-'));
$sth->execute(('e'));
Causes "syntax error near ')'" resp. " Unknown column 'e' in 'field list".
Reason: Parts of the patch to solve 48242 have been reverted later, see
github commits:
6e296abd - introduces "seen_digit"
1474dcb0 - removes the flag by commenting it
+ /* Not sure why this was changed */
+ /* seen_digit= 1; */
+ /* Need to revisit this */
+ /*if (len == 0 || cp - string < (int) len || seen_digit == 0) {*/
+ if (len == 0 || cp - string < (int) len) {
I did not have a full view on the code, but reactivating these lines
SHOULD fix the issue without any side effects.
Oliver
--
Protect your environment - close windows and adopt a penguin!
Migrated from rt.cpan.org#97541 (status was 'new')
Requestors:
Attachments:
From mail@oliwel.de on 2014-07-27 11:10:54: