The mi_tab_check_is_recheck() accessor function

The mi_tab_check_is_recheck() function indicates whether the current execution of the am_check purpose function should repair a specific problem that the previous execution detected.

Syntax

mi_boolean mi_tab_check_is_recheck(MI_AM_TABLE_DESC *tableDesc)
tableDesc
Points to the table descriptor of the index that the current oncheck command specifies.

Usage

Call this function in am_check purpose function to determine if the following sequence of events occurred:
  1. A user issued an oncheck request but did not include -y or -n in the option arguments.
  2. In response to an oncheck request, the database server invoked the am_check purpose function.
  3. During the first execution of am_check, the purpose function detected a problem with the index, called mi_tab_check_set_ask() to alert the database server, and exited.
  4. The database server prompted the user to indicate if the access method should repair the index.
  5. The user answered y or yes to the prompt, and the database server executed am_check again for the same index with -y appended to the original options.
In addition to mi_tab_check_is_recheck(), the access method should do the following to support index repair during oncheck:
  • Store a description of the problem in PER_STATEMENT memory and call mi_tab_setuserdata() to place a pointer to the PER_STATEMENT memory in the table descriptor.
  • Contain the logic required to repair the index.
  • If mi_tab_check_is_recheck() returns MI_True, execute the logic that repairs the index.

Return values

MI_TRUE
Indicates that this execution of am_check is a recheck and should attempt to repair the index.
MI_FALSE
Indicates that this is the first execution of am_check for a new oncheck request.