The open table logic in c-treeDB attempts to determine if file names contain an extension. When a file name of the form Y.XXX.XXX was passed to ctsqlimp, it set the file name used to open the table to Y.XXX and the file extension to XXX. When it opened the file, it identified the file name as Y.XXX ending with the extension .XXX, which was incorrect.
New "extension handling hints" were added so that it is now possible to indicate if the default heuristic should be used, or to specify that the extension is present or missing before calling ctdbOpen(). This new flag is set by default to EXT_DETECT indicating to use the heuristic approach. Setting it to EXT_MISSING indicates that the extension is missing.
In addition, modifications were made to ctsqlimp to import tables with names of the form *.YYY.XXX (where XXX may or may not be the same as YYY).
When a table handle has been allocated on the session (no dictionary support is in use), you can call ctdbSetExtensionHint(hTable,...) before ctdbOpenTable() to indicate:
Calling ctdbSetExtensionHint(hDatabase,...) on a database handle allows setting the extension hint for ctdbAddTable() and ctdbAddTableXtd().
In addition to the hints described above, it is possible for the Xtd() version to use:
Function:
ctdbSetExtensionHint
Set extension hint in the handle to help with proper file name building at table open time.
Declaration
CTDBRET ctdbDECL ctdbSetExtensionHint(CTHANDLE Handle, EXT_INFO ExtHint)
Parameters:
EXT_DETECT - Backward compatible behavior: c-treeDB will detect if the file terminates with ".*" and remove it from the file name and then add the current table extension.
EXT_PRESENT - File names contain file extension: The file name is specified with file extension; c-treeDB will detect if the file terminates with ".*" and use what matches as extension, in case of no match the extension is set to "" (none).
EXT_MISSING - File names do not contain file extension: The file name is specified without extension; c-treeDB will add the current extension.
For ctdbAddTableXtd only:
EXT_PRESENT_L - Logical file name contains file extension; physical does not.
EXT_PRESENT_P - Physical file name contains file extension; logical does not.
Returns:
None