Menu

#1226 Problem with create table

Upstream
nobody
None
Defect
2009-06-17
2009-06-16
Anonymous
No

Originally created by: aaaaa.sa...@gmail.com

What exact steps will reproduce the problem?
1. Create new table.
2. Add new column with autoincrement.
3. Save.

What was the expected output?
New column.

What happened instead?
CREATE TABLE `test` (  `idTest` INT(10) NOT NULL AUTO_INCREMENT ) COLLATE =
utf8_polish_ci ENGINE = MyISAM ROW_FORMAT = DEFAULT  ;
/* SQL Error: Incorrect table definition; there can be only one auto column
and it must be defined as a key */

Suggested fix (optional)?

Version used?
HeidiSQL revision: 4.0 R. 2490
MySQL Server version: 5.0.45
Operating system: Windows XP

Discussion

  • Anonymous

    Anonymous - 2009-06-16

    Originally posted by: a...@anse.de

    This is intentionally left to the user to fix. You must create a primary key on that
    column in the "Index" tab.

    Status: WontFix

     
  • Anonymous

    Anonymous - 2009-06-17

    Originally posted by: rosenfie...@gmail.com

    Also, this is a limitation in MySQL Server.

    If you'd like a column that defaults to auto_increment but is not part of the
    primary key, you should file a feature request on http://bugs.mysql.com/.

    Status: Upstream