Paul J Stevens schrieb:
John Fawcett wrote:
Uwe Kiewel wrote:
| Hi there,
|
| probably I found a missing index on table dbmail_aliases in dbmail-2.2.8.
|
| mysql> explain SELECT deliver_to FROM dbmail_aliases WHERE lower(alias)
| = lower('XXXXXXX') AND lower(alias) <> lower(deliver_to);
|

<snip>

I don't know why the lower function has been used. In mysql columns
~ are usually case insensitive unless you define them not to be or use a
case sensitive colation, so the query would work equally well without
lower(). Maybe in the other supported databases it is different
so they are there for compatibility.

Both the rules of brute force and clarity apply here. All email related
RFCs have it that aliases must never match case-sensitive - even if a
table or column is (accidentally) defined to use case-sensitive
matching. I've seen it happen on some older installations.

Dropping the lower function would require additional precautions in the
code.
I know. As I described in my initial posting, in that case you have to do the lower function in the program code before you pass the parameters to the query.


Uwe
_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to