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 value increased from 20 to 32 when I inserted a new row.

2011-09-19 Thread Johan De Meersman
- Original Message - > From: "crocket" > > I had 19 rows in series table. And when I tried inserting the 20th > row, the auto_increment value suddenly increased from 20 to 32, and > the new row has 20 as series_id. The first thing that comes to mind, is transactions that insert, but then

Re: auto_increment by more than 1

2011-02-23 Thread Reindl Harald
Am 23.02.2011 22:55, schrieb Singer X.J. Wang: > Yes, you can set it up so that it increases it by X only for that statement.. > eg. > > [other stuff] > set auto_increment_increment = X; > insert into that table you want > set auto_increment_increment = 1; > [other stuff] > > Now you have to r

Re: auto_increment by more than 1

2011-02-23 Thread Reindl Harald
Am 23.02.2011 22:29, schrieb Jim McNeely: > I have read the manual, and you're right, the auto-increment_increment is a > system wide setting No, scope session means "set VAR=value" Command-Line Format --auto_increment_increment[=#] Option-File Format auto_increment_increment Option S

Re: auto_increment by more than 1

2011-02-23 Thread Jim McNeely
This doesn't work, it just sets the starting number, but it will still increment by one unless you set the auto_increment_increment system variable, but this affects all the tables in the DB and not just the particular table. Thanks, Jim McNeely On Feb 23, 2011, at 10:26 AM, Carsten Pedersen w

Re: auto_increment by more than 1

2011-02-23 Thread Jim McNeely
I have read the manual, and you're right, the auto-increment_increment is a system wide setting. I only want this on one table. I am in this instance creating ID's for a separate system via HL7 for a Filemaker system, and FileMaker is too lame and slow to actually spit out an ID in time for the

Re: auto_increment by more than 1

2011-02-23 Thread Shawn Green (MySQL)
On 2/23/2011 12:41, Jim McNeely wrote: Is there a way to set the auto-increment for a particular table to increase by some number more than one, like maybe 10? Thanks in advance, Jim McNeely The manual is your friend. Don't be afraid of it :) http://dev.mysql.com/doc/refman/5.5/en/replicat

Re: auto_increment by more than 1

2011-02-23 Thread Carsten Pedersen
Den 23-02-2011 18:41, Jim McNeely skrev: Is there a way to set the auto-increment for a particular table to increase by some number more than one, like maybe 10? Thanks in advance, Jim McNeely CREATE TABLE t ( ... ) AUTO_INCREMENT=10; / Carsten -- MySQL General Mailing List For list archi

Re: auto_increment weirdness

2010-02-19 Thread Ananda Kumar
what is the value u see when you execute select max(b) from y; On Thu, Feb 18, 2010 at 1:33 PM, Gavin Towey wrote: > Reproduced in 5.1.43. Could not reproduce it in 5.0.66 > > > -Original Message- > From: Yang Zhang [mailto:yanghates...@gmail.com] > Sent: Wednesday, February 17, 2010 6:

RE: auto_increment weirdness

2010-02-18 Thread Gavin Towey
Reproduced in 5.1.43. Could not reproduce it in 5.0.66 -Original Message- From: Yang Zhang [mailto:yanghates...@gmail.com] Sent: Wednesday, February 17, 2010 6:05 PM To: mysql@lists.mysql.com Subject: auto_increment weirdness Hi, for some reason, I have an auto_increment field that's ma

Re: auto_increment without primary key in innodb?

2010-01-26 Thread Johan De Meersman
On Mon, Jan 25, 2010 at 10:08 PM, Yong Lee wrote: > yah, mysql only allows one auto increment field n that's used as the > primary key in tables. I don't think it has to be the primary key as > long as it is a unique key i think that's okay. > > so u should be able to do : create table (myid int

Re: auto_increment without primary key in innodb?

2010-01-25 Thread Yong Lee
yah, mysql only allows one auto increment field n that's used as the primary key in tables. I don't think it has to be the primary key as long as it is a unique key i think that's okay. so u should be able to do : create table (myid int unsigned not null auto_increment., unique key (myid));

Re: auto_increment without primary key in innodb?

2010-01-25 Thread Paul DuBois
The requirement is that it be indexed. The index need not be a primary key. mysql> create table t (i int not null auto_increment, index(i)) engine innodb; Query OK, 0 rows affected (0.45 sec) On Jan 25, 2010, at 9:39 AM, Yang Zhang wrote: > Right, I saw the docs. I'm fine with creating an index

Re: auto_increment without primary key in innodb?

2010-01-25 Thread Jaime Crespo Rincón
2010/1/25 Yang Zhang : > Right, I saw the docs. I'm fine with creating an index on it, but the > only way I've successfully created a table with auto_increment is by > making it a primary key. And I still don't understand why this > requirement is there in the first place. Non-primary key works fo

Re: auto_increment without primary key in innodb?

2010-01-25 Thread Yang Zhang
Right, I saw the docs. I'm fine with creating an index on it, but the only way I've successfully created a table with auto_increment is by making it a primary key. And I still don't understand why this requirement is there in the first place. On Mon, Jan 25, 2010 at 10:32 AM, Tom Worster wrote: >

RE: auto_increment without primary key in innodb ?

2010-01-25 Thread Tom Worster
it's not an innodb thing: http://dev.mysql.com/doc/refman/5.0/en/create-table.html "Note "There can be only one AUTO_INCREMENT column per table, it must be indexed, and it cannot have a DEFAULT value. An AUTO_INCREMENT column works properly only if it contains only positive values. Inserting a

Re: auto_increment Issue

2009-04-10 Thread Jnaneshwar Bantanur
Hi , Thanks,Its working now Jnani abdulazeez alugo wrote: > > > >> Date: Fri, 10 Apr 2009 15:55:33 +0530 >> From: jnaneshwar.banta...@kavach.net >> To: orasn...@gmail.com >> CC: defati...@hotmail.com; mysql@lists.mysql.com >> Subject: Re: auto_incremen

RE: auto_increment Issue

2009-04-10 Thread abdulazeez alugo
> Date: Fri, 10 Apr 2009 15:55:33 +0530 > From: jnaneshwar.banta...@kavach.net > To: orasn...@gmail.com > CC: defati...@hotmail.com; mysql@lists.mysql.com > Subject: Re: auto_increment Issue > > Hi > > While trying for the same,I am getting the following

Re: auto_increment Issue

2009-04-10 Thread Jnaneshwar Bantanur
-- > Octavian > > - Original Message - From: "abdulazeez alugo" > > To: ; > Sent: Friday, April 10, 2009 1:07 PM > Subject: RE: auto_increment Issue > > > > > > >> Date: Fri, 10 Apr 2009 15:15:28 +0530 >> From: jnaneshwar

RE: auto_increment Issue

2009-04-10 Thread abdulazeez alugo
> Date: Fri, 10 Apr 2009 15:15:28 +0530 > From: jnaneshwar.banta...@kavach.net > To: mysql@lists.mysql.com > Subject: auto_increment Issue > > > Hi All > > I have created a table.Now I need to make a field Auto_increment...Help > me with this issue..An example will do.. > > Regards > Jnani

Re: auto_increment problem

2008-10-30 Thread Moon's Father
alter table tablename modify id int not null auto_increment primary key; On Sat, Oct 25, 2008 at 2:48 AM, Paul <[EMAIL PROTECTED]> wrote: > Anybody know if there's a way to change a primary key field that is not > auto-incremented, turning on auto-increment but preserving the values that > are cu

Re: auto_increment

2008-04-22 Thread Hiep Nguyen
On Tue, 22 Apr 2008, Sebastian Mendel wrote: Sebastian Mendel schrieb: Hiep Nguyen schrieb: hi list, reading manual on mysql regarding auto_increment with multiple-column index: CREATE TABLE animals ( grp ENUM('fish','mammal','bird') NOT NULL, id MEDIUMINT NOT NULL AUTO_INCREMENT,

Re: auto_increment

2008-04-22 Thread Ben Clewett
You are right, I've tried 5.0.18 and 5.0.45 which work. There must have been a bug in 5.0.41 with which I used test the question... I belive the question has been answered by now anyway :) Ben Sebastian Mendel wrote: Ben Clewett schrieb: Are you sure, I just get: CREATE TABLE ... ERROR 1

Re: auto_increment

2008-04-22 Thread Sebastian Mendel
Ben Clewett schrieb: Are you sure, I just get: CREATE TABLE ... ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key the mentioned CREATE TABLE is fine and works On version 5.0.41. What version are you using? this works on al

Re: auto_increment

2008-04-22 Thread Ben Clewett
Are you sure, I just get: CREATE TABLE ... ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key On version 5.0.41. What version are you using? Hiep Nguyen wrote: hi list, reading manual on mysql regarding auto_increment with m

Re: auto_increment

2008-04-22 Thread Sebastian Mendel
Sebastian Mendel schrieb: Hiep Nguyen schrieb: hi list, reading manual on mysql regarding auto_increment with multiple-column index: CREATE TABLE animals ( grp ENUM('fish','mammal','bird') NOT NULL, id MEDIUMINT NOT NULL AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY KEY (gr

Re: auto_increment

2008-04-21 Thread Sebastian Mendel
Hiep Nguyen schrieb: hi list, reading manual on mysql regarding auto_increment with multiple-column index: CREATE TABLE animals ( grp ENUM('fish','mammal','bird') NOT NULL, id MEDIUMINT NOT NULL AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY KEY (grp,id) ); INSERT INTO anima

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 Question

2006-06-01 Thread Paul DuBois
At 19:12 +1000 6/1/06, Mark Sargent wrote: Hi All, if a table has an auto_incremented primary key why does the below code require the people_id to be manually inserted? I got this from Beginning PHP, Apache, MySQL Web Development book from Wrox. Curious, as it seems to defeat the purpose of a

Re: auto_increment Question

2006-06-01 Thread Douglas Sims
Hi Mark People_id is the column with auto increment? You can verify that it really does have auto_increment by using the "describe" command. For example: mysql> describe checks; +-+--+--+-+- ++ | Field | Type

Re: auto_increment and the value 0

2006-03-29 Thread Gabriel PREDA
You can override MySQL behaviour of generating a new value if you insert a 0 into an auton_increment field. Quoting from the manual: > NO_AUTO_VALUE_ON_ZERO affects handling of AUTO_INCREMENT columns. > Normally, you generate the next sequence number for the column by inserting > either NULL or

Re: auto_increment and the value 0

2006-03-29 Thread Simon Garner
On 30/03/2006 12:31 p.m., Daniel Kasak wrote: [EMAIL PROTECTED] wrote: I suppose that would be alot easier than trying to bump the PK and related FK values of the whole table by 1, just to give the first row in the table the auto_increment value of 1? Yes. That sounds messy. What about be

Re: auto_increment and the value 0

2006-03-29 Thread Daniel Kasak
[EMAIL PROTECTED] wrote: Are you saying just change the row with the 0 value as the PK, and change the FK's in the related tables to point to the new value instaed of 0? Yes. If so, would this move the row logically to the end of the table, if the 0 PK was replaced with the next auto_incr

Re: auto_increment and the value 0

2006-03-29 Thread mysql
l.com'" > From: Daniel Kasak <[EMAIL PROTECTED]> > Subject: Re: auto_increment and the value 0 > > Stanton, Brian wrote: > > I'm migrating a database from 4.0.12 on Solaris to 4.0.18-0 on Red > > Hat > > Linux. A few of the tables have a 0 (zero)

Re: auto_increment and the value 0

2006-03-29 Thread Daniel Kasak
Stanton, Brian wrote: I'm migrating a database from 4.0.12 on Solaris to 4.0.18-0 on Red Hat Linux. A few of the tables have a 0 (zero) in the auto_increment primary key column. However, when importing, the 0 in the insert is translated to the next available auto_increment value thus causing a

Re: auto_increment syntax

2006-03-23 Thread Simon Garner
On 24/03/2006 11:06 a.m., Eric Beversluis wrote: Can someone illustrate the correct syntax for using auto_increment in making a table? I've studied the manual and I'm not seeing how it comes out. EG: CREATE TABLE Books ( bookID INT(5) PRIMARY KEY AUTO_INCREMENT... THEN WHAT? Thanks. EB

Re: auto_increment

2006-02-03 Thread sheeri kritzer
You can change the table definition to not have the auto_increment column, and then ALTER TABLE MODIFY COLUMN after that. However, if you post your errors here, perhaps you'll get the answer that actually solves the problem, instead of working around it to possibly leave bad data for you to discov

Re: auto_increment

2006-02-03 Thread Gleb Paharenko
Hello. Please, could add more details of your actions. Are you inserting in the table which already has data? Please, provide exact error message. I'm not a telepathist, but in case of duplicate key errors a brute solution is to perform a dump with --insert-ignore option. Scott Johnson wrote: >

Re: Auto_Increment value

2005-12-03 Thread Cal Evans
http://dev.mysql.com/doc/refman/4.1/en/odbc-and-last-insert-id.html | | Cal Evans | http://www.calevans.com | Danesh Daroui wrote: Hi all, I have a simple table with an Auto_Increment column. I insert NULL to this column each time I insert a row to have an automatic unique value. Th

Re: auto_increment trouble (not the usual check || alter table solution, though)

2005-05-27 Thread Ricardo Oliveira
On 5/16/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > with a similar structure, you can have : > mysql> select * from users where uid >=262140; > ++--+ > | uid| nickname | > ++--+ > | 262140 | text | > | 262141 | text | > | 262142 | text |

Re: auto_increment trouble (not the usual check || alter table solution, though)

2005-05-16 Thread Ricardo Oliveira
Partha, Partha Dutta wrote: This may not be a very elegant solution, but you can do this just to get the inserts going again: ALTER TABLE users MODIFY COLUMN uid INTEGER UNSIGNED NOT NULL AUTO_INCREMENT; If you don't have any negative uids, then you will be able to store 2 billion more uids. Just o

Re: auto_increment trouble (not the usual check || alter table solution, though)

2005-05-16 Thread mfatene
Hi, with a similar structure, you can have : mysql> select * from users where uid >=262140; ++--+ | uid| nickname | ++--+ | 262140 | text | | 262141 | text | | 262142 | text | | 262143 | text | | 262144 | text | ++--+ 5 rows in

Re: auto_increment trouble (not the usual check || alter table solution, though)

2005-05-16 Thread Ricardo Oliveira
Partha, On 5/16/05, Partha Dutta <[EMAIL PROTECTED]> wrote: > This may not be a very elegant solution, but you can do this just to get the > inserts going again: > > ALTER TABLE users > MODIFY COLUMN uid INTEGER UNSIGNED NOT NULL AUTO_INCREMENT; > > If you don't have any negative uids, then you

RE: auto_increment trouble (not the usual check || alter table solution, though)

2005-05-16 Thread Partha Dutta
This may not be a very elegant solution, but you can do this just to get the inserts going again: ALTER TABLE users MODIFY COLUMN uid INTEGER UNSIGNED NOT NULL AUTO_INCREMENT; If you don't have any negative uids, then you will be able to store 2 billion more uids. Just out of curiosity, have you

Re: auto_increment insert-delete-insert

2005-02-24 Thread SGreen
"Jim McAtee" <[EMAIL PROTECTED]> wrote on 02/24/2005 04:50:11 PM: > Say a row is inserted into a table with an auto_increment column and then > deleted before another record is inserted. When a new row is inserted, > will the value of the auto_increment column be the same as the deleted > rec

Re: auto_increment insert-delete-insert

2005-02-24 Thread Daniel Kasak
Jim McAtee wrote: Say a row is inserted into a table with an auto_increment column and then deleted before another record is inserted. When a new row is inserted, will the value of the auto_increment column be the same as the deleted record's, or will it be one greater? Greater. -- Daniel Kasa

Re: auto_increment not working?

2005-02-18 Thread courtot
it doesn't work with innodb table. http://dev.mysql.com/doc/mysql/en/innodb-restrictions.html InnoDB does not support the AUTO_INCREMENT table option for setting the initial sequence value in a CREATE TABLE or ALTER TABLE statement. To set the value with InnoDB, insert a dummy row with a value one

Re: auto_increment not working?

2005-02-18 Thread daniel
I am not really experienced on this, but i have noticed that simply truncating an innodb table doesnt reset the autoinc key, u have to redump the table. I cant see what you are trying to do here ALTER TABLE users auto_increment = 590; set it to start @ 590 ? > Hello, > I am trying to get auto_

Re: auto_increment=0

2005-02-17 Thread Gleb Paharenko
Hello. Use the NO_AUTO_VALUE_ON_ZERO sql mode. See: http://dev.mysql.com/doc/mysql/en/server-sql-mode.html Philippe Rousselot <[EMAIL PROTECTED]> wrote: > hi, > > I am migrating a DB having a table with a UID not_null autoincrement > > the original table starts at UID=0 >

Re: AUTO_INCREMENT working

2004-12-14 Thread Gleb Paharenko
Hello. There were several bugs in older versions of MySQL related to 'duplicate entry' errors. Do you use latest release? In documentation it is said that AUTO_INCREMENT works correctly with replication. Please also take a look in the documentation at these links: http://dev.mysql.com/doc/mys

Re: AUTO_INCREMENT

2004-09-16 Thread SGreen
According to http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html: Note: There can be only one AUTO_INCREMENT column per table, it must be indexed, and it cannot have a DEFAULT value. It did not specify that the AUTO_INCREMENT column couldn't have a regular index on it. If you have this table:

Re: Auto_increment

2004-09-10 Thread SGreen
I hate to dampen your spirits but I think you have made a poor design choice. The word "key" is a reserved word in MySQL. In order to assign to a database object a name that is either a reserved word or a name that uses a special character, you must surround that with a pair of backticks, ``

RE: Auto_increment and existing table

2004-08-11 Thread Scott Hamm
Thanks! -Original Message- From: Victor Pendleton [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 3:40 PM To: 'Scott Hamm '; ''Mysql ' (E-mail) ' Subject: RE: Auto_increment and existing table If you do an ALTER TABLE table_name MODIFY id INTEG

RE: Auto_increment and existing table

2004-08-11 Thread Victor Pendleton
If you do an ALTER TABLE table_name MODIFY id INTEGER AUTO_INCREMENT, ADD PRIMARY KEY(id); ... The next record entered should be properly auto_incremented. -Original Message- From: Scott Hamm To: 'Mysql ' (E-mail) Sent: 8/11/04 1:32 PM Subject: Auto_increment and existing table I've impo

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-23 Thread Kevin Brock
On Jun 23, 2004, at 8:15 AM, Michael Stassen wrote: So, if I understand you correctly, somewhere in the middle of a 20,000 row insert, a row gets inserted with auto_increment id = 87,123,456, say, then the next row tries to insert with the value 87,123,457 but fails. You fix this by skipping th

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-23 Thread Michael Stassen
So, if I understand you correctly, somewhere in the middle of a 20,000 row insert, a row gets inserted with auto_increment id = 87,123,456, say, then the next row tries to insert with the value 87,123,457 but fails. You fix this by skipping the next value with ALTER TABLE yourtable AUTO_INCR

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-22 Thread Kevin Brock
On Jun 18, 2004, at 5:31 PM, Scott Haneda wrote: While I do not know why, I would suggest you simply drop the PK and recreate it, this should be a whole lot faster than the alter. This took the same amount of time as the alter table (a little longer actually). The documentation says that in late

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-20 Thread Michael Stassen
Robert A. Rosenberg wrote: At 13:37 -0400 on 06/19/2004, Michael Stassen wrote about Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a: Finally, just to cover all the bases, that really is 87 million inserts, not 8.7 million, right? I only ask because a MEDIUMINT column runs

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-20 Thread Robert A. Rosenberg
At 13:37 -0400 on 06/19/2004, Michael Stassen wrote about Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a: Finally, just to cover all the bases, that really is 87 million inserts, not 8.7 million, right? I only ask because a MEDIUMINT column runs out a little past 8.3 millio

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Robert A. Rosenberg
At 17:16 -0700 on 06/18/2004, Kevin Brock wrote about AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one: We have a table with a primary index which is INT NOT NULL AUTO_INCREMENT. After inserting ~87,000,000 entries, we started seeing error 1062, ER_DUP_ENTRY. You are wasting half your

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Kevin Brock
On Jun 19, 2004, at 10:37 AM, Michael Stassen wrote: Something about your description doesn't quite fit, however. You say that you are "nowhere near the limit", but you say that resetting the "auto_increment starting point" fixes the problem. Those seem contradictory to me. To me as well, tha

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Michael Stassen
To the best of my knowledge, AUTO_INCREMENT columns are limited only by the size of the int, so an INT NOT NULL AUTO_INCREMENT should go to 2,147,483,647. Something about your description doesn't quite fit, however. You say that you are "nowhere near the limit", but you say that resetting the

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Kevin Brock
On Jun 19, 2004, at 6:03 AM, Terry Riley wrote: Just a suggestion, Kevin, but how about changing from INT to BIGINT? I thought of trying that, but since we're nowhere near the limit even for an INT I think changing to BIGINT is premature. I want to find out a bit more about what's happening firs

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Kevin Brock
On Jun 18, 2004, at 5:31 PM, Scott Haneda wrote: on 06/18/2004 05:16 PM, Kevin Brock at [EMAIL PROTECTED] wrote: We have a table with a primary index which is INT NOT NULL AUTO_INCREMENT. After inserting ~87,000,000 entries, we started seeing error 1062, ER_DUP_ENTRY. While I do not know why, I wou

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Terry Riley
Just a suggestion, Kevin, but how about changing from INT to BIGINT? Terry --Original Message- > We have a table with a primary index which is INT NOT NULL > AUTO_INCREMENT. > > After inserting ~87,000,000 entries, we started seeing error 1062, > ER_DUP_ENTRY. > > We can ge

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-18 Thread Scott Haneda
on 06/18/2004 05:16 PM, Kevin Brock at [EMAIL PROTECTED] wrote: > We have a table with a primary index which is INT NOT NULL > AUTO_INCREMENT. > > After inserting ~87,000,000 entries, we started seeing error 1062, > ER_DUP_ENTRY. > > We can get going again after doing an ALTER TABLE to reset the

Re: auto_increment question

2004-05-09 Thread Mark Fuller
I found the answer to my question by reading the online manual with user comments. Sorry!. Mark - Original Message - From: "Mark Fuller" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, May 09, 2004 12:25 AM Subject: auto_increment question > I would like to use "MEDIUMINT UN

Re: auto_increment id

2004-03-12 Thread Rocar Peças
MAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 12, 2004 9:35 AM Subject: Re: auto_increment id > "Stefan Schuster" <[EMAIL PROTECTED]> wrote: > >> "Stefan Schuster" <[EMAIL PROTECTED]> wrote: > >>> Hi, > >>>

Re: auto_increment id

2004-03-12 Thread Victoria Reznichenko
"Stefan Schuster" <[EMAIL PROTECTED]> wrote: >> "Stefan Schuster" <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> I have a question about auto_increment: >>> >>> I have 2 tables, on of them holds my "online transactions", the other >>> one the "offline transactions". Every transaction is created in the

Re: auto_increment id

2004-03-11 Thread Stefan Schuster
> "Stefan Schuster" <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I have a question about auto_increment: >> >> I have 2 tables, on of them holds my "online transactions", the other >> one the "offline transactions". Every transaction is created in the >> first table (call it t1) and then moved to t2. Th

Re: auto_increment id

2004-03-11 Thread Victoria Reznichenko
"Stefan Schuster" <[EMAIL PROTECTED]> wrote: > Hi, > > I have a question about auto_increment: > > I have 2 tables, on of them holds my "online transactions", the other > one the "offline transactions". Every transaction is created in the > first table (call it t1) and then moved to t2. The id is

Re: auto_increment pseudo sequence?

2004-02-09 Thread Kevin Carlson
alter table AUTO_INCREMENT=x Scott Purcell wrote: Hello, I have an application in which I am using auto_increment as a kind of sequence replacement. The only problem I have is trying to get the auto_increment to start at a larger number than 0. Is auto_increment the replacement for sequences?

Re: auto_increment pseudo sequence?

2004-02-09 Thread Peter J Milanese
When you create the table I think you just set it.. ie- create table blah AUTO_INCREMENT= P -"Scott Purcell" <[EMAIL PROTECTED]> wrote: - To: <[EMAIL PROTECTED]> From: "Scott Purcell" <[EMAIL PROTECTED]> Date: 02/09/2004 12:21PM Subject: auto_increment pseudo sequence? Hello

Re: AUTO_INCREMENT in InnoDB

2004-02-01 Thread Heikki Tuuri
Hassan, - Original Message - From: "Hassan Shaikh" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, February 01, 2004 5:01 PM Subject: AUTO_INCREMENT in InnoDB > Hi, > > How do I reset the AUTO_INCREMENT column to some arbitrary number? My > table type i

Re: Auto_increment question

2003-12-21 Thread Roger Baklund
* Chris W > I have two tables with a one to many relationship: boys and their toys. > I want to know if there are any advantages or disadvantages for each > of the following two ways to create the tables. I am mainly interested > in performance. Either way the insert and select queries aren't a

RE: AUTO_INCREMENT Starting over

2003-12-03 Thread Dan Muey
> "Dan Muey" <[EMAIL PROTECTED]> wrote: > >> "Dan Muey" <[EMAIL PROTECTED]> wrote: > >> > I have a table that I create with=3D20 > >> > CREATE TABLE SuperTest ( > >> >ID int(11) NOT NULL AUTO_INCREMENT, > >> >Name varchar(64) NOT NULL, > >> >Domain varchar(64) NOT NULL, > >

Re: AUTO_INCREMENT Starting over

2003-12-03 Thread Egor Egorov
"Dan Muey" <[EMAIL PROTECTED]> wrote: >> "Dan Muey" <[EMAIL PROTECTED]> wrote: >> > I have a table that I create with=3D20 >> > CREATE TABLE SuperTest ( >> >ID int(11) NOT NULL AUTO_INCREMENT, >> >Name varchar(64) NOT NULL, >> >Domain varchar(64) NOT NULL, >> >PRIMA

RE: AUTO_INCREMENT Starting over

2003-12-03 Thread Dan Muey
> "Dan Muey" <[EMAIL PROTECTED]> wrote: > > > > I have a table that I create with=20 > > > > CREATE TABLE SuperTest ( > >ID int(11) NOT NULL AUTO_INCREMENT, > >Name varchar(64) NOT NULL, > >Domain varchar(64) NOT NULL, > >PRIMARY KEY(ID) > > ); > > > > I use that

Re: AUTO_INCREMENT Starting over

2003-12-03 Thread Egor Egorov
"Dan Muey" <[EMAIL PROTECTED]> wrote: > > I have a table that I create with=20 > > CREATE TABLE SuperTest ( >ID int(11) NOT NULL AUTO_INCREMENT, >Name varchar(64) NOT NULL, >Domain varchar(64) NOT NULL, >PRIMARY KEY(ID) > ); > > I use that same thing to create a

Re: auto_increment with FOREIGN KEY UPDATE CASCADE courses Lost connection to MySQL server

2003-10-28 Thread Heikki Tuuri
Vinita, it is most probably this bug fixed in 4.1.14: " Fixed a bug: if in a FOREIGN KEY with an UPDATE CASCADE clause the parent column was of a different internal storage length than the child column, then a cascaded update would make the column length wrong in the child table and corrupt the c

Re: auto_increment with FOREIGN KEY UPDATE CASCADE courses Lost connection to MySQL server

2003-10-28 Thread Victoria Reznichenko
vinita vigine MURUGIAH <[EMAIL PROTECTED]> wrote: > Hello, > I'm using ver 4.0.12, checked for bugs in ver > 4.0.12(http://bugs.mysql.com/search.php) but couldn't find this one. Thanks for report, but I wasn't able to repeat "Lost connection" error on v4.0.16. Many bugs were fixed since that time

Re: auto_increment fields

2003-08-27 Thread Antony Dovgal
On Wed, 27 Aug 2003 10:04:02 -0400 Paul DuBois <[EMAIL PROTECTED]> wrote: > Second reason still applies. yes, but I suppose he knows what he's trying to do =) > If it's still something deemed desireable: > > ALTER TABLE tbl_name AUTO_INCREMENT = 1; yes, this is another one possible solution, bu

Re: auto_increment fields

2003-08-27 Thread Paul DuBois
At 17:56 +0400 8/27/03, Antony Dovgal wrote: On Wed, 27 Aug 2003 09:38:16 -0400 Paul DuBois <[EMAIL PROTECTED]> wrote: At 9:05 -0300 8/27/03, bernardaum wrote: >Hi, > >I have a table with an auto_increment field. When I >delete all the record and insert a new one the >auto_increment field is

Re: auto_increment fields

2003-08-27 Thread Antony Dovgal
On Wed, 27 Aug 2003 09:38:16 -0400 Paul DuBois <[EMAIL PROTECTED]> wrote: > At 9:05 -0300 8/27/03, bernardaum wrote: > >Hi, > > > >I have a table with an auto_increment field. When I > >delete all the record and insert a new one the > >auto_increment field is not clean, its follows the > >sequence

Re: auto_increment fields

2003-08-27 Thread Paul DuBois
At 9:05 -0300 8/27/03, bernardaum wrote: Hi, I have a table with an auto_increment field. When I delete all the record and insert a new one the auto_increment field is not clean, its follows the sequence. Can I restart this sequence? Start from 0 again? Why bother? MySQL doesn't care if there are

Re: auto_increment fields

2003-08-27 Thread Antony Dovgal
On Wed, 27 Aug 2003 13:27:25 +0100 Simon <[EMAIL PROTECTED]> wrote: > On Wednesday 27 August 2003 1:05 pm, bernardaum wrote: > > Hi, > > > > I have a table with an auto_increment field. When I > > delete all the record and insert a new one the > > auto_increment field is not clean, its follows the

  1   2   3   >