Skip to Content.
Sympa Menu

en - Re: [sympa-users] Sympa process dieing

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: "Stefan Hornburg (Racke)" <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-users] Sympa process dieing
  • Date: Tue, 10 Jan 2017 09:58:09 +0100

On 01/10/2017 09:21 AM, Glen Eustace wrote:
>
>> On 10/01/2017, at 8:24 PM, Stefan Hornburg (Racke) <address@concealed
>> <mailto:address@concealed>> wrote:
>>
>> that looks weird - what is the code at that line in Database.pm?
>
> sub do_query {
> my $self = shift;
> my $query = shift;
> my @params = @_;
>
> my $sth;
>
> $query =~ s/^\s+//;
> $query =~ s/\s+$//;
> my $statement = sprintf $query, @params;
>
> my $s = $statement;
> $s =~ s/\n\s*/ /g;
> $log->syslog('debug3', 'Will perform query "%s"', $s);
>
>
> My Googling would suggest that the sprint is doing something with an
> aliased variable but I am no perl expert and it looks fine to me.
>
> NB: This is unadulterated sympa and perl 5.24

Yeah, it looks like the query contains characters with a special meaning
to sprintf, e.g. the percent sign.

Maybe you can wrap it in an eval to find out which query and params
cause this error:

my $statement;

eval {
$statement = sprintf $query, @params;
};

use Data::Dumper;

if ($@) {
$log->syslog('error',
"Query $query, params " . Dumper(\@params))
die "Bad query: @_";
}

Disclaimer: code not tested.

Regards
Racke

>
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Glen Eustace,
> GodZone Internet Services, a division of AGRE Enterprises Ltd.,
> P.O. Box 8020, Palmerston North, New Zealand 4446
> Ph +64 6 357 8168, Mob +64 27 542 4015
>
> “Specialising in providing low-cost professional Internet Services since
> 1997"
>
>


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration.




Archive powered by MHonArc 2.6.19+.

Top of Page