MySQL 26.7.0
Source Code Documentation
read0read_view_interface.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 2023, 2026, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27#pragma once
28
29#include "trx0types.h"
30
31struct table_name_t;
32
34 public:
35 virtual ~Read_view_interface() = default;
36
37 /** Check whether the changes by id are visible.
38 @param[in] id transaction id to check against the view
39 @return whether the view sees the modifications of id. */
40 [[nodiscard]] virtual bool changes_visible(trx_id_t id) const = 0;
41
42 /** Checks if changes made by each trx with trx->id smaller or equal to id,
43 should be visible to this read view.
44 Conceptually equivalent to: forall x<=id . changes_visible(x).
45 @param[in] id max transaction id to check
46 @return true if view sees all transactions with smaller or equal id */
48 trx_id_t id) const = 0;
49
50 /** This read view does not need Undo Logs generated by transactions with
51 trx->no strictly smaller than this value.
52 @return safe estimate of the lowest value of TRX_UNDO_TRX_NO header in Undo
53 Logs still needed to support this read view */
54 [[nodiscard]] virtual trx_id_t get_lowest_needed_trx_no() const = 0;
55
56 /** Describe the read-view.
57 @param[in] file file to write to */
58 virtual void print(FILE *file) const = 0;
59};
Definition: read0read_view_interface.h:33
virtual void print(FILE *file) const =0
Describe the read-view.
virtual trx_id_t get_lowest_needed_trx_no() const =0
This read view does not need Undo Logs generated by transactions with trx->no strictly smaller than t...
virtual bool changes_visible(trx_id_t id) const =0
Check whether the changes by id are visible.
virtual bool sees_all_trxs_with_id_smaller_or_equal_to(trx_id_t id) const =0
Checks if changes made by each trx with trx->id smaller or equal to id, should be visible to this rea...
virtual ~Read_view_interface()=default
const std::string FILE("FILE")
Definition: os0file.h:89
Table name wrapper for pretty-printing.
Definition: dict0mem.h:466
Transaction system global type definitions.
ib_id_t trx_id_t
Transaction identifier (DB_TRX_ID, DATA_TRX_ID)
Definition: trx0types.h:138