SQL Redux

Steve Freegard steve.freegard at LBSLTD.CO.UK
Thu Jul 31 10:45:52 IST 2003

Hi Martin/Chris,

I'm on a Cognos course this week so I haven't had much chance to check my
e-mail this week.

However I've just had a thought as to what could be causing this - are you
both running MySQL v4.x by any chance??

I'm running MySQL v3.x that comes with RH9 on both of my production boxes
and haven't seen this problem so far, so it could be a change in behaviour
with v4.

Does this happen intermittently (if so, which fields) or does it never

Kind regards,

-----Original Message-----
From: Martin Hepworth
Sent: 31/07/03 09:34
Subject: Re: SQL Redux


this is exactly the problem I'm seeing with 4.22.5 on FreeBSD.

It seems that mysql won't insert default values if there's a NULL value
in the placeholder. ie insert into maillog values (something, somthing,
something,, something) won't work as there is no entry for the fifth

I'm working on an ugly hack to the whole SQL logging routine that checks
each variable to make sure it's not NULL and builds the insert SQL
statement on the fly with the correct number of place holders etc. ie
the statement will become..

insert into maillog set (time, messageid, mailfrom) values (sometime,
somemessageid, somemailfrom)

rather than trying to insert everything via the current query.

I've got a rough code outline for this, just need to find a couple of
hours to implement and test.


Chris Trudeau wrote:

> All,
> I have an installed implementation (in test) that looks like this:
> Redhat 9.0
> MailScanner 4.22.1 (couldn't get 4.22.5 running, so I backed out a
couple of
> versions)
> SA 2.55
> Razor2
> MailWatch for MailScanner (for SQL logging and front-end PHP)
> It works beautifully.
> So I installed on 7.3 (because of MANY other RH9.0 issues)
> MailScanner 4.22.5 (runs fine)
> SA 2.55
> DCC and Razor2
> MailWatch for MailScanner
> to try and prove my implementation.  After MUCH troubleshooting, I
have a
> working implementation that does everything but write to the database.
> have proven connectivity and permissions to the database and have
> running it locally and consistently get the same error:
> Jul 29 05:50:47 mta01 MailScanner[10505]: Cannot insert row:
> The message processes acurately and is delivered or not according to
> rules...it works GREAT...but I need the db logging to work...and I'm
> sure which way to look...any help is appreciated.
> CT

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