-
- else if (zi->reg->isamd)
- {
- ISAMD_PP *ispt;
- int i;
- struct trunc_info *ti;
-
- ispt = (ISAMD_PP *) xmalloc (sizeof(*ispt) * (to-from));
-
- ti = heap_init (to-from, sizeof(struct it_key),
- key_compare_it);
- for (i = to-from; --i >= 0; )
- {
- logf(LOG_FATAL, "isam_d does not (currently) support truncs");
- abort();
- /*ispt[i] = isamd_pp_open (zi->reg->isamd, isam_p[from+i]); */
- if (isamd_pp_read (ispt[i], ti->tmpbuf))
- heap_insert (ti, ti->tmpbuf, i);
- else
- isamd_pp_close (ispt[i]);
- }
- while (ti->heapnum)
- {
- int n = ti->indx[ti->ptr[1]];
-
- rset_write (result, result_rsfd, ti->heap[ti->ptr[1]]);
-#if 0
-/* section that preserve all keys */
- heap_delete (ti);
- if (isamd_pp_read (ispt[n], ti->tmpbuf))
- heap_insert (ti, ti->tmpbuf, n);
- else
- isamd_pp_close (ispt[n]);
-#else
-/* section that preserve all keys with unique sysnos */
- while (1)
- {
- if (!isamd_pp_read (ispt[n], ti->tmpbuf))
- {
- heap_delete (ti);
- isamd_pp_close (ispt[n]);
- break;
- }
- if ((*ti->cmp)(ti->tmpbuf, ti->heap[ti->ptr[1]]) > 1)
- {
- heap_delete (ti);
- heap_insert (ti, ti->tmpbuf, n);
- break;
- }
- }
-#endif
- }
- heap_close (ti);
- xfree (ispt);
- }