I get this warning when I run a mysql database optimization command:
warning : Found row where the auto_increment column has the value 0
status : OK
This warning come at the users table and I am not sure whether it is not problematic for a drupal database. Mysql has this explanation for the warning:
This is not an error in itself, but
could cause trouble if you decide to
dump the table and restore it or do an
ALTER TABLE on the table. In this
case, the AUTO_INCREMENT column
changes value according to the rules
of AUTO_INCREMENT columns, which could
cause problems such as a duplicate-key
error.
A problem which may be pertinent to this warning is that whenever I try to block a user, I get a server times-out and the request does not take effect. I don’t know what query to run to pinpoint the row(s) where this occurs.
You can’t do anything about this in Drupal 6. UID 0 and 1 have a special meaning in Drupal and need to exist like that, although MySQL doesn’t like it (for good reasons). Because of these good reasons, this was fixed/changed in Drupal 7. Some background…
In Drupal 5 and older, the database layer didn’t use AUTO INCREMENET because of compatibility with other databases. All such id’s relied on
db_next_id()which had to be called manually before a new row was inserted.In Drupal 6, the Schema API was added (Allows to define the schema in PHP arrays and Drupal will then build the database specific create table etc. queries).
db_next_id()was removed and for a few tables (users and actions, mainly) some hackish workarounds were added. This however lead to problems (like not being able to easily export and import the table, as MySQL tells in the warning description).In Drupal 7,
db_next_id()was added again, explicitly for tables where a AUTO_INCREMENT (called ‘serial’ in the Drupal Schema API) doesn’t work well. the User Relationships project, which I maintain for Drupal 7, was doing something weird too with an auto_increment table (re-use of id’s to connect unidirectional relationships together) too, which I recently replaced with db_next_id(). So, if you maintain a custom or contrib module which does hack around AUTO INCREMENT, use db_next_id() in Drupal 7 instead!