>Description:
        
        On some releases of mysql, after you manually set an AUTO_INCREMENT 
column to a negative value, the AUTO_INCREMENT fails.

On mysql 3.23.32
mysql> DROP TABLE IF EXISTS temp;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE temp(
    ->    id INT NOT NULL AUTO_INCREMENT,
    ->    foo VARCHAR(255),
    ->    PRIMARY KEY(id));
        Query OK, 0 rows affected (0.02 sec)

mysql> INSERT INTO temp (id,foo) VALUES (-1, "works");
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO temp (foo) VALUES ("works");
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO temp (foo) VALUES ("doesn't");
Query OK, 1 row affected (0.00 sec)

mysql> select * from temp;
+----+---------+
| id | foo     |
+----+---------+
| -1 | works   |
|  0 | works   |
|  1 | doesn't |
+----+---------+
3 rows in set (0.00 sec)

mysql> 

On mysql 3.23.37:

mysql> DROP TABLE IF EXISTS temp;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE temp(
    ->         id INT NOT NULL AUTO_INCREMENT,
    ->         foo VARCHAR(255),
    ->         PRIMARY KEY(id));
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO temp (id,foo) VALUES (-1, "works");
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO temp (foo) VALUES ("works");
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO temp (foo) VALUES ("doesn't");
ERROR 1062: Duplicate entry '2147483647' for key 1

mysql> SELECT * FROM temp; 
+------------+-------+
| id         | foo   |
+------------+-------+
|         -1 | works |
| 2147483647 | works |
+------------+-------+
2 rows in set (0.03 sec)


>How-To-Repeat:
        
DROP TABLE IF EXISTS temp;
CREATE TABLE temp(
        id INT NOT NULL AUTO_INCREMENT,
        foo VARCHAR(255),
        PRIMARY KEY(id));
INSERT INTO temp (id,foo) VALUES (-1, "works");
INSERT INTO temp (foo) VALUES ("works");
INSERT INTO temp (foo) VALUES ("doesn't");

>Fix:
        
        None knwn.

>Submitter-Id:  <submitter ID>
>Originator:    Andrew Barros
>Organization:
  Andrew Barros <[EMAIL PROTECTED]>
  GPG Key Fingerprint:
  EC9C DFC5 C565 E90C 0FFA  C4E7 539F DE81 2A92 E07D
  <http://andy.netherweb.com/>
            _   _                     _   
   _ _  ___| |_| |_  ___ _ _ _ _  ___| |_ 
  | ' \/ -_)  _| ' \/ -_) '_| ' \/ -_)  _|
  |_||_\___|\__|_||_\___|_| |_||_\___|\__|
>
>MySQL support: [none | licence | email support | extended email support ]
none
>Synopsis:      Problem involving negative values and AUTO_INCREMENT
>Severity:      non-critical
>Priority:      medium
>Category:      mysql
>Class:         sw-bug
>Release:       mysql-3.23.37 (Source distribution)

>Environment:
        
System: Linux discovery 2.4.1 #1 Tue Jan 30 23:44:03 EST 2001 i686 unknown
Architecture: i686

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20010506 (Debian prerelease)
Compilation info: CC='gcc'  CFLAGS='-O2  -g'  CXX='g++'  CXXFLAGS='-O2  -g 
-felide-constructors -fno-exceptions -fno-rtti'  LDFLAGS=''
LIBC: 
lrwxrwxrwx    1 root     root           13 May  7 19:43 /lib/libc.so.6 -> libc-2.2.3.so
-rwxr-xr-x    1 root     root      1105224 May  6 16:19 /lib/libc-2.2.3.so
-rw-r--r--    1 root     root      2529096 May  6 16:21 /usr/lib/libc.a
-rw-r--r--    1 root     root          178 May  6 16:21 /usr/lib/libc.so
-rw-r--r--    1 root     root       712844 Mar 31 00:23 /usr/lib/libc-client.so.2000
Configure command: ./configure  --prefix=/usr --exec-prefix=/usr 
--libexecdir=/usr/sbin --datadir=/usr/share --sysconfdir=/etc/mysql 
--localstatedir=/var/lib/mysql --includedir=/usr/include --infodir=/usr/share/info 
--mandir=/usr/share/man --enable-shared --with-libwrap --enable-assembler 
--with-berkeley-db --with-innodb --with-gemini --enable-static --enable-shared 
--with-raid --enable-thread-safe-client --without-readline 
--with-unix-socket-path=/var/run/mysqld/mysqld.sock --with-mysqld-user=mysql 
--without-bench --with-extra-charsets=all


---------------------------------------------------------------------
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