MySQL Internals Manual  /  Injecting Test Faults  /  Test Fault Macros

25.1 Test Fault Macros

  • DBUG_EXECUTE_IF (keyword, code) allows executing a piece of code if the appropriate dbug instruction is set. In this case, the dbug instruction should be +d,keyword.

  • DBUG_EVALUATE_IF (keyword, val1, val2) is used in if expressions and returns val1 if the appropriate dbug instruction is set. Otherwise, it returns val2. In this case, the dbug instruction should be +d,keyword.

  • DBUG_CRASH_ENTER (function) is equivalent to DBUG_ENTER, which registers the beginning of a function but in addition allows for crashing the server while entering the function if the appropriate dbug instruction is set. In this case, the dbug instruction should be +d,function_crash_enter.

  • DBUG_CRASH_RETURN (value) is equivalent to DBUG_RETURN which notifies the end of a function but in addition to it allows for crashing the server while returning from the function if the appropriate dbug instruction is set. In this case, the dbug instruction should be +d,function_crash_return. Note that "function" should be the same string used by the DBUG_ENTER.

  • DBUG_CRASH_VOID_RETURN is equivalent to DBUG_VOID_RETURN which notifies the end of a function but in addition to it allows for crashing the server while returning from the function if the appropriate dbug instruction is set. In this case, the dbug instruction should be +d,function_crash_return. Note that "function" should be the same string used by the DBUG_ENTER.


User Comments
Sign Up Login You must be logged in to post a comment.