Skip Menu |

This queue is for tickets about the SQL-Statement CPAN distribution.

Report information
The Basics
Id: 30590
Status: resolved
Priority: 0/
Queue: SQL-Statement

People
Owner: Nobody in particular
Requestors: kgorlen [...] mail.nih.gov
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: "Malick, Robert (NIH/CIT) [E]" <rmalick [...] mail.nih.gov>
Subject: Bug in SQL::Statement::is_number()
Date: Thu, 8 Nov 2007 16:23:14 -0500
To: <bug-SQL-Statement [...] rt.cpan.org>
From: "Gorlen, Keith (NIH/CIT) [C]" <kgorlen [...] mail.nih.gov>
DBI::looks_like_number(@array) returns a list, not a scalar, as assumed by SQL::Statement::is_number(), resulting in "Argument <blah> isn't numeric in numeric comparison (<=>) at Statement.pm line 972" errors. To fix, I defined as: sub is_number { for my $x(@_) { return 0 if !defined $x; return 0 if $HAS_DBI && DBI::looks_like_number($x); return 0 if $x !~ $numexp; } return 1; }; Thanks, --- Keith Gorlen (Contractor) Center for Information Technology, National Institutes of Health Phone: 415-563-3083 (San Francisco), Email: kg2d@nih.gov
CC: "Malick, Robert (NIH/CIT) [E]" <rmalick [...] mail.nih.gov>
Subject: RE: [rt.cpan.org #30590] AutoReply: Bug in SQL::Statement::is_number()
Date: Thu, 8 Nov 2007 16:45:48 -0500
To: <bug-SQL-Statement [...] rt.cpan.org>
From: "Gorlen, Keith (NIH/CIT) [C]" <kgorlen [...] mail.nih.gov>
Forgot to mention, this applies to SQL-Statement-1.15 with ActiveState Perl 5.8.8 on Windows XP/SP2. [Keith Gorlen (Contractor)] Show quoted text
> -----Original Message----- > From: Bugs in SQL-Statement via RT > [mailto:bug-SQL-Statement@rt.cpan.org] > Sent: Thursday, November 08, 2007 1:24 PM > To: Gorlen, Keith (NIH/CIT) [C] > Subject: [rt.cpan.org #30590] AutoReply: Bug in > SQL::Statement::is_number() > > > Greetings, > > This message has been automatically generated in response to > the creation of a trouble ticket regarding: > "Bug in SQL::Statement::is_number()", > a summary of which appears below. > > There is no need to reply to this message right now. Your > ticket has been assigned an ID of [rt.cpan.org #30590]. Your > ticket is accessible on the web at: > > http://rt.cpan.org/Ticket/Display.html?id=30590 > > Please include the string: > > [rt.cpan.org #30590] > > in the subject line of all future correspondence about this > issue. To do so, you may reply to this message. > > Thank you, > bug-SQL-Statement@rt.cpan.org > > -------------------------------------------------------------- > ----------- > DBI::looks_like_number(@array) returns a list, not a scalar, > as assumed by SQL::Statement::is_number(), resulting in > "Argument <blah> isn't numeric in numeric comparison (<=>) at > Statement.pm line 972" errors. > To fix, I defined as: > > sub is_number { > for my $x(@_) { > return 0 if !defined $x; > return 0 if $HAS_DBI && DBI::looks_like_number($x); > return 0 if $x !~ $numexp; > } > return 1; > }; > > Thanks, > --- > Keith Gorlen (Contractor) > Center for Information Technology, National Institutes of Health > Phone: 415-563-3083 (San Francisco), Email: kg2d@nih.gov > > > >
SQL::Statement 1.16_02 will use Scalar::Util::looks_like_number - this resolves the circular dependency to DBI and the calling convention conflict for DBI::looks_like_number.