MySQL 9.0.0
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
48};
49
50/// Creates an empty bitmap of costing flags. This is the base
51/// case for the function template with the same name below.
53 return 0;
54}
55
56/// Creates a bitmap representing a set of costing flags.
57template <typename... Args>
59 const SecondaryEngineCostingFlag &flag1, const Args &... rest) {
60 return (uint64_t{1} << static_cast<SecondaryEngineCostingFlags>(flag1)) |
62}
63
67}
68
72}
73
77}
78
82}
83
87}
88
92}
93
96 return ~MakeSecondaryEngineCostingFlags(flag);
97}
98
99#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:64
constexpr SecondaryEngineCostingFlags operator~(const SecondaryEngineCostingFlag &flag)
Definition: secondary_engine_costing_flags.h:94
uint64_t SecondaryEngineCostingFlags
Definition: secondary_engine_costing_flags.h:39
constexpr SecondaryEngineCostingFlags & operator&=(SecondaryEngineCostingFlags &a, const SecondaryEngineCostingFlag &b)
Definition: secondary_engine_costing_flags.h:89
SecondaryEngineCostingFlag
Definition: secondary_engine_costing_flags.h:41
constexpr SecondaryEngineCostingFlags MakeSecondaryEngineCostingFlags()
Creates an empty bitmap of costing flags.
Definition: secondary_engine_costing_flags.h:52
constexpr SecondaryEngineCostingFlags & operator|=(SecondaryEngineCostingFlags &a, const SecondaryEngineCostingFlag &b)
Definition: secondary_engine_costing_flags.h:74
constexpr SecondaryEngineCostingFlags operator&(const SecondaryEngineCostingFlags &a, const SecondaryEngineCostingFlag &b)
Definition: secondary_engine_costing_flags.h:79