Aaron Stone wrote:
A few weeks ago, while Ilja and I were working on integrating my LMTP and Sorting patch, I asked Ilja what he thought about reserving user id numbers 1-10 or 1-100 (or 1-9 or 1-99, ie all single or double digits, whatever) for system accounts. There are some interesting uses for reserved accounts, particularly with foreign key constraints. Lost mail, unowned shared mailboxes, stuff like that. At the time we figured that minimal rocking of the boat was in order while my patch was going in, since we wanted people to begin testing it right away.

So I'll share the idea with the mailing list: shall reserve a range of user id numbers? Will this be too difficult to migrate? Would you be comfortable using a script that renumbered some of your lower-numbered of users?

Aaron

Well, this is probably wrong for some reason I can't understand, but isn't the user_idnr field a signed integer?
What about reserving negative numbers for system accounts?

Magnus




""Christian G. Warden"" <[EMAIL PROTECTED]> said:


On Sat, Jan 31, 2004 at 09:32:29PM -0000, Aaron Stone wrote:

The new delivery chain requires a temporary account with the fixed user id
number 0. The next release candidate should probably include an appropriate
insert/update to add this user (note that it needs to be an insert and then an
update, because the insert alone with '0' triggers the auto_increment.

INSERT INTO users (user_idnr, userid, passwd) VALUES (0, '*', '*');
UPDATE userid SET user_idnr = 0 WHERE username = '*';

We should consider using something else besides user_idnr = 0, for this
special account.  Perhaps, username = 'delivery' (or whatever) and
client_id = 0, or even a special boolean column just for this user.

Using user_idnr=0 has some unfortanate side-effects with mysql.  If
you're joining between aliases and users on deliver_to = user_indr,
mysql considers 0 equal to any string, e.g.
SELECT
 IF (u.user_idnr IS NULL, a.deliver_to, u.userid) AS recipient
FROM
 aliases a
LEFT JOIN
 users u
ON
 u.user_idnr = a.deliver_to
WHERE
 a.alias = "[EMAIL PROTECTED]"

Also, when altering the table, you can run into key violations as mysql
helpfully tries to replace the 0.

xn
_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev








Reply via email to