MySQL 8.0.40
Source Code Documentation
secondary_engine_costing_flags.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 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 SQL_JOIN_OPTIMIZER_SECONDARY_ENGINE_COSTING_FLAGS_H_
25#define SQL_JOIN_OPTIMIZER_SECONDARY_ENGINE_COSTING_FLAGS_H_
26
27#include <cstdint>
28
29/**
30 @file
31
32 For updating an AccessPath's costs by a secondary engine, i.e. costing
33 a partial plan, the secondary engine may need to know ahead of time
34 certain information about the current planning, for which we provide
35 some flags here.
36
37 */
38
40
46};
47
48/// Creates an empty bitmap of costing flags. This is the base
49/// case for the function template with the same name below.
51 return 0;
52}
53
54/// Creates a bitmap representing a set of costing flags.
55template <typename... Args>
57 const SecondaryEngineCostingFlag &flag1, const Args &...rest) {
58 return (uint64_t{1} << static_cast<SecondaryEngineCostingFlags>(flag1)) |
60}
61
65}
66
70}
71
75}
76
80}
81
85}
86
90}
91
94 return ~MakeSecondaryEngineCostingFlags(flag);
95}
96
97#endif /* SQL_JOIN_OPTIMIZER_SECONDARY_ENGINE_COSTING_FLAGS_H_ */
static int flag
Definition: hp_test1.cc:40
constexpr SecondaryEngineCostingFlags operator|(const SecondaryEngineCostingFlags &a, const SecondaryEngineCostingFlag &b)
Definition: secondary_engine_costing_flags.h:62
constexpr SecondaryEngineCostingFlags operator~(const SecondaryEngineCostingFlag &flag)
Definition: secondary_engine_costing_flags.h:92
uint64_t SecondaryEngineCostingFlags
Definition: secondary_engine_costing_flags.h:39
constexpr SecondaryEngineCostingFlags & operator&=(SecondaryEngineCostingFlags &a, const SecondaryEngineCostingFlag &b)
Definition: secondary_engine_costing_flags.h:87
SecondaryEngineCostingFlag
Definition: secondary_engine_costing_flags.h:41
constexpr SecondaryEngineCostingFlags MakeSecondaryEngineCostingFlags()
Creates an empty bitmap of costing flags.
Definition: secondary_engine_costing_flags.h:50
constexpr SecondaryEngineCostingFlags & operator|=(SecondaryEngineCostingFlags &a, const SecondaryEngineCostingFlag &b)
Definition: secondary_engine_costing_flags.h:72
constexpr SecondaryEngineCostingFlags operator&(const SecondaryEngineCostingFlags &a, const SecondaryEngineCostingFlag &b)
Definition: secondary_engine_costing_flags.h:77