remove all auto-increment fields

moshe weitzman - October 17, 2003 - 14:03
Project:Drupal
Version:x.y.z
Component:database system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

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.

#1

killes@www.drop.org - February 4, 2004 - 17:44

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

#2

moshe weitzman - July 22, 2004 - 14:46

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

#3

killes@www.drop.org - August 11, 2004 - 13:50

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

#4

moshe weitzman - August 11, 2004 - 14:08

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).

#5

killes@www.drop.org - August 11, 2004 - 14:43

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.

#6

killes@www.drop.org - October 8, 2004 - 17:29
Category:bug report» feature request

Supporting databases without autoincrement is IMHO a feature request.

#7

moshe weitzman - January 19, 2006 - 15:45
Status:active» duplicate

http://drupal.org/node/38585

 
 

Drupal is a registered trademark of Dries Buytaert.