As long as we are dedicated to using sequences, we should change all auto-increment fields into integer fields in the database setup scripts. We occassionally rely on these auto-increment fields when we should not and this causes seldom noticed bugs in the application.

The current bug, which i will submit a patch for, is the access table. The INSERT into this table assumes auto-increment which is not available on all DBs. The INSERT succeeds, but later any delete will fail. Since delete of an access rule is very infrequent, this bug has not been noticed for a long long time.

Comments

killes@www.drop.org’s picture

I agree with Moshe. I will submit a patch to remove the field for the locale table.

moshe weitzman’s picture

The new profile tables use auto-increment instead of sequences.

killes@www.drop.org’s picture

I have found that auto-increment fields aren't neccessarily evil. The new locale.module uses them too for performance reasons.

moshe weitzman’s picture

of course they aren't evil. they's useful. but we, as a project, have to decide if we want to support DBs which don't provide sequences. if we don't care about this, we should be able to get rid of sequences table. this will require some code changes too, since we'll have to ask the DB what 'nid' was assigned on a new post (for example).

killes@www.drop.org’s picture

I admit my cluelessness: Which dbs do not have auto-increments?

I recall that there was somemajor discussion before introducing the sequences table. IIRC we wanted to be sure to get unique node IDs. The sequences mechanism achieves this by locking the table while with auto-increments it could happen that you would not be sure which ID you got. But this was a while ago and my memories might be fading.

killes@www.drop.org’s picture

Category: bug » feature

Supporting databases without autoincrement is IMHO a feature request.

moshe weitzman’s picture

Status: Active » Closed (duplicate)