MySQL 9.1.0
Source Code Documentation
ut0test.h File Reference
#include <string>
#include <vector>
#include "current_thd.h"
#include "fil0fil.h"
#include "mysql/plugin.h"

Go to the source code of this file.

Classes

struct  ib::Tester
 This class contains implementations of the commands that can be executed at server side by passing them via the innodb_interpreter system variable. More...
 

Namespaces

namespace  ib
 

Macros

#define TPREFIX   "[ib::Tester] "
 This is the prefix used for the log messages that will be updated in the innodb_interpreter_output system variable. More...
 
#define TLOG(x)
 
#define XLOG(x)
 A macro to log output in both the server error log (via std::cout, the standard output) and the server system variable innodb_interpreter_output. More...
 
#define DISPATCH_FUNCTION(func_)
 A macro to declare a dispatch function or a command function. More...
 

Functions

int ib::interpreter_run (const char *command) noexcept
 The main function to execute the commands in the tester. More...
 
void ib_interpreter_update (MYSQL_THD thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the innodb_interpreter_output system variable to let the user access the output generated by the tester. More...
 
int ib_interpreter_check (THD *thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
 Check whether given command is valid for the InnoDB interpreter Refer to mysql_var_check_func() for more details. More...
 

Macro Definition Documentation

◆ DISPATCH_FUNCTION

#define DISPATCH_FUNCTION (   func_)
Value:
/* @param[in] tokens the command line */ \
/* @return RET_PASS on success, or the error code. */ \
[[nodiscard]] Ret_t func_(std::vector<std::string> &tokens) noexcept
Tester::Ret_t Ret_t
Definition: ut0test.cc:53

A macro to declare a dispatch function or a command function.

They all have the same signature.

Parameters
[in]func_the function that is being declared.

◆ TLOG

#define TLOG (   x)
Value:
{ \
std::cout << "[TLOG] thread=" << std::this_thread::get_id() << ": " << x \
<< std::endl; \
}
pid_type get_id()
Definition: process.h:48

◆ TPREFIX

#define TPREFIX   "[ib::Tester] "

This is the prefix used for the log messages that will be updated in the innodb_interpreter_output system variable.

◆ XLOG

#define XLOG (   x)
Value:
{ \
TLOG(x) \
sout << x; \
}

A macro to log output in both the server error log (via std::cout, the standard output) and the server system variable innodb_interpreter_output.

To use this macro, there must be a std::ostringstream object "sout" available in the scope in which it is used.

Function Documentation

◆ ib_interpreter_check()

int ib_interpreter_check ( THD thd,
SYS_VAR var,
void *  save,
struct st_mysql_value value 
)

Check whether given command is valid for the InnoDB interpreter Refer to mysql_var_check_func() for more details.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]saveimmediate result for update function
[in]valueincoming string
Returns
0 for valid command.

◆ ib_interpreter_update()

void ib_interpreter_update ( MYSQL_THD  thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)

Update the innodb_interpreter_output system variable to let the user access the output generated by the tester.

Refer to mysql_var_update_func() for details of the function signature.

Parameters
[in]thdthread handle
[in]vardynamic variable being altered
[in]var_ptrpointer to dynamic variable
[in]savepointer to temporary storage.