List:MySQL and Perl« Previous MessageNext Message »
From:Jochen Wiedmann Date:December 7 2000 2:59pm
Subject:Re: [Patch] bindparam.h ParseParam() doesn't differentiate
Numerical/String values correctly for quoting
View as plain text  

"Philippe M . Chiasson" wrote:

> Attached is a small patch to bindparam.h that inverts the logic of the check...
> 
> SvNIOK(ph->value) ? SQL_INTEGER : SQL_VARCHAR;
> 
> checks if it's a number, otherwise assume it's a string.  I replaced it with
> 
> SvPOK(ph->value) ? SQL_VARCHAR : SQL_INTEGER
> 
> checks if it's a string, otherwise assume it's a number.  I tested it and it fixes my
> problem.

Hmmm, I do not like this one. For example, there are so many
Perl objects that are no strings, but numbers...

The better way would be, IMO, to fix SvNIOK not to return TRUE for
"Needs::Quotes". This is a problem of the Perl 5 porters.


Sorry,

Jochen
Thread
[Patch] bindparam.h ParseParam() doesn't differentiate Numerical/String values correctly for quotingPhilippe M . Chiasson5 Dec
  • Re: [Patch] bindparam.h ParseParam() doesn't differentiate Numerical/String values correctly for quotingJochen Wiedmann7 Dec