Hi guys,
I've come across a problem which I believe is to do with the auto increment feature and wondered if anyone else had come across it.
Basically to keep it simple I've got one table with an integer key set to auto increment. I need to have this enabled to allow new records to be added once the system is in it's initial state.
Now to get to that initial state the table has to have a load of records read in from a text file. The problem is regarding where to start the keys from.
(the keys are in the file - I'll come back to that) The first record has key zero and gets entered into the table as it should, the second record in the file has key one but it doesn't get entered into the table. Everything after that (2+) gets entered fine but it leaves me with a table with keys that go 0,2,3,4,5,...
If I change the keys to start at 1 then everything goes fine and I get a table with keys that go 1,2,3,4,5,....
It makes me think it's a problem with the auto-increment not likin gstarting at 0 and being told what to put in, but like I said it is highly desirable to me that this feature is set enabled so that more entries in the future can be added. the other thing is to start from 1 rather than 0 but that does cause a bit of work further back down the chain.
Like i said aswell, the keys are explicitly set in the text file and I could take them out and just rely on MySQL to keep them in the right order but that does lead to the possibility of files getting corrupted or altered badly without it being obvious to me.
Any ideas or known reports on this matter (bug?) would be greatly appreciated
Cheers
Jo
I've come across a problem which I believe is to do with the auto increment feature and wondered if anyone else had come across it.
Basically to keep it simple I've got one table with an integer key set to auto increment. I need to have this enabled to allow new records to be added once the system is in it's initial state.
Now to get to that initial state the table has to have a load of records read in from a text file. The problem is regarding where to start the keys from.
(the keys are in the file - I'll come back to that) The first record has key zero and gets entered into the table as it should, the second record in the file has key one but it doesn't get entered into the table. Everything after that (2+) gets entered fine but it leaves me with a table with keys that go 0,2,3,4,5,...
If I change the keys to start at 1 then everything goes fine and I get a table with keys that go 1,2,3,4,5,....
It makes me think it's a problem with the auto-increment not likin gstarting at 0 and being told what to put in, but like I said it is highly desirable to me that this feature is set enabled so that more entries in the future can be added. the other thing is to start from 1 rather than 0 but that does cause a bit of work further back down the chain.
Like i said aswell, the keys are explicitly set in the text file and I could take them out and just rely on MySQL to keep them in the right order but that does lead to the possibility of files getting corrupted or altered badly without it being obvious to me.
Any ideas or known reports on this matter (bug?) would be greatly appreciated
Cheers
Jo