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.

Cheers,
Steve.


-----Original Message-----
From: Martin Hepworth
To: Steve Freegard
Cc: 'MAILSCANNER at JISCMAIL.AC.UK '
Sent: 31/07/03 14:24
Subject: Re: SQL Redux


Steve

ok I got code to look like

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

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

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

   # 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,
$insmessage->{
id}, $insmessage->{size}, $insmessage->{from}, $insmessage->{to},
$insmessage->{subject}, $insmessage->{clientip}, $aplaces,
$insmessage->{isspam}
, $insmessage->{ishigh}, $insmessage->{issaspam},
$insmessage->{isrblspam}, $ins
message->{spamwhitelisted}, $insmessage->{sascore}, $myspamreport,
$insmessage->
{virusinfected}, $insmessage->{nameinfected},
$insmessage->{otherinfected}, $rep
orts, $hostname);
   $sth->execute(
    $timestamp,
    $dbh->quote($insmessage->{id}),
    $insmessage->{size},
    $dbh->quote($insmessage->{from}),
    $dbh->quote($insmessage->{to}),
    $dbh->quote($insmessage->{subject}),
    $dbh->quote($insmessage->{clientip}),
    $dbh->quote($aplaces),
    $insmessage->{isspam},
    $insmessage->{ishigh},
    $insmessage->{issaspam},
    $insmessage->{isrblspam},
    $insmessage->{spamwhitelisted},
    $insmessage->{sascore},
    $dbh->quote($myspamreport),
    $insmessage->{virusinfected},
    $insmessage->{nameinfected},
    $insmessage->{otherinfected},
    $dbh->quote($reports),
    $dbh->quote($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, 127.0.0.1, NULL, 0, 0, 1, 1, 0, 0, NULL, 0, 0, 0, NULL,
soloman.solid-state-logic.com
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..

--
martin


--
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