SQL Redux

Steve Freegard steve.freegard at LBSLTD.CO.UK
Thu Jul 31 15:32:11 IST 2003

Hey Martin,

That error message looks like the MySQL server is barfing at the data coming
in (which does look okay from the log).  Can you try again - when you get
the 'Gone away' message in the logs, run 'mysqladmin version' and check the
server uptime to make sure that it isn't crashing out.

Have a look at http://www.mysql.com/doc/en/Gone_away.html to see if any of
the solutions posted there work for you.


-----Original Message-----
From: Martin Hepworth
To: Steve Freegard
Sent: 31/07/03 14:24
Subject: Re: SQL Redux


ok I got code to look like

   # Sanitize reports
   my($reports) = map { ($_ eq '')?'NULL':"$_" } join(' ',
   my($aplaces) = map { ($_ eq '')?'NULL':"$_" } join(',',
   my($myspamreport) = map { ($_ eq '')?'NULL':"$_" } $spamreport;

   my($insmessage) = $message;
$insmessage->{to} = map { ($_ eq '')?'NULL':"$_" }
   $insmessage->{subject} = map { ($_ eq '')?'NULL':"$_" }
   $insmessage->{issaspam} = map { ($_ eq '')?'NULL':"$_" }

   $insmessage->{isrblspam} = map { ($_ eq '')?'NULL':"$_" }

   # Insert the data
   MailScanner::Log::WarnLog("trying to insert row:  %s, %s, %s, %s, %s,

%s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s",  $timestamp,
id}, $insmessage->{size}, $insmessage->{from}, $insmessage->{to},
$insmessage->{subject}, $insmessage->{clientip}, $aplaces,
, $insmessage->{ishigh}, $insmessage->{issaspam},
$insmessage->{isrblspam}, $ins
message->{spamwhitelisted}, $insmessage->{sascore}, $myspamreport,
{virusinfected}, $insmessage->{nameinfected},
$insmessage->{otherinfected}, $rep
orts, $hostname);
   or MailScanner::Log::WarnLog("Cannot insert row: %s", $DBI::errstr);

and it's still not inserting in the DB..maillog says...

Jul 31 14:17:02 soloman MailScanner[61293]: trying to insert row:
2003-07-31 14:17:02, h6VDGvXL061292, 1060,
martinh at soloman.solid-state-logic.com, martinh at solid-state-logic.com,
test7,, NULL, 0, 0, 1, 1, 0, 0, NULL, 0, 0, 0, NULL,
Jul 31 14:17:02 soloman MailScanner[61293]: Cannot insert row: MySQL
server has gone away

Anybody any clues - my perl isn't great so..


This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender and delete the message from your mailbox.

This footnote also confirms that this email message has been swept by
MailScanner (www.mailscanner.info) for the presence of computer viruses.

More information about the MailScanner mailing list