Error messages
The database server cannot validate specifications for features that the access method adds. If the access method includes a feature that the database server cannot detect, the access method must explicitly handle syntax errors in requests for that feature. To handle errors that the database server cannot detect, call the DataBlade API mi_db_error_raise() function.
CREATE INDEX fuzzy ON text(keywords)
USING search_text(searchmode=’string’, wildcard=’yes’);
key_word = mi_tab_amparam (tableDesc);
if (strcmp (key_word, "searchmode") == 0)
{
...
}
else if (strcmp (key_word, "wildcard") == 0)
{
...
}
else
{
mi_db_error_raise (connection, MI_EXCEPTION,
"Invalid keyword in the USING clause.");
/* NOT REACHED */
}
mi_db_error_raise( connection, MI_Exception, "Invalid...");
If the function that calls mi_db_error_raise() did not register a callback function for MI_Exception (upper and lowercase), execution aborts after the Invalid... error message appears.
The database server cannot always determine that the access method does not support a feature that a user specifies. The access method can test for the presence of specifications and either provide the feature or raise an exception for those features that it cannot provide.
- mi_tab_mode()
- The input and output mode (read-only, read and write, write only, and log transactions)
- mi_tab_isolevel()
- The isolation level
- mi_scan_locktype()
- The lock type for the scan
- mi_scan_isolevel()
- The isolation level in force