InnoDB and Autoincrement start values

InnoDB and Autoincrement start values

am 03.04.2003 17:20:30 von docware

Hi,

with MyIsam tables I can specify a different start value for autoincrement
columns. In the example below I specify a start value of 10.

mysql> create table tableMyIsam (col1 int auto_increment, index(col1));
Query OK, 0 rows affected (0.10 sec)

mysql> alter table tableMyIsam auto_increment=10;
Query OK, 0 rows affected (0.07 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> insert into tableMyIsam values();
Query OK, 1 row affected (0.02 sec)

mysql> select * from tableMyIsam;
+------+
| col1 |
+------+
| 10 |
+------+
1 row in set (0.01 sec)

Doing the same for an InnoDB table does not work. The value starts with the
default 0.

mysql> create table tableInnodb (col1 int auto_increment, index(col1))
type=inno
db;
Query OK, 0 rows affected (0.06 sec)

mysql> alter table tableInnodb auto_increment=10;
Query OK, 0 rows affected (0.13 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> insert into tableInnodb values();
Query OK, 1 row affected (0.00 sec)

mysql> select * from tableInnodb;
+------+
| col1 |
+------+
| 1 |
+------+
1 row in set (0.01 sec)

Best regards

Michael

____________________________________________________________ _____
MSN Hotmail  -  Absolut kostenfrei! Der weltweit größte E-Mail-Anbieter im
Netz: http://www.msn.de/hotmail


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: InnoDB and Autoincrement start values

am 03.04.2003 18:07:13 von Peter Zaitsev

On Thu, 2003-04-03 at 19:20, Michael Südkamp wrote:
> Hi,
>
> with MyIsam tables I can specify a different start value for autoincrement
> columns. In the example below I specify a start value of 10.

Thank you for your bug report.

This is known Deficiency on Innodb tables regarding auto_increment, It
is documented in "Restrictions on InnoDB tables" section in the manual.

There are plans to fix this behavior for Innodb tables in the future,
however the time line is not planned for the fix yet.

>
> mysql> create table tableMyIsam (col1 int auto_increment, index(col1));
> Query OK, 0 rows affected (0.10 sec)
>
> mysql> alter table tableMyIsam auto_increment=10;
> Query OK, 0 rows affected (0.07 sec)
> Records: 0 Duplicates: 0 Warnings: 0
>
> mysql> insert into tableMyIsam values();
> Query OK, 1 row affected (0.02 sec)
>
> mysql> select * from tableMyIsam;
> +------+
> | col1 |
> +------+
> | 10 |
> +------+
> 1 row in set (0.01 sec)
>
> Doing the same for an InnoDB table does not work. The value starts with the
> default 0.
>
> mysql> create table tableInnodb (col1 int auto_increment, index(col1))
> type=inno
> db;
> Query OK, 0 rows affected (0.06 sec)
>
> mysql> alter table tableInnodb auto_increment=10;
> Query OK, 0 rows affected (0.13 sec)
> Records: 0 Duplicates: 0 Warnings: 0
>
> mysql> insert into tableInnodb values();
> Query OK, 1 row affected (0.00 sec)
>
> mysql> select * from tableInnodb;
> +------+
> | col1 |
> +------+
> | 1 |
> +------+
> 1 row in set (0.01 sec)
>
> Best regards
>
> Michael
>
> ____________________________________________________________ _____
> MSN Hotmail - Absolut kostenfrei! Der weltweit größte E-Mail-Anbieter im
> Netz: http://www.msn.de/hotmail
--
MySQL 2003 Users Conf. -> http://www.mysql.com/events/uc2003/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Peter Zaitsev
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Moscow, Russia
<___/ www.mysql.com


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org