← Back to team overview

drizzle-discuss team mailing list archive

Re: SHOW CREATE and AUTO_INCREMENT

 

On Mon, Jun 28, 2010 at 10:01 PM, Stewart Smith
<stewart@xxxxxxxxxxxxxxxx> wrote:
> We currently don't really show the AUTO_INCREMENT setting for SHOW
> CREATE TABLE. This should probably be considered a bug.
>
> e.g.
> CREATE TABLE t1 (a int auto_increment) AUTO_INCREMENT=1000;
> SHOW CREATE TABLE t1;
>
> will not show AUTO_INCREMENT=1000;
>
> The next question is should SHOW CREATE TABLE show the *current*
> auto_increment value or the one the table was *created* with?
>
> The mysql behaviour is the following:
>
> CREATE TABLE `t1` (
> t1_name VARCHAR(255) DEFAULT NULL,
> t1_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> KEY (t1_name),
> PRIMARY KEY (t1_id)
> ) AUTO_INCREMENT = 1000;
> INSERT INTO t1 (t1_name) VALUES('MySQL');
> INSERT INTO t1 (t1_name) VALUES('MySQL');
> INSERT INTO t1 (t1_name) VALUES('MySQL');
> SHOW CREATE TABLE `t1`;
> Table   Create Table
> t1      CREATE TABLE `t1` (
>  `t1_name` varchar(255) DEFAULT NULL,
>  `t1_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
>  PRIMARY KEY (`t1_id`),
>  KEY `t1_name` (`t1_name`)
> ) ENGINE=MyISAM AUTO_INCREMENT=1003 DEFAULT CHARSET=latin1
>
>
> Personally, I'm of the opinion that SHOW CREATE TABLE should show 1000
> and not 1003 in this case.
>
> thoughts?
>
> --
> Stewart Smith


I disagree. I think the MySQL default is fairly sane, and I can see
how breaking this bit of compatibility would be worthwhile.

For the sake of argument, should drizzle consider adding SEQUENCE
rather than continuing AUTO_INCREMENT?


-- 
Rob Wultsch
wultsch@xxxxxxxxx



Follow ups

References