MySQL 8.4.0
Source Code Documentation
pfs.h
Go to the documentation of this file.
1/* Copyright (c) 2023, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef PLUGIN_PFS_TABLE_BINLOG_STORAGE_ITERATOR_TESTS_H_
25#define PLUGIN_PFS_TABLE_BINLOG_STORAGE_ITERATOR_TESTS_H_
26
29#include <string>
31#include "mysql_version.h"
32
34
35const std::string TABLE_NAME{"binlog_storage_iterator_entries"};
36
37static const uint32_t MAX_STORAGE_NAME_SIZE{1024};
38
41
42struct Row {
45 std::string event_name{};
46 std::string storage_details{};
47 std::string trx_tsid{};
48 uint64_t trx_seqno{0};
49 uint64_t start_position{0};
50 uint64_t end_position{0};
51 std::string extra{};
52
53 void reset() {
56 storage_details = "";
57 trx_seqno = 0;
58 trx_tsid = "";
60 extra = "";
61 }
62};
63
64/* A structure to define a handle for table in plugin/component code. */
66 struct Row row;
70 unsigned char *buffer{nullptr};
71 uint64_t buffer_capacity{0};
72 uint64_t buffer_size{0};
73 unsigned long long s_current_row_pos{0};
74 bool is_error{false};
75
76 bool extend_buffer_capacity(uint64_t size = 0);
77 void delete_buffer() const;
78};
79
83int rnd_init(PSI_table_handle *h, bool scan);
85
86} // namespace binlog::service::iterators::tests
87
88#endif /* PLUGIN_PFS_TABLE_BINLOG_STORAGE_ITERATOR_TESTS_H_ */
For binlog version 4.
Definition: control_events.h:239
#define BINLOG_VERSION
binlog_version 3 is MySQL 4.x; 4 is MySQL 5.0.0.
Definition: binlog_event.h:106
#define MYSQL_SERVER_VERSION
Definition: mysql_version.h:12
void close_table(PSI_table_handle *h)
Definition: pfs.cc:294
int rnd_next(PSI_table_handle *h)
Definition: pfs.cc:327
static const uint32_t MAX_STORAGE_NAME_SIZE
Definition: pfs.h:37
PSI_table_handle * open_table(PSI_pos **pos)
Definition: pfs.cc:266
bool register_pfs_tables()
Definition: pfs.cc:220
bool unregister_pfs_tables()
Definition: pfs.cc:233
int rnd_init(PSI_table_handle *h, bool scan)
Definition: pfs.cc:430
void init_share(PFS_engine_table_share_proxy *share)
Definition: pfs.cc:481
const std::string TABLE_NAME
Definition: pfs.h:35
Log_event_type
Enumeration type for the different types of log events.
Definition: binlog_event.h:286
@ UNKNOWN_EVENT
Every time you add a type, you have to.
Definition: binlog_event.h:294
const std::string & get_event_type_as_string(Log_event_type type)
Get the event type as string object.
Definition: binlog_event.cpp:80
size_t size(const char *const c)
Definition: base64.h:46
static int handle(int sql_errno, const char *sqlstate, const char *message, void *state)
Bridge function between the C++ API offered by this module and the C API of the parser service.
Definition: services.cc:64
struct PSI_table_handle PSI_table_handle
This is an opaque structure to denote table handle in plugin/component code.
Definition: pfs_plugin_table_service.h:97
struct PSI_pos PSI_pos
This is an opaque structure to denote cursor position in plugin/component code.
Definition: pfs_plugin_table_service.h:102
A share to be initialized by plugin/component code and to be provided to add_table() service method o...
Definition: pfs_plugin_table_service.h:462
void delete_buffer() const
Definition: pfs.cc:239
unsigned char * buffer
Definition: pfs.h:70
my_h_binlog_storage_iterator iterator
Definition: pfs.h:69
unsigned long long s_current_row_pos
Definition: pfs.h:73
bool extend_buffer_capacity(uint64_t size=0)
Definition: pfs.cc:241
mysql::binlog::event::Format_description_event fde
Definition: pfs.h:67
void reset()
Definition: pfs.h:53
std::string event_name
Definition: pfs.h:45
uint64_t start_position
Definition: pfs.h:49
mysql::binlog::event::Log_event_type event_type
Definition: pfs.h:43
uint64_t end_position
Definition: pfs.h:50
uint64_t trx_seqno
Definition: pfs.h:48
std::string storage_details
Definition: pfs.h:46
std::string trx_tsid
Definition: pfs.h:47
Definition: file_storage.cc:430
Part of traditional "extra" column or related hierarchical property.
Definition: opt_explain_format.h:267