Re: auto_increment field behavior

2013-03-13 Thread spameden
2013/3/13 Reindl Harald : > > > Am 12.03.2013 22:34, schrieb spameden: >> NOTE: AUTO_INCREMENT is 32768 instead of 17923 ! So next inserted row >> would have pc_id=32768. >> >> Please suggest if it's normal behavior or not > > what do you expect if a PRIMARY KEY record get's removed? > re-use the s

Re: auto_increment field behavior

2013-03-12 Thread Reindl Harald
Am 12.03.2013 22:34, schrieb spameden: > NOTE: AUTO_INCREMENT is 32768 instead of 17923 ! So next inserted row > would have pc_id=32768. > > Please suggest if it's normal behavior or not what do you expect if a PRIMARY KEY record get's removed? re-use the same primary key? this is not the way a

Re: auto_increment field behavior

2013-03-12 Thread spameden
t;> If you DELETE the _highest_ id, then restart the server, that id will be >>>> reused. (This is irritating to some people.) Otherwise, a deleted id >>>> will not be reused. >>> >>> I didn't DELETE anything! The only actions I did: >>> &

RE: auto_increment field behavior

2013-03-12 Thread Rick James
, 2013 2:46 PM > To: Rick James > Cc: mysql@lists.mysql.com > Subject: Re: auto_increment field behavior > > 2013/3/13 Rick James : > > What settings? (innodb_autoinc_lock_mode comes to mind, but there > may > > be others.) > Hi, Rick. > > Many thanks for t

Re: auto_increment field behavior

2013-03-12 Thread spameden
2013/3/13 Rick James : > What settings? (innodb_autoinc_lock_mode comes to mind, but there may be > others.) Hi, Rick. Many thanks for the quick answer here is my settings: mysql> show variables like '%inc%'; +-+---+ | Variable_name | Value | +-

RE: auto_increment field behavior

2013-03-12 Thread Rick James
What settings? (innodb_autoinc_lock_mode comes to mind, but there may be others.) It is acceptable, by the definition of AUTO_INCREMENT, for it to burn the missing 15K ids. > -Original Message- > From: spameden [mailto:spame...@gmail.com] > Sent: Tuesday, March 12, 2013 2:34 PM > To: m

Re: auto_increment field behavior

2013-03-12 Thread spameden
o:spame...@gmail.com] >> Sent: Tuesday, March 12, 2013 2:46 PM >> To: Rick James >> Cc: mysql@lists.mysql.com >> Subject: Re: auto_increment field behavior >> >> 2013/3/13 Rick James : >> > What settings? (innodb_autoinc_lock_mode comes to mind, but the

Re: auto_increment field behavior

2013-03-12 Thread spameden
The only actions I did: > > 1. Created the TABLE > 2. used LOAD FILE only via command line (1 thread) > > So is it normal or should I fill a bug? >> >> There may be more. Most of those are covered here: >> http://mysql.rjweb.org/doc.php/ricksrots >> >&

Re: auto_increment field behavior

2013-03-12 Thread spameden
he TABLE >> 2. used LOAD FILE only via command line (1 thread) >> >> So is it normal or should I fill a bug? >>> >>> There may be more. Most of those are covered here: >>> http://mysql.rjweb.org/doc.php/ricksrots >>> >>> >>>

Re: auto_increment field behavior

2013-03-12 Thread spameden
Furthermore I've tested on 133K records and AUTO_INCREMENT field in the end had the value of 234076. mysql> select count(*) from billing.phone_codes; +--+ | count(*) | +--+ | 12 | +--+ 1 row in set (0.02 sec) AUTO_INCREMENT=234076 So it basically means If I have lar

Re: auto_increment field start value

2006-09-22 Thread dpgirago
At 14:16 -0500 9/22/06, [EMAIL PROTECTED] wrote: >> I seem to recall that when creating a table, you could designate an >> auto_increment field to begin counting at zero(0) instead of one (1), but I >> can't find an example in the documents. >> > Don't store 0 in an AUTO_INCREMENT column. Thank

Re: auto_increment field start value

2006-09-22 Thread Paul DuBois
At 14:16 -0500 9/22/06, [EMAIL PROTECTED] wrote: I seem to recall that when creating a table, you could designate an auto_increment field to begin counting at zero(0) instead of one (1), but I can't find an example in the documents. Don't store 0 in an AUTO_INCREMENT column. -- Paul DuBois, M

Re: Re: auto_increment field start value

2006-09-22 Thread Dan Buettner
I just tried it in 5.0.21, and found that it fails silently with zero (0). Works with 100. I did specify int, not unsigned int, in my test table. See http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html for some discussion about how you could get a zero in there; look for NO_AUTO_VALUE_O

Re: auto_increment field start value

2006-09-22 Thread dpgirago
OK. If you assign to auto_increment any number higher than what currently exists in the column, it changes the value and the incremented sequence from that point. But apparently you can't assign the value zero to the column, even if the table is empty. > Thanks, Dan, but I can't get it to work. D

Re: auto_increment field start value

2006-09-22 Thread dpgirago
Thanks, Dan, but I can't get it to work. Defining a column like this: << a int not null auto_increment=0 primary key >> throws an error, and while the alter table statement seems to work ok, whether the table is empty or not, it has no effect on subsequent inserts. I'm wondering if 4.0.16 has not

Re: auto_increment field start value

2006-09-22 Thread Dan Buettner
David - there's some info in the online docs here: http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html Specifically: To start with an AUTO_INCREMENT value other than 1, you can set that value with CREATE TABLE or ALTER TABLE, like this: mysql> ALTER TABLE tbl AUTO_INCREMENT = 100;

Re: AUTO_INCREMENT FIELD

2001-06-20 Thread James Fidell
Quoting Alessandro Coppelli ([EMAIL PROTECTED]): > I have this simple table > > create table tbl ( > sid int not null auto_increment , > filed1 LONGTEXT, > field2 LONGTEXT, >primary key (sid) > ) > > When I insert one item ( insert into tbl values (filed1,filed2) ) I > o