ctdbSetSegmentMode
Set the segment mode.
Declaration
CTDBRET ctdbSetSegmentMode(CTHANDLE Handle, CTSEG_MODE SegMode)
Description
ctdbSetSegmentMode() sets the segment mode. When the table is created, the segment mode is defined with the segments. If this information has to be changed later, ctdbSetSegmentMode() may be used. In this case, ctdbAlterTable() must be called after that to modify the table structure. Use ctdbGetSegmentMode() to retrieve the segment mode.
Returns
ctdbSetSegmentMode() returns CTDBRET_OK on success, or c-treeDB API C API error on failure.
Example
seg = ctdbGetSegmentMode(hSegment);
if (seg == CTSEG_SCHSEG)
{
err = ctdbSetSegmentMode(hSegment, CTSEG_USCHSEG);
err = ctdbAlterTable(hTable);
}
See also
ctdbAllocSegment(), ctdbGetSegmentMode(), ctdbAlterTable()