Re: [exim] Using MySQL Stored Procedures in Exim

Top Page
Delete this message
Reply to this message
Author: Mark Moseley
Date:  
To: EXIM mailing list
Old-Topics: [exim] Using MySQL Stored Procedures in Exim
Subject: Re: [exim] Using MySQL Stored Procedures in Exim
On 11/24/06, Mark Moseley <moseleymark@???> wrote:
>
> Apologies if I missed a documented answer for this when I was looking from
> the spec and google.
>
> I'm curious if anyone has had any experience using MySQL stored procedures
> with Exim? Specifically, is there any way to get to use the "CALL
> ProcName()" syntax in lookups without having to change the last arg in
> mysql_real_connect() in src/lookups/mysql.c? And if that is the only way
> (the only way I've found so far), does anybody have any stability issues to
> report that might be due to that hack?
>
> If one changes the last arg in mysql_real_connect() call in
> src/lookups/mysql.c from 0 to CLIENT_MULTI_STATEMENTS, the CALL syntax
> works. Without that change, any attempt to call a stored procedure, gets the
> "can't return a result set in the given context" response (if you've tried
> using stored procs with perl and an old version of DBD::mysql, this will
> look familiar).
>
> With that change in place, mysql lookups in general seem to be working
> normally. I've got pretty rudimentary C knowledge, so my fear is that
> there's some other can of worms I might be opening by changing that last arg
> that might not be readily apparent.
>
> And, yes, I know PostgreSQL has stored procedures that probably work fine
> in Exim ;) No need to preach to the choir, plus there's no chance of
> changing the db backend any time soon.
>



Nobody bit, so I thought I'd post an answer to my own question ;)

So far so good. I've been running a couple of high volume servers with that
change for a month or so and recently switched all of our other mail servers
to it about a week ago. I haven't seen any side effects yet, though that's
without actually running any stored procedures. I've been running a couple
of servers for about a week now with a config that uses stored procedures
and haven't seen any side effect there either. I'll post more results after
more testing. It's pretty darn cool so far though.

If anybody's doing anything similar with Exim and MySQL+stored procedures,
I'd love to hear about it.