The mi_tab_check_set_ask() accessor function

The mi_tab_check_set_ask() function sets a flag in the table descriptor to indicate that am_check detects a repairable problem in the index.

Syntax

mi_integer mi_tab_check_set_ask(MI_AM_TABLE_DESC *tableDesc,
   mi_integer option)
tableDesc
Points to the table descriptor of the index that the current oncheck command specifies.
option
contains an encoded version of the current command-line option string for the oncheck utility.

Usage

Call this function from the am_check purpose function to alert the database server of the following conditions:
  • The access method detects a structural problem or data-integrity problem in an index.
  • The access method contains appropriate logic to repair the problem.
  • The user does not specify -y or -n with an oncheck command.

A user includes a -y option to indicate that the oncheck utility should repair any index problems that it detects. To indicate that oncheck should report problems but not repair them, the user includes a -n option with oncheck.

The am_check purpose function can check for the -y option with the MI_CHECK_YES_TO_ALL() macro and for -n with MI_CHECK_NO_TO_ALL(). If both MI_CHECK_YES_TO_ALL() and MI_CHECK_NO_TO_ALL() return MI_FALSE, the user did not specify a preference to repair or not repair problems. Because it does not know how to proceed, am_check can call accessor function mi_tab_check_set_ask(), which causes the database server to ask if the user wants the index repaired.

Return values

MI_OK
Validates the index structure as error free.
MI_ERROR
Indicates the access method could not validate the index structure as error free.