More sanity checking.

This commit is contained in:
Sears Russell 2008-02-19 21:26:31 +00:00
parent af149cdad1
commit 19949af99d

View file

@ -226,6 +226,7 @@ byte * stasis_record_write_begin(int xid, Page * p, recordid rid) {
abort(); abort();
} }
} }
assert(stasis_record_length_read(xid, p, rid) == stasis_record_type_to_size(rid.size));
return page_impls[page_type].recordWrite(xid, p, rid); return page_impls[page_type].recordWrite(xid, p, rid);
} }
void stasis_record_read_done(int xid, Page *p, recordid rid, const byte *b) { void stasis_record_read_done(int xid, Page *p, recordid rid, const byte *b) {
@ -241,8 +242,10 @@ void stasis_record_write_done(int xid, Page *p, recordid rid, byte *b) {
} }
} }
int stasis_record_type_read(int xid, Page *p, recordid rid) { int stasis_record_type_read(int xid, Page *p, recordid rid) {
return page_impls[*stasis_page_type_ptr(p)] if(page_impls[*stasis_page_type_ptr(p)].recordGetType)
.recordGetType(xid, p, rid); return page_impls[*stasis_page_type_ptr(p)].recordGetType(xid, p, rid);
else
return INVALID_SLOT;
} }
void stasis_record_type_write(int xid, Page *p, recordid rid, int type) { void stasis_record_type_write(int xid, Page *p, recordid rid, int type) {
page_impls[*stasis_page_type_ptr(p)] page_impls[*stasis_page_type_ptr(p)]