MySQL 9.0.0
Source Code Documentation
log0test.h File Reference

Redo log - helper for unit tests. More...

#include <memory>
#include "log0types.h"
#include "my_dbug.h"
#include "my_sys.h"
#include "sql/current_thd.h"
#include "sql/debug_sync.h"

Go to the source code of this file.

Classes

class  Log_test
 It is a environment for tests of redo log. More...
 
struct  Log_test::Page
 
class  Log_test::Sync_point
 

Functions

template<size_t N>
static void log_sync_point (const char(&sync_point_name)[N])
 This function is responsible for three actions: More...
 

Variables

std::unique_ptr< Log_testlog_test
 Represents currently running test of redo log, nullptr otherwise. More...
 

Detailed Description

Redo log - helper for unit tests.

Function Documentation

◆ log_sync_point()

template<size_t N>
static void log_sync_point ( const char(&)  sync_point_name[N])
static

This function is responsible for three actions:

  1. Defines a conditional sync point with name = sync_point_name (
    See also
    CONDITIONAL_SYNC_POINT).
  2. Crashes MySQL if debug variable with name = "crash_" + sync_poit_name is defined. You could use following approach to crash it: SET GLOBAL DEBUG = '+d,crash_foo' (if sync_point_name='foo')
  3. Notifies log_test (unless it's nullptr) about the sync point.
Parameters
[in]sync_point_namename of syncpoint, must be a string literal

Variable Documentation

◆ log_test

std::unique_ptr<Log_test> log_test
extern

Represents currently running test of redo log, nullptr otherwise.