This function reads a specified log file to check it for compatibility with the current database and to enumerate its labels.
MCO_RET mco_translog_query_info (mco_db_h db,
char const *file_path,
mco_TL_labels_proc labels_proc,
void * user_data,
mco_TL_log_info_h info);
db
file_path
labels_proc
NULL if it is not used.user_data
labels_proc.info
typedef struct mco_TL_log_info_
{
mco_trans_counter_t start_trans_counter;
mco_trans_counter_t stop_trans_counter;
mco_trans_counter_t stored_transactions;
uint2 disk_page_size;
uint2 page_size;
mco_size_t log_size;
int labels_count;
mco_bool crc;
mco_bool aligned;
mco_bool dictionary_compat;
mco_bool transaction_apply_compat;
mco_bool transaction_append_compat;
mco_bool not_corrupted;
mco_bool iteratable;
} mco_TL_log_info_t,*mco_TL_log_info_h;
Note: This argument may be NULL if it is not used (i.e., if the function is used only to
enumerate labels). The structure elements are explained below.
This function reads a specified log file to check it for compatibility with the current database and to enumerate its labels.
MCO_S_OK
MCO_E_TL_LOG_NOT_OPENED
MCO_E_TL_IO_ERROR
MCO_E_VERS_MISMATCH
MCO_E_TL_INVFORMAT
MCO_S_TL_INVDATA
info.transaction_apply_compat will be MCO_YES,
info.not_corrupted will be MCO_NO, and
info.transaction_append_compat will be MCO_NO.The structure elements for mco_TL_log_info_t are defined as follows:
start_trans_counter
stop_trans_counter
stored_transactions
disk_page_size
page_size
log_size
labels_count
crc
aligned
dictionary_compat
MCO_YES if the log file is compatible with the database specified by the argument
db; otherwise MCO_NO.transaction_apply_compat
MCO_YES if the log file is compatible for applying to the database specified by the argument
db (by transaction number); otherwise MCO_NO.transaction_append_compat
MCO_YES if the log file is compatible for appending to the database specified by the argument
db (by transaction number); otherwise MCO_NO.not_corrupted
MCO_YES if no data has been lost since the last savepoint.iteratable
The user-defined callback procedure labels_proc must have the following prototype:
typedef void(*mco_TL_labels_proc)(const char *label, int label_id, void *data);
Here, label is the label text, label_id is the integer value associated with this label
(generated by the TL runtime when the mco_translog_label() function
was called), and data is a pointer to application-specific data that may be used in the
implementation of the label procedure.