MySQL 8.0.32
Source Code Documentation
secondary_engine_costing_flags.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 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 also distributed 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 included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef SQL_JOIN_OPTIMIZER_SECONDARY_ENGINE_COSTING_FLAGS_H_
24#define SQL_JOIN_OPTIMIZER_SECONDARY_ENGINE_COSTING_FLAGS_H_
25
26#include <cstdint>
27
28/**
29 @file
30
31 For updating an AccessPath's costs by a secondary engine, i.e. costing
32 a partial plan, the secondary engine may need to know ahead of time
33 certain information about the current planning, for which we provide
34 some flags here.
35
36 */
37
39
45};
46
47/// Creates an empty bitmap of costing flags. This is the base
48/// case for the function template with the same name below.
50 return 0;
51}
52
53/// Creates a bitmap representing a set of costing flags.
54template <typename... Args>
56 const SecondaryEngineCostingFlag &flag1, const Args &... rest) {
57 return (uint64_t{1} << static_cast<SecondaryEngineCostingFlags>(flag1)) |
59}
60
64}
65
69}
70
74}
75
79}
80
84}
85
89}
90
93 return ~MakeSecondaryEngineCostingFlags(flag);
94}
95
96#endif /* SQL_JOIN_OPTIMIZER_SECONDARY_ENGINE_COSTING_FLAGS_H_ */
static int flag
Definition: hp_test1.cc:39
constexpr SecondaryEngineCostingFlags operator|(const SecondaryEngineCostingFlags &a, const SecondaryEngineCostingFlag &b)
Definition: secondary_engine_costing_flags.h:61
constexpr SecondaryEngineCostingFlags operator~(const SecondaryEngineCostingFlag &flag)
Definition: secondary_engine_costing_flags.h:91
uint64_t SecondaryEngineCostingFlags
Definition: secondary_engine_costing_flags.h:38
constexpr SecondaryEngineCostingFlags & operator&=(SecondaryEngineCostingFlags &a, const SecondaryEngineCostingFlag &b)
Definition: secondary_engine_costing_flags.h:86
SecondaryEngineCostingFlag
Definition: secondary_engine_costing_flags.h:40
constexpr SecondaryEngineCostingFlags MakeSecondaryEngineCostingFlags()
Creates an empty bitmap of costing flags.
Definition: secondary_engine_costing_flags.h:49
constexpr SecondaryEngineCostingFlags & operator|=(SecondaryEngineCostingFlags &a, const SecondaryEngineCostingFlag &b)
Definition: secondary_engine_costing_flags.h:71
constexpr SecondaryEngineCostingFlags operator&(const SecondaryEngineCostingFlags &a, const SecondaryEngineCostingFlag &b)
Definition: secondary_engine_costing_flags.h:76