Re: Another bug of IPLOAD !
Posted in 1996
Valery Fouques wrote:
> IPLoad in the Bugland, Part II
>
> I don't know if I am cursed or not, but this is the second time I have a
> serious problem with the High Performance Loader provided with Online
> 7.20. Today's menu: ipload and serial type.
>
> Try this:
> create table zetable( ser serial );
> insert into zetable values(0);
> insert into zetable values(0);
> insert into zetable values(666);
> insert into zetable values(0);
> select * from zetable> What you get is:
> 1
> 2
> 666
> 667 (because the current serial value was 667 after inserting 666).
>
> You'll find out the current serial value is now 668 by using oncheck -pt
> on zetable (great ! that's what it should be !).
>
> Now, unload zetable to a file; for example, zetable.unl (great name...).
> Drop and recreate your table.
> Insert into your table using ipload (okay, zetable is small, but just do> it).
> Finally, check the current serial value with oncheck -pt.
> You'll get 1 !!! Aaaaarg ! This is pure s... !
Valery,
the purity of the afformentioned fertilizer is arguable. ;-)
While I would not have expected the result you got, hindsight tells me
it is reasonable. By default, ipload bypasses the whole ISAM layer,
writing pages directly to the tblspace. It skips index/btree
operations, skips constraint checking, skips any triggers.. you get the
idea. It is quite reasonable to assume it had skipped this step of
maintaining the serial value.
When the load is finished, the table is utterly unusable - you must
enable the database objects yourself and probably need to run UPDATE
STATISTICS. (I taught the subject a few times but will still need a
refresher browse through the manual.)
After you've done that, if the oncheck -pt still tells you the next
serial value is 1, *then* you'll have something to howl about.
AWWWOOOOOOOO!!!
(In view of this, it occurs to me that your test would have been just as
valid if you had inserted 0-values 5 times and not bothered with the
skip in the serial sequence.)
-- Jake Salomon (Trying to stay out of the fertilizer business)
PS I am bcc'ing a friend at Informix to check my facts. K, can you
please post a response in case I have my info mixed up?