Previous Topic

Next Topic

IMPORTANT - Data Record Delete Flag

c-tree Plus uses the first byte of fixed-length data records for a delete flag. When a fixed-length data record is deleted, because of a call to either DeleteRecord() or ReleaseData(), the first byte is set to 0xff. The rebuild and compact utilities check this first byte to determine if a record is active or deleted. Also, whenever a record is about to be reused by NewData(), which is automatically called by AddRecord(), the first byte is checked to be sure that an active record is not about to be reused by mistake.

It is not necessary to reserve this byte if your application stores only ASCII characters in the first byte; however, you should not store binary data in the first byte or set the first field in your DODA to a binary or numeric type.

To protect against this error, c-tree Plus checks the beginning of records for certain values. AddRecord() and ReWriteRecord() return FBEG_ERR (553) if a record begins with either a delete flag (0xFF) or a resource mark (0xFEFE). This capability can be disabled:

  • For non-server applications, disable the check by compiling with NO_ctBEHAV_CHECKFIX defined.
  • For client/server applications, the configuration keyword COMPATIBILITY NO_CHECKFIX turns off this check.