RE: autoincremental field ?? Bug
Posted in 2000
> -----Original Message-----
> From: Obnoxio The Clown [mailto:obnoxio@hotmail.com]
> >I have tried this so many times that now I'm at about 700.
>
> Why are you trying to do this? Rule number 17 is that your
> keys should have no meaning. So why do you care if
> there's a gap?
Rule No 16. The client is always right.
More seriously. There are often situations when your
keys do have meaning for a particular business rule.
Also legacy applications don't always play by the rules :-)
I have also tries to create some generic testing for this.
The testing seems to give different results on different
versions of informix.
For example
CREATE TABLE nona ( test_col SERIAL );
INSERT INTO nona VALUES (0);
INSERT INTO nona VALUES (0);
INSERT INTO nona VALUES (0);
INSERT INTO nona VALUES (0);
INSERT INTO nona VALUES (0);SELECT MAX ( test_col ) FROM nona; -- should return 5
Then
DELETE FROM nona WHERE 1 = 1;
ALTER TABLE nona MODIFY test_col INTEGER;-- a thought process my Mark Stock
ALTER TABLE nona MODIFY test_col SERIAL (2);
INSERT INTO nona VALUES (0);SELECT MAX ( test_col ) FROM nona;
On my version ( 7.30UC3 ) The last select returns 6 !
Paul Watson has tried on 7.24.UC8 and gets a value of 2!
These inconsistencies make me believe that there is a bug.
Jo
___________________________________________________________________________
This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
Sema Group.
If you are not the intended recipient, be advised that you have received this
email in error and that any use, dissemination, forwarding, printing, or
copying of this email is strictly prohibited.
If you have received this email in error please notify the Sema Group
Helpdesk by telephone on +44 (0) 121 627 5600.
___________________________________________________________________________