MySQL  8.0.23
Source Code Documentation
opt_explain_json.h
Go to the documentation of this file.
1 /* Copyright (c) 2011, 2020, 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_JSON_INCLUDED
24 #define OPT_EXPLAIN_FORMAT_JSON_INCLUDED
25 
26 #include "sql/opt_explain_format.h"
28 
29 class Query_result;
30 class SELECT_LEX_UNIT;
31 
33 class context;
34 }
35 
36 /**
37  Formatter class for EXPLAIN FORMAT=JSON output
38 */
39 
41  private:
43 
44  public:
46 
47  bool is_hierarchical() const override { return true; }
48  bool send_headers(Query_result *result) override;
49  bool begin_context(enum_parsing_context context, SELECT_LEX_UNIT *subquery,
50  const Explain_format_flags *flags) override;
51  bool end_context(enum_parsing_context context) override;
52  bool flush_entry() override { return false; }
53  qep_row *entry() override;
54 };
55 
56 #endif // OPT_EXPLAIN_FORMAT_JSON_INCLUDED
qep_row
Helper class for table property buffering.
Definition: opt_explain_format.h:145
Explain_format_JSON::end_context
bool end_context(enum_parsing_context context) override
Leave the current context.
Definition: opt_explain_json.cc:1992
enum_parsing_context
enum_parsing_context
Names for different query parse tree parts.
Definition: parse_tree_node_base.h:54
Explain_format_JSON
Formatter class for EXPLAIN FORMAT=JSON output.
Definition: opt_explain_json.h:40
opt_explain_json_namespace
Definition: opt_explain_format.h:128
nullptr
Dialog Client Authentication nullptr
Definition: dialog.cc:353
Query_result
Definition: query_result.h:54
Explain_format
Base class for structured and hierarchical EXPLAIN output formatters.
Definition: opt_explain_format.h:502
Explain_format_JSON::send_headers
bool send_headers(Query_result *result) override
Send EXPLAIN header item(s) to output stream.
Definition: opt_explain_json.cc:2041
result
Definition: result.h:29
Explain_format_JSON::Explain_format_JSON
Explain_format_JSON()
Definition: opt_explain_json.h:45
SELECT_LEX_UNIT
This class represents a query expression (one query block or several query blocks combined with UNION...
Definition: sql_lex.h:627
Explain_format_JSON::current_context
opt_explain_json_namespace::context * current_context
current tree node
Definition: opt_explain_json.h:42
Explain_format_JSON::flush_entry
bool flush_entry() override
Flush TABLE/JOIN_TAB property set.
Definition: opt_explain_json.h:52
opt_explain_format.h
Explain_format_JSON::begin_context
bool begin_context(enum_parsing_context context, SELECT_LEX_UNIT *subquery, const Explain_format_flags *flags) override
Enter a specified context.
Definition: opt_explain_json.cc:1670
Explain_format_flags
Definition: opt_explain_format.h:447
Explain_format_JSON::is_hierarchical
bool is_hierarchical() const override
A hierarchical text or a plain table.
Definition: opt_explain_json.h:47
Explain_format_JSON::entry
qep_row * entry() override
Get a pointer to the current TABLE/JOIN_TAB property set.
Definition: opt_explain_json.cc:1668
parse_tree_node_base.h
opt_explain_json_namespace::context
Base class for all intermediate tree nodes.
Definition: opt_explain_json.cc:214
flags
static int flags[50]
Definition: hp_test1.cc:39