The mi_scan_userdata() accessor function

The mi_scan_userdata() function retrieves the pointer from the scan descriptor that points to a user data structure.

Syntax

void* mi_scan_userdata(MI_AM_SCAN_DESC *scanDesc);
scanDesc
Points to the scan descriptor.

Usage

If the access method allocates user-data memory to hold scan-state information, it places a pointer to that user data in the scan descriptor. Use the mi_scan_userdata() function to retrieve the pointer for access to the user data.

For example, the am_getnext might maintain a row pointer to keep track of its progress through the table during a scan. Each time am_getnext prepares to exit, it stores the address or row identifier of the row that it just processed. The next execution of am_getnext retrieves and increments the address to fetch the next entry in the index.

Return values

This function returns a pointer to a user-data structure that the access method creates during the scan.