SQL Redux

Martin Hepworth maxsec at TOTALISE.CO.UK
Thu Jul 31 10:56:36 IST 2003


Steve

it never works.

you must supply all the fields in the placeholders (nulls must be
explicitly specified). ie , , won't work, but ,NULL, will

I'll try and get the code change done this week. I'll forward on patch
file, if you can test on mysql 3.x we can then ask Julian to put it into
the next release.

--
Martin

Steve Freegard wrote:

> 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
> work??
>
> Kind regards,
> Steve.
>
> -----Original Message-----
> From: Martin Hepworth
> To: MAILSCANNER at JISCMAIL.AC.UK
> Sent: 31/07/03 09:34
> Subject: Re: SQL Redux
>
> Chris
>
> 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,, something) won't work as there is no entry for the fifth
> placeholder.
>
> 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.
>
> --
> Martin
>
> 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
>>DCC
>>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.
>
> I
>
>>have proven connectivity and permissions to the database and have
>
> tried
>
>>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
>
> not
>
>>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