As Far as I can remember it is explicitly said in the Manual that inserting
a negative value in an autoincrement field is a Bad Thing

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 6:14 AM
Subject: Possible bug in 3.23.32 or later


> >Description:
> When i insert into a negative integer into primary key (id int) field, it
works fine.
> However, the next insert i do without specifing the id explicitly and
relying on mysql to
> generate the next number in the sequence (should be 1) will use the upper
bound (2^32 - 1)
> Then every other insert after that will not insert since there are no id's
available.
>
>
> >How-To-Repeat:
>
> CREATE TABLE category
>      (
>      id                                INT NOT NULL AUTO_INCRE17;6,
>      name                              VARCHAR(50) NOT NULL,
>      code                              VARCHAR(50) NOT NULL,
>      description                       TEXT,
>      picture                           VARCHAR(50),
>      parent                            INT NOT NULL DEFAULT 0,
>      active                            TINYINT,
>      members                           INT NOT NULL DEFAULT 0,
>      storeid                           INT,
>      feature1                          INT NOT NULL DEFAULT 0,
>      feature2                          INT NOT NULL DEFAULT 0,
>      priority                          INT,
>      KEY (code),
>      KEY (name),
>      PRIMARY KEY (id)
>      )\g
>
>
> INSERT INTO category
(id,name,code,description,picture,parent,active,members,storeid,feature1,fea
ture2) VALUES (-10,'NEW','NEW','All new products','none',-1,0,0,1,0,0);
>
> Then try:
> INSERT INTO category
(name,code,description,picture,parent,active,members,storeid,feature1,featur
e2) VALUES ('test','test','All test products','none',-1,0,0,1,0,0);
>
> That should make the id 2^32 -1 (or something aroudn there).
>
> That id should be 1!!!
>
>
> >Fix:
>
>
>
> >Submitter-Id: <submitter ID>
> >Originator: Duane Homick
> >Organization:
> Inline Internet Systems, Inc.
>
> >MySQL support: none
> >Synopsis: bug in primary key insert with negative integers
> >Severity: serious
> >Priority: medium
> >Category: mysql
> >Class: sw-bug
> >Release: mysql-3.23.32 (TCX binary)
>
> >Environment:
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to