130#define TPREFIX "[ib::Tester] "
134 std::cout << "[TLOG] thread=" << std::this_thread::get_id() << ": " << x \
176 [[nodiscard]]
Ret_t run(const
std::
string &cmd) noexcept;
181 return m_log.c_str();
190 void init() noexcept;
245#define DISPATCH_FUNCTION(func_) \
248 [[nodiscard]] Ret_t func_(std::vector<std::string> &tokens) noexcept
270 std::vector<std::string> &tokens)
noexcept;
276 std::vector<std::string> &tokens)
noexcept;
316 const
size_t prefix_length);
334 using Pair = std::pair<const std::string, Function_executor>;
338 std::map<std::string, Function_executor, std::less<std::string>,
Allocator>
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:52
uint32_t page_no_t
Page number.
Definition: api0api.h:50
#define MYSQL_THD
Definition: backup_page_tracker.h:38
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Allocator that allows std::* containers to manage their memory through ut::malloc* and ut::free libra...
Definition: ut0new.h:2182
The low-level file system.
int interpreter_run(const char *command) noexcept
The main function to execute the commands in the tester.
Definition: ut0test.cc:699
const char * table_name
Definition: rules_table_service.cc:56
Definition: gcs_xcom_synode.h:64
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:48
std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > > ostringstream
Specialization of basic_ostringstream which uses ut::allocator.
Definition: ut0new.h:2871
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2875
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2879
Data structure for a database table.
Definition: dict0mem.h:1909
This class contains implementations of the commands that can be executed at server side by passing th...
Definition: ut0test.h:152
std::string m_log
The actual log data that is shared with the client via the thread-variable innodb_interpreter_output.
Definition: ut0test.h:328
std::list< dict_table_t *, ut::allocator< dict_table_t * > > m_open_tables
List of open tables.
Definition: ut0test.h:320
void clear_output() noexcept
Make the output empty.
Definition: ut0test.cc:695
Ret_t clear_page_prefix(const space_id_t space_id, page_no_t page_no, const size_t prefix_length)
Make the first prefix_length bytes of the given page as zeroes.
Definition: ut0test.cc:437
DISPATCH_FUNCTION(count_used_and_free)
Count various page_types for given tablespace.
Ret_t
The return status code used by the various commands in this module.
Definition: ut0test.h:155
@ RET_CMD_TBD
Definition: ut0test.h:160
@ RET_PASS
Definition: ut0test.h:156
@ RET_FAIL
Definition: ut0test.h:157
Ret_t corrupt_ondisk_root_page(std::vector< std::string > &tokens) noexcept
Corrupt the root page of the given table.
Definition: ut0test.cc:401
DISPATCH_FUNCTION(dblwr_force_crash)
Set the dblwr::Force_crash to the desired page.
void close_table(dict_table_t *table) noexcept
Close the given table.
Definition: ut0test.cc:602
std::pair< const std::string, Function_executor > Pair
Definition: ut0test.h:334
Tester() noexcept
Default constructor.
Definition: ut0test.cc:53
Ret_t find_ondisk_page_type(std::vector< std::string > &tokens) noexcept
Find the on-disk page type of the given page.
Definition: ut0test.cc:279
Ret_t corrupt_ondisk_page0(std::vector< std::string > &tokens) noexcept
Corrupt the first page of the given tablespace.
Definition: ut0test.cc:519
DISPATCH_FUNCTION(make_ondisk_root_page_zeroes)
Fill the root page of the given table with zeroes.
Ret_t find_tablespace_file_name(std::vector< std::string > &tokens) noexcept
Obtain the file name of the given tablespace.
Definition: ut0test.cc:350
Ret_t open_table(std::vector< std::string > &tokens) noexcept
Open the specified table.
Definition: ut0test.cc:174
void destroy() noexcept
Destroy the tester object.
Definition: ut0test.cc:614
THD * m_thd
Current thread object.
Definition: ut0test.h:323
Ret_t find_space_id(std::vector< std::string > &tokens) noexcept
Find the space_id of the given table.
Definition: ut0test.cc:199
std::string m_command
The latest command executed.
Definition: ut0test.h:331
const char * get_last_log() const noexcept
Get the last generated output.
Definition: ut0test.h:180
Ret_t find_flush_sync_lsn(std::vector< std::string > &tokens) noexcept
Find the flush sync lsn from the buffer pool module.
Definition: ut0test.cc:623
Ret_t find_root_page_no(std::vector< std::string > &tokens) noexcept
Find the root page of the given table.
Definition: ut0test.cc:226
void append_output(const std::string &log) noexcept
Append the given string to the output value of the interpreter.
Definition: ut0test.cc:697
DISPATCH_FUNCTION(make_page_dirty)
Make the page dirty.
Ret_t find_fil_page_lsn(std::vector< std::string > &tokens) noexcept
Find the FIL_PAGE_LSN of the given page.
Definition: ut0test.cc:253
std::map< std::string, Function_executor, std::less< std::string >, Allocator > m_dispatch
Mapping b/w the command name and the function to execute.
Definition: ut0test.h:339
void set_output(const std::ostringstream &sout) noexcept
Set the output value of the interpreter.
Definition: ut0test.cc:689
void update_thd_variable() noexcept
Let the thread-variable innodb_interpreter_output point to the current output.
Definition: ut0test.cc:681
Ret_t print_dblwr_has_encrypted_pages(std::vector< std::string > &tokens) noexcept
Print the page type of pages in dblwr file to server error log.
Definition: ut0test.cc:585
DISPATCH_FUNCTION(find_tablespace_physical_page_size)
Obtain the page size of the given tablespace.
Ret_t run(ulong cmd) noexcept
Run the given command.
void init() noexcept
Initialize the internal state of the tester.
Definition: ut0test.cc:73
dict_table_t * is_table_open(const std::string &table_name) const noexcept
Check if the given table is already opened.
Definition: ut0test.cc:161
Ret_t(Tester::*)(std::vector< std::string > &) Function_executor
Definition: ut0test.h:333
DISPATCH_FUNCTION(count_page_type)
Count various page_types for given tablespace.
Definition: system_variables_bits.h:94
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 t...
Definition: ut0test.cc:705
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 m...
Definition: ut0test.cc:716
command
Definition: version_token.cc:280