B-Tree (comp.source.misc) Test Fails.

Tony Olekshy tony at oha.UUCP
Sun Oct 23 13:57:14 AEST 1988


When I compile and run the example.c program provided with the btree routines
on comp.sources.misc, I observe the following unreasonable behaviour.

	Find  Next  Tail  Head  Prev  Insrt  Del  Quit: i
	Enter a key: 001
	...inserted
	Find  Next  Tail  Head  Prev  Insrt  Del  Quit: i
	Enter a key: 002
	...inserted
	Find  Next  Tail  Head  Prev  Insrt  Del  Quit: i
	Enter a key: 003
	...inserted
	Find  Next  Tail  Head  Prev  Insrt  Del  Quit: f
	Key to Find: 002
	current=002
	Find  Next  Tail  Head  Prev  Insrt  Del  Quit: d
	...deleted
	Find  Next  Tail  Head  Prev  Insrt  Del  Quit: i
	Enter a key: 002
	...inserted
	Find  Next  Tail  Head  Prev  Insrt  Del  Quit: f
	Key to Find: 002
	not found: closest before=001
	Find  Next  Tail  Head  Prev  Insrt  Del  Quit: n
	current=002
	Find  Next  Tail  Head  Prev  Insrt  Del  Quit: q

Note that the routines run well if the key is always 1 greater than the last
key in the index.  This is on SCO Xenix 286, and although offhand it doesn't
look like a classic 286 problem, the btree node manipulation code is pretty
tricky and I'm not sure.  I'd appreciate any suggestions from anyone who has
seen this problem and fixed it.  I'll post a patch to comp.sources.misc if I
get it.

Thanks, etc., Tony Olekshy (...!alberta!oha!tony or tony at oha.UUCP).



More information about the Comp.sources.bugs mailing list