[tpop3d-discuss] MySQL Authentication

Paul Makepeace Paul.Makepeace at realprogrammers.com
Tue, 26 Jun 2001 20:00:53 -0700


On Tue, Jun 26, 2001 at 08:26:24PM +0100, Chris Lightfoot wrote:
> On Tue, Jun 26, 2001 at 12:17:25PM -0700, Paul Makepeace wrote:
> Well... that _is_ all it's doing, in the
> everything's-a-database model of mailboxes. I note that
> there are people (for instance, those wacky folks at Ars
> Digita) who store mailboxes in relational databases. This
> would be a fairly simple hack to tpop3d, though I can't
> see much purpose for it.

Avoidance of locking issues, flexibility in retrieval, advanced
statistical processing (e.g. for lists or billing), integration into
existing backup/recovery schemes (i.e. if you're backing up a related
system you get that "for free").

I wonder if it could return a list of messages more quickly than a
directory scan `a la Maildir... Certainly it could be mapped to fulfill
IMAP semantics more directly. (Not that relevant to a popd discussion
admittedly :-)

> Could you not do the prepare-bind stuff automatically;
> that is, when you first see
> 
>     SELECT foo FROM bar WHERE baz = ${quux}
> 
> identify that you need to treat ${quux} as an insertion
> variable and prepare
> 
>     SELECT foo FROM bar WHERE baz = ?

IIUYC, You'd have to have some knowledge of SQL. For example, how do you
cope with,

SELECT ${column} FROM ${table} WHERE ${sql_condition}

Only variables in conditions can be bound so the ${column} and ${table}
couldn't be bound (but you'd have to have an SQL parser to divine those
particular variables) and further you'd have to recursively perform this
parsing if ${sql_condition} expanded to "${table_abbrev}.${column} =
${some_value}".

> then save these, and use the right one when it comes up?

Also, (at least with exim) you have the query in the query string, e.g,
        domains = ${lookup mysql {"SELECT ..."}{$value}}

so you'd still need (with auto-preparation/binding) some additional
syntax to specify what the bound variable is to be set _to_.

> OOI, how expensive is setting up a connection to the
> Oracle client library?

I don't know, but anecdotally I get the impression it would be a big
part of a single query. (Which is part of the win with mod_perl and its
retention of an open db handle.)

> > It seems that exim's had a feature freeze with v3.30 so that's either a
> > good thing or a bad thing depending on how long v4.0 takes to ship. Oh
> > well.
> 
> Interesting. I didn't know that....

http://www.exim.org/pipermail/exim-announce/2001q2/000036.html

Paul

-- 
Change nothing and continue consistently