* Sebastian Hammer, Adam Dickmeiss
*
* $Log: mfile.c,v $
- * Revision 1.16 1995-12-12 15:57:57 adam
+ * Revision 1.17 1996-03-20 13:29:11 quinn
+ * Bug-fix
+ *
+ * Revision 1.16 1995/12/12 15:57:57 adam
* Implemented mf_unlink. cf_unlink uses mf_unlink.
*
* Revision 1.15 1995/12/08 16:21:14 adam
/* file needs to grow */
while (ps >= mf->files[mf->cur_file].blocks)
{
- logf (LOG_DEBUG, "File grows");
/* file overflow - allocate new file */
if (mf->files[mf->cur_file].dir->max_bytes >= 0 &&
(ps - mf->files[mf->cur_file].blocks + 1) * mf->blocksize >
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: memory.c,v $
- * Revision 1.12 1996-03-11 14:52:23 quinn
+ * Revision 1.13 1996-03-20 13:29:16 quinn
+ * Bug-fix
+ *
+ * Revision 1.12 1996/03/11 14:52:23 quinn
* Fixed update bug. Repeated insertion in the same area sometimes caused
* problems.
*
mbuf = tab->cur_mblock->cur_mbuf = mbuf->next;
mbuf->cur_record = 0;
}
+ /*
logf (LOG_DEBUG, "is_m_write_rec(rec == %d)", mbuf->cur_record);
+ */
memcpy(mbuf->data + mbuf->offset + mbuf->cur_record * is_keysize(tab->is),
rec, is_keysize(tab->is));
mbuf->num++;
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: physical.c,v $
- * Revision 1.10 1996-03-19 19:22:44 quinn
+ * Revision 1.11 1996-03-20 13:29:17 quinn
+ * Bug-fix
+ *
+ * Revision 1.10 1996/03/19 19:22:44 quinn
* Fixed update-bug
*
* Revision 1.9 1996/02/06 10:19:57 quinn
sizeof(tab->num_records));
buf->offset +=sizeof(tab->num_records);
}
+ logf(LOG_DEBUG, "R: Block #%d: num %d nextpos %d total %d",
+ block->diskpos, block->num_records, block->nextpos,
+ block == tab->data ? tab->num_records : -1);
buf->num = (toread - buf->offset) / is_keysize(tab->is);
if (buf->num >= block->num_records)
{
sizeof(tab->num_records));
sum += sizeof(tab->num_records);
}
+ logf (LOG_DEBUG, "W: Block #%d contains %d records.", p->diskpos,
+ p->num_records);
for (b = p->data; b; b = b->next)
{
- memcpy(type->dbuf + sum, b->data + b->offset, v = b->num *
- is_keysize(tab->is));
+ logf(LOG_DEBUG, " buf: offset %d, keys %d, type %d, ref %d",
+ b->offset, b->num, b->type, b->refcount);
+ if ((v = b->num * is_keysize(tab->is)) > 0)
+ memcpy(type->dbuf + sum, b->data + b->offset, v);
sum += v;
assert(sum <= type->blocksize);
logf (LOG_FATAL, "Failed to write block.");
exit(1);
}
- logf (LOG_DEBUG, "W: Block #%d contains %d records.", p->diskpos, p->num_records);
}
}
}
else
{
- tab->data = tab->data->next;
- next = tab->data;
+ next = tab->data->next;
if (next)
{
if (next->state < IS_MBSTATE_CLEAN)
}
}
next->state = IS_MBSTATE_DIRTY; /* force re-process */
+ tab->data = next;
}
}
if (mblock->diskpos >= 0)