List:General Discussion« Previous MessageNext Message »
From:David A. Enete Date:January 14 2001 5:47pm
Subject:Still unable to auto_increment!!!
View as plain text  
I'm about to kill this terminal!  I'm using mysql 3.23.24-beta (my 
host's choice, not mine).

I have a table...
====================================================================== 
===========
mysql> describe users;
+----------------+--------------+------+-----+---------+-------------- 
--+----------------------+
| Field          | Type         | Null | Key | Default | Extra 
| Privileges           |
+----------------+--------------+------+-----+---------+-------------- 
--+----------------------+
| uid            | int(11)      |      | PRI | NULL    | 
auto_increment | select,insert,update |
| name           | varchar(60)  |      |     |         | 
| select,insert,update |
| uname          | varchar(25)  |      |     |         | 
| select,insert,update |
| email          | varchar(60)  |      |     |         | 
| select,insert,update |
| femail         | varchar(60)  |      |     |         | 
| select,insert,update |
| url            | varchar(100) |      |     |         | 
| select,insert,update |
| user_avatar    | varchar(30)  | YES  |     | NULL    | 
| select,insert,update |
| user_regdate   | varchar(20)  |      |     |         | 
| select,insert,update |
| user_icq       | varchar(15)  | YES  |     | NULL    | 
| select,insert,update |
| user_occ       | varchar(100) | YES  |     | NULL    | 
| select,insert,update |
| user_from      | varchar(100) | YES  |     | NULL    | 
| select,insert,update |
| user_intrest   | varchar(150) | YES  |     | NULL    | 
| select,insert,update |
| user_sig       | varchar(255) | YES  |     | NULL    | 
| select,insert,update |
| user_viewemail | tinyint(2)   | YES  |     | NULL    | 
| select,insert,update |
| user_theme     | int(3)       | YES  |     | NULL    | 
| select,insert,update |
| user_aim       | char(1)      | YES  |     | NULL    | 
| select,insert,update |
| user_yim       | varchar(25)  | YES  |     | NULL    | 
| select,insert,update |
| user_msnm      | varchar(25)  | YES  |     | NULL    | 
| select,insert,update |
| pass           | varchar(40)  |      |     |         | 
| select,insert,update |
| storynum       | tinyint(4)   |      |     | 10      | 
| select,insert,update |
| umode          | varchar(10)  |      |     |         | 
| select,insert,update |
| uorder         | tinyint(1)   |      |     | 0       | 
| select,insert,update |
| thold          | tinyint(1)   |      |     | 0       | 
| select,insert,update |
| noscore        | tinyint(1)   |      |     | 0       | 
| select,insert,update |
| bio            | tinytext     |      |     |         | 
| select,insert,update |
| ublockon       | tinyint(1)   |      |     | 0       | 
| select,insert,update |
| ublock         | tinytext     |      |     |         | 
| select,insert,update |
| theme          | varchar(255) |      |     |         | 
| select,insert,update |
| commentmax     | int(11)      |      |     | 4096    | 
| select,insert,update |
| counter        | int(11)      |      |     | 0       | 
| select,insert,update |
+----------------+--------------+------+-----+---------+-------------- 
--+----------------------+
====================================================================== 
===========

I insert a first record...
====================================================================== 
=========== mysql> INSERT INTO users VALUES ( '1', '', 
'Anonymous','','','','','July 15, 
1976','','','','','','','','','','','','10','','0','0','0','','0','0', 
'','4096','0');
====================================================================== 
===========

This gives me a record with a uid that is 1.

I then insert another record...
====================================================================== 
=========== mysql> INSERT INTO users VALUES ( NULL, '', 
'Dr.Foo','','','','','July 15, 
1976','','','','','','','','','','','','10','','0','0','0','','0','0', 
'','4096','0');
====================================================================== 
===========

This results in a second record with a uid that is not 2, but rather 
the max value...
====================================================================== 
===========
mysql> select uid from users;
+------------+
| uid        |
+------------+
|          1 |
| 2147483647 |
+------------+
2 rows in set (0.00 sec)
====================================================================== 
===========


What am I doing wrong here?

- David
david@stripped


Thread
Still unable to auto_increment!!!David A. Enete14 Jan
  • RE: Still unable to auto_increment!!!Carsten H. Pedersen14 Jan