MySQL  8.0.27
Source Code Documentation
opt_explain_traditional.h
Go to the documentation of this file.
1 /* Copyright (c) 2011, 2021, 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 OPT_EXPLAIN_FORMAT_TRADITIONAL_INCLUDED
24 #define OPT_EXPLAIN_FORMAT_TRADITIONAL_INCLUDED
25 
26 #include <assert.h>
27 // assert
28 #include "sql/opt_explain_format.h"
30 
31 class Item;
32 class Query_result;
33 class Query_expression;
34 template <class T>
35 class mem_root_deque;
36 
37 /**
38  Formatter for the traditional EXPLAIN output
39 */
40 
42  class Item_null *nil;
43  qep_row column_buffer; ///< buffer for the current output row
44 
45  public:
47 
48  bool is_hierarchical() const override { return false; }
49  bool send_headers(Query_result *result) override;
51  const Explain_format_flags *) override {
52  return false;
53  }
54  bool end_context(enum_parsing_context) override { return false; }
55  bool flush_entry() override;
56  qep_row *entry() override { return &column_buffer; }
57 
58  private:
60 };
61 
63  public:
64  Explain_format_tree() = default;
65 
66  bool is_hierarchical() const override { return false; }
67  bool send_headers(Query_result *) override {
68  assert(false);
69  return true;
70  }
72  const Explain_format_flags *) override {
73  assert(false);
74  return true;
75  }
77  assert(false);
78  return true;
79  }
80  bool flush_entry() override {
81  assert(false);
82  return true;
83  }
84  qep_row *entry() override {
85  assert(false);
86  return nullptr;
87  }
88  bool is_tree() const override { return true; }
89 
90  private:
92 };
93 
94 #endif // OPT_EXPLAIN_FORMAT_TRADITIONAL_INCLUDED
Definition: opt_explain_format.h:448
Formatter for the traditional EXPLAIN output.
Definition: opt_explain_traditional.h:41
bool flush_entry() override
Flush TABLE/JOIN_TAB property set.
Definition: opt_explain_traditional.cc:217
qep_row column_buffer
buffer for the current output row
Definition: opt_explain_traditional.h:43
qep_row * entry() override
Get a pointer to the current TABLE/JOIN_TAB property set.
Definition: opt_explain_traditional.h:56
Explain_format_traditional()
Definition: opt_explain_traditional.h:46
class Item_null * nil
Definition: opt_explain_traditional.h:42
bool begin_context(enum_parsing_context, Query_expression *, const Explain_format_flags *) override
Enter a specified context.
Definition: opt_explain_traditional.h:50
bool is_hierarchical() const override
A hierarchical text or a plain table.
Definition: opt_explain_traditional.h:48
bool send_headers(Query_result *result) override
Send EXPLAIN header item(s) to output stream.
Definition: opt_explain_traditional.cc:88
bool push_select_type(mem_root_deque< Item * > *items)
Definition: opt_explain_traditional.cc:179
bool end_context(enum_parsing_context) override
Leave the current context.
Definition: opt_explain_traditional.h:54
Definition: opt_explain_traditional.h:62
bool end_context(enum_parsing_context) override
Leave the current context.
Definition: opt_explain_traditional.h:76
bool send_headers(Query_result *) override
Send EXPLAIN header item(s) to output stream.
Definition: opt_explain_traditional.h:67
bool push_select_type(mem_root_deque< Item * > *items)
qep_row * entry() override
Get a pointer to the current TABLE/JOIN_TAB property set.
Definition: opt_explain_traditional.h:84
bool flush_entry() override
Flush TABLE/JOIN_TAB property set.
Definition: opt_explain_traditional.h:80
Explain_format_tree()=default
bool is_hierarchical() const override
A hierarchical text or a plain table.
Definition: opt_explain_traditional.h:66
bool is_tree() const override
Definition: opt_explain_traditional.h:88
bool begin_context(enum_parsing_context, Query_expression *, const Explain_format_flags *) override
Enter a specified context.
Definition: opt_explain_traditional.h:71
Base class for structured and hierarchical EXPLAIN output formatters.
Definition: opt_explain_format.h:503
Definition: item.h:4376
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:802
This class represents a query expression (one query block or several query blocks combined with UNION...
Definition: sql_lex.h:629
Definition: query_result.h:55
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:109
Helper class for table property buffering.
Definition: opt_explain_format.h:146
Dialog Client Authentication nullptr
Definition: dialog.cc:352
EXPLAIN FORMAT=<format> <command>.
enum_parsing_context
Names for different query parse tree parts.
Definition: parse_tree_node_base.h:55
Definition: result.h:29