>Description:

On a table with a auto_increment/primary constraint is it not possible to 
insert an id with value 0 but it is possible to insert it with another
id and use update to set it to 0, thereby making the backup import later
fail due to the use of "insert" statements. 

>How-To-Repeat:
mysql> DROP TABLE test;
Query OK, 0 rows affected (0.07 sec)

mysql> CREATE TABLE `test` (
    ->   `id` int(10) unsigned NOT NULL auto_increment,
    ->   PRIMARY KEY  (`id`)
    -> ) TYPE=InnoDB PACK_KEYS=1 ;
Query OK, 0 rows affected (0.00 sec)

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

mysql> select * from test;
+----+
| id |
+----+
|  1 |
+----+
1 row in set (0.00 sec)

mysql> update test set id = 0;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> 
mysql> select * from test;
+----+
| id |
+----+
|  0 |
+----+
1 row in set (0.00 sec)


>Fix:
        

>Submitter-Id:  <submitter ID>
>Originator:    
>Organization:
 
>MySQL support: none
>Category:      mysql
>Class:         sw-bug
>Release:       mysql-4.0.18-standard (Official MySQL RPM)

>C compiler:    2.95.3
>C++ compiler:  2.95.3
>Environment:
        
System: Linux 2.4.20-8bigmem #1 SMP Thu Mar 13 17:32:29 EST 2003 i686 i686 i386 
GNU/Linux
Architecture: i686

Some paths:  /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking 
--with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Compilation info: CC='gcc'  CFLAGS='-O2 -mcpu=i486 -fno-strength-reduce'  CXX='gcc'  
CXXFLAGS='-O2 -mcpu=i486 -fno-strength-reduce                -felide-constructors 
-fno-exceptions -fno-rtti                  '  LDFLAGS=''  ASFLAGS=''
LIBC: 
lrwxrwxrwx    1 root     root           13 Oct  3  2003 /lib/libc.so.6 -> libc-2.3.2.so
-rwxr-xr-x    1 root     root      1549556 Mar 14  2003 /lib/libc-2.3.2.so
-rw-r--r--    1 root     root      2321376 Mar 14  2003 /usr/lib/libc.a
-rw-r--r--    1 root     root          204 Mar 13  2003 /usr/lib/libc.so
lrwxrwxrwx    1 root     root           10 Oct  3  2003 /usr/lib/libc-client.a -> 
c-client.a
Configure command: ./configure '--disable-shared' '--with-mysqld-ldflags=-all-static' 
'--with-client-ldflags=-all-static' '--with-server-suffix=-standard' 
'--without-embedded-server' '--without-berkeley-db' '--with-innodb' '--without-vio' 
'--without-openssl' '--enable-assembler' '--enable-local-infile' 
'--with-mysqld-user=mysql' '--with-unix-socket-path=/var/lib/mysql/mysql.sock' 
'--prefix=/' '--with-extra-charsets=complex' '--exec-prefix=/usr' 
'--libexecdir=/usr/sbin' '--libdir=/usr/lib' '--sysconfdir=/etc' 
'--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--infodir=/usr/share/info' 
'--includedir=/usr/include' '--mandir=/usr/share/man' '--enable-thread-safe-client' 
'--with-comment=Official MySQL RPM' 'CC=gcc' 'CFLAGS=-O2 -mcpu=i486 
-fno-strength-reduce' 'CXXFLAGS=-O2 -mcpu=i486 -fno-strength-reduce                 
-felide-constructors -fno-exceptions -fno-rtti                  ' 'CXX=gcc'


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to