Menu

#3031 (ok 3.3.3) Placement of AUTO_INCREMENT

3.2.3
fixed
Interface (555)
1
2013-06-11
2010-04-29
No

AUTO_INCREMENT is displayed in the "Extra" section of a table's "Structure" tab. Why is it not in the "Default" column? AUTO_INCREMENT (like standard SQL IDENTITY) cannot be specified along with the DEFAULT keyword anyway (and should not). Both don't make any sense together anyway. AUTO_INCREMENT clearly is a default when nothing else is specified. It should be in the "Default" column, though this might be new for many. It clearly belongs there.

If you don't change this, UPPER_CASE auto-increment in the current implementation please.

Discussion

  • Marc Delisle

    Marc Delisle - 2010-04-29
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2010-04-29

    It's not in the default column because MySQL itself does not consider this as being an information for default (see http://dev.mysql.com/doc/refman/5.1/en/show-columns.html\).

    There can be other information in Extra.
    Now the Extra information is uppercased.

     
  • Marc Delisle

    Marc Delisle - 2010-04-29
    • priority: 5 --> 1
    • summary: Placement of AUTO_INCREMENT --> (ok 3.3.3) Placement of AUTO_INCREMENT
    • status: open --> open-fixed
     
  • Arcadiy Fedushin

    I think that displaying next AUTO_INCREMENT value in "Default" column would be handy.
    To prevent mixing it up with real default values, phpMyAdmin can:
    - Display it in italic, as it displays NULL default values, and
    - Envelope it with angle brackets, f.e. <123>, and
    - Supply it with tooltip "Next AUTO_INCREMENT value".

     
  • Anonymous

    Anonymous - 2010-05-02

    Then the MySQL developer's analysis is wrong. Why do you rely on that?

    The MySQL Server does not allow concurrent declaration of DEFAULT and AUTO_INCREMENT. Try

    create table aitest
    (
    id integer not null default 1 auto_increment primary key,
    colcol integer
    )

    You either have to omit "default 1" OR auto_increment.

     
  • Marc Delisle

    Marc Delisle - 2010-05-02

    Why I rely on that? Because they are the developers of MySQL ...
    Also, AUTO_INCREMENT is a behavior of the primary key, not a default value. I understand your point, but in CREATE TABLE syntax, AUTO_INCREMENT is not specified as a default value.

     
  • Marc Delisle

    Marc Delisle - 2010-05-10
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed
     
MongoDB Logo MongoDB