Skip Menu |
 

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

Report information
The Basics
Id: 77617
Status: resolved
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: HMBRAND [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.36_04
Fixed in: (no value)



Subject: atoll () sometimes just is atol ()
Download (untitled) / with headers
text/plain 399b
On all HP-UX PA-RISC2 with 64bit gcc (separate compiler needed for 64bit and 32bit), atol () implicitely *is* atoll () and the latter is not available On these systems, I added #define atoll(a) atol(a) and all tests passed FWIW I also saw this on one of my Itanium2 boxes, whcih is more weird, as those have just one GNU gcc for bot 32bit and 64bit. The *other* Itanium2 bos did not complain
I also see a failure because of missing atoll() for our 64-bit HP-UX builds using the ANSI-C compiler (HP92453-01 B.11.X.35098-35101.GP HP C Compiler), both on PA-RISC2.0 and IA64, after upgrading from DBD-SQLite v1.35 to v1.37.
 Perl already has a HAS_ATOLL set up, so this could probably also be addressed with:

[gisle@perl-linux-vm DBD-SQLite-1.37]$ git diff
diff --git a/dbdimp.c b/dbdimp.c
index 3e17302..4fac632 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -230,7 +230,11 @@ sqlite_is_number(pTHX_ const char *v, int sql_type)
 
     if (maybe_int || sql_type == SQLITE_INTEGER) {
 #if defined(USE_64_BIT_INT)
+  #if defined(HAS_ATOLL)
         if (strEQ(form((has_plus ? "+%lli" : "%lli"), atoll(v)), v)) return 1;
+  #else
+        if (strEQ(form((has_plus ? "+%li" : "%li"), atol(v)), v)) return 1;
+  #endif
 #else
         if (strEQ(form((has_plus ? "+%i" : "%i"), atoi(v)), v)) return 1;
 #endif
@@ -701,7 +705,11 @@ sqlite_st_execute(SV *sth, imp_sth_t *imp_sth)
 
             if (numtype == 1) {
 #if defined(USE_64_BIT_INT)
+  #if defined(HAS_ATOLL)
                 rc = sqlite3_bind_int64(imp_sth->stmt, i+1, atoll(data));
+  #else
+                rc = sqlite3_bind_int64(imp_sth->stmt, i+1, atol(data));
+  #endif
 #else
                 rc = sqlite3_bind_int(imp_sth->stmt, i+1, atoi(data));
 #endif
Applied this patch to the trunk. Thanks. On Wed Aug 08 07:01:52 2012, GAAS wrote: Show quoted text
> Perl already has a HAS_ATOLL set up, so this could probably also be > addressed > with: > > [gisle@perl-linux-vm DBD-SQLite-1.37]$ git diffdiff --git a/dbdimp.c > b/dbdimp.cindex > 3e17302..4fac632 100644--- a/dbdimp.c+++ b/dbdimp.c@@ -230,7 +230,11 > @@ > sqlite_is_number(pTHX_ const char *v, int sql_type) if (maybe_int || > sql_type > == SQLITE_INTEGER) { #if defined(USE_64_BIT_INT)+ #if > defined(HAS_ATOLL) if > (strEQ(form((has_plus ? "+%lli" : "%lli"), atoll(v)), v)) return 1;+ > #else+ if > (strEQ(form((has_plus ? "+%li" : "%li"), atol(v)), v)) return 1;+ > #endif #else > if (strEQ(form((has_plus ? "+%i" : "%i"), atoi(v)), v)) return 1; > #endif@@ > -701,7 +705,11 @@ sqlite_st_execute(SV *sth, imp_sth_t *imp_sth) if > (numtype == > 1) { #if defined(USE_64_BIT_INT)+ #if defined(HAS_ATOLL) rc = > sqlite3_bind_int64(imp_sth->stmt, i+1, atoll(data));+ #else+ rc = > sqlite3_bind_int64(imp_sth->stmt, i+1, atol(data));+ #endif #else rc = > sqlite3_bind_int(imp_sth->stmt, i+1, atoi(data)); #endif
Download (untitled) / with headers
text/plain 1.2k
DBD::SQLite 1.38_01 with this fix is released. Thanks. On Wed Aug 08 13:30:00 2012, ISHIGAKI wrote: Show quoted text
> Applied this patch to the trunk. Thanks. > > On Wed Aug 08 07:01:52 2012, GAAS wrote:
> > Perl already has a HAS_ATOLL set up, so this could probably also be > > addressed > > with: > > > > [gisle@perl-linux-vm DBD-SQLite-1.37]$ git diffdiff --git a/dbdimp.c > > b/dbdimp.cindex > > 3e17302..4fac632 100644--- a/dbdimp.c+++ b/dbdimp.c@@ -230,7 +230,11 > > @@ > > sqlite_is_number(pTHX_ const char *v, int sql_type) if (maybe_int || > > sql_type > > == SQLITE_INTEGER) { #if defined(USE_64_BIT_INT)+ #if > > defined(HAS_ATOLL) if > > (strEQ(form((has_plus ? "+%lli" : "%lli"), atoll(v)), v)) return 1;+ > > #else+ if > > (strEQ(form((has_plus ? "+%li" : "%li"), atol(v)), v)) return 1;+ > > #endif #else > > if (strEQ(form((has_plus ? "+%i" : "%i"), atoi(v)), v)) return 1; > > #endif@@ > > -701,7 +705,11 @@ sqlite_st_execute(SV *sth, imp_sth_t *imp_sth) if > > (numtype == > > 1) { #if defined(USE_64_BIT_INT)+ #if defined(HAS_ATOLL) rc = > > sqlite3_bind_int64(imp_sth->stmt, i+1, atoll(data));+ #else+ rc = > > sqlite3_bind_int64(imp_sth->stmt, i+1, atol(data));+ #endif #else
rc = Show quoted text
> > sqlite3_bind_int(imp_sth->stmt, i+1, atoi(data)); #endif
> >


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.