Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: sacalvin [...] inet.polyu.edu.hk
Cc:
AdminCc:

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

Attachments
SQLite_solaris_opt.patch



Subject: Bus Error - core dumped when submitting aggregate functions AVG, SUM, not a problem with MIN, MAX, Count
Download (untitled) / with headers
text/plain 807b
DBD-SQLite 0.31 This is perl, v5.6.1 built for sun4-solaris SunOS hkpu07 5.8 Generic_108528-21 sun4u sparc SUNW,Ultra-Enterprise-10000 Dear Matt, I have been busy testing the newly installed DBD-SQLite module and got core dumped error everytime I use the SUM() or AVG() function. =========PART OF MY CODE =================== my $version= $dbh->{sqlite_version}; print "The SQLite lib version is $version\n"; ### Prepare a SQL statement for execution $sth = $dbh->prepare( "SELECT AVG(3.5)" ); ### Execute the statement in the database $sth->execute( ); ============================================ Please kindly let me know if it is not supported or I have to use create_aggregate_func (I guess not, because it is supported in the SQLite Core 2.8.12 THanks in advance Calvin
From: Geoff
Download (untitled) / with headers
text/plain 1.2k
[guest - Thu Feb 26 12:10:59 2004]: Show quoted text
> SunOS hkpu07 5.8 Generic_108528-21 sun4u sparc SUNW,Ultra-Enterprise- > 10000 > > Dear Matt, > > I have been busy testing the newly installed DBD-SQLite module and got > core dumped error everytime I use the SUM() or AVG() function. > > =========PART OF MY CODE =================== > my $version= $dbh->{sqlite_version}; > print "The SQLite lib version is $version\n"; > ### Prepare a SQL statement for execution > $sth = $dbh->prepare( "SELECT AVG(3.5)" ); > > ### Execute the statement in the database > $sth->execute( ); > ============================================ > > Please kindly let me know if it is not supported or I have to use > create_aggregate_func (I guess not, because it is supported in the > SQLite Core 2.8.12
It seems to be Solaris specific - a few people have mentioned this. Have you tried recompiling the module without optimization flags (lose the -O6)? Seems to stop this for me. I believe it's to do with the alignment of the aggregate counter returned from sqlite_aggregate_context. Not sure how or why it's getting misaligned though and I can't get sqlite (command line) to reproduce this any more, although it was doing so originally (grr)
From: david_dick [...] iprimus.com.au
Download (untitled) / with headers
text/plain 601b
Show quoted text
> It seems to be Solaris specific - a few people have mentioned this. > > Have you tried recompiling the module without optimization flags (lose > the -O6)? Seems to stop this for me. > > I believe it's to do with the alignment of the aggregate counter > returned from sqlite_aggregate_context. Not sure how or why it's > getting misaligned though and I can't get sqlite (command line) to > reproduce this any more, although it was doing so originally (grr) >
okay. The removing the -O6 flag worked for me as well, so this is a patch to not use the optimisation flags on solaris platforms.
diff -Naur DBD-SQLite-0.31/Makefile.PL new/Makefile.PL --- DBD-SQLite-0.31/Makefile.PL 2004-01-06 19:07:49.000000000 +1100 +++ new/Makefile.PL 2004-05-06 14:29:39.000000000 +1000 @@ -7,16 +7,25 @@ use Config; use strict; -WriteMakefile( +my (%opt) = ( 'NAME' => 'DBD::SQLite', 'VERSION_FROM' => 'lib/DBD/SQLite.pm', # finds $VERSION 'PREREQ_PM' => {DBI => 1.21}, # e.g., Module::Name => 1.1 'OBJECT' => '$(O_FILES)', 'INC' => '-I$(DBI_INSTARCH_DIR)', - 'OPTIMIZE' => "-O6 -DNDEBUG=1 -DSQLITE_PTR_SZ=$Config{ptrsize}", + 'OPTIMIZE' => "-DNDEBUG=1 -DSQLITE_PTR_SZ=$Config{ptrsize}", 'clean' => { FILES => 'SQLite.xsi config.h' }, ); +# Solaris seems to have trouble with the AVG and SUM when -O flag is specified. +# See http://rt.cpan.org/NoAuth/Bug.html?id=5464 for details. + +unless ($^O eq 'solaris') { + $opt{'OPTIMIZE'} = "-O6 $opt{'OPTIMIZE'}"; +} + +WriteMakefile(%opt); + package MY; sub postamble { DBI::DBD::dbd_postamble(@_);


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.