MySQL 8.4.3
Source Code Documentation
opt_explain_json.h
Go to the documentation of this file.
1/* Copyright (c) 2011, 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 OPT_EXPLAIN_FORMAT_JSON_INCLUDED
25#define OPT_EXPLAIN_FORMAT_JSON_INCLUDED
26
29
30class Query_result;
32
34class context;
35}
36
37/**
38 Formatter class for EXPLAIN FORMAT=JSON output
39*/
40
42 public:
44
47 std::optional<std::string_view> explain_into_variable_name)
51
52 bool is_hierarchical() const override { return true; }
53
54 /// Format versions newer than Linear are always going to be iterator-based.
55 bool is_iterator_based() const override {
57 }
58
59 bool send_headers(Query_result *result) override;
61 const Explain_format_flags *flags) override;
62 bool end_context(enum_parsing_context context) override;
63 bool flush_entry() override { return false; }
64 qep_row *entry() override;
65
66 /* Convert Json object to string */
67 std::string ExplainJsonToString(Json_object *json) override;
68
69 private:
72};
73
74#endif // OPT_EXPLAIN_FORMAT_JSON_INCLUDED
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Formatter class for EXPLAIN FORMAT=JSON output.
Definition: opt_explain_json.h:41
bool flush_entry() override
Flush TABLE/JOIN_TAB property set.
Definition: opt_explain_json.h:63
bool end_context(enum_parsing_context context) override
Leave the current context.
Definition: opt_explain_json.cc:2035
bool is_iterator_based() const override
Format versions newer than Linear are always going to be iterator-based.
Definition: opt_explain_json.h:55
Explain_format_JSON(FormatVersion version, std::optional< std::string_view > explain_into_variable_name)
Definition: opt_explain_json.h:45
FormatVersion
Definition: opt_explain_json.h:43
qep_row * entry() override
Get a pointer to the current TABLE/JOIN_TAB property set.
Definition: opt_explain_json.cc:1650
bool send_headers(Query_result *result) override
Send EXPLAIN header item(s) to output stream.
Definition: opt_explain_json.cc:2084
bool begin_context(enum_parsing_context context, Query_expression *subquery, const Explain_format_flags *flags) override
Enter a specified context.
Definition: opt_explain_json.cc:1652
std::string ExplainJsonToString(Json_object *json) override
Convert Json object to string.
Definition: opt_explain_json.cc:2108
opt_explain_json_namespace::context * current_context
current tree node
Definition: opt_explain_json.h:70
FormatVersion m_version
Definition: opt_explain_json.h:71
bool is_hierarchical() const override
A hierarchical text or a plain table.
Definition: opt_explain_json.h:52
Definition: opt_explain_format.h:451
Base class for structured and hierarchical EXPLAIN output formatters.
Definition: opt_explain_format.h:506
std::string_view explain_into_variable_name() const
Returns the name of the user variable the output of this EXPLAIN statement is to be stored in.
Definition: opt_explain_format.h:587
Represents a JSON container value of type "object" (ECMA), type J_OBJECT here.
Definition: json_dom.h:369
This class represents a query expression (one query block or several query blocks combined with UNION...
Definition: sql_lex.h:626
Definition: query_result.h:58
Base class for all intermediate tree nodes.
Definition: opt_explain_json.cc:220
Helper class for table property buffering.
Definition: opt_explain_format.h:150
static int flags[50]
Definition: hp_test1.cc:40
Definition: opt_explain_format.h:133
EXPLAIN FORMAT=<format> <command>.
enum_parsing_context
Names for different query parse tree parts.
Definition: parse_tree_node_base.h:61
required uint64 version
Definition: replication_group_member_actions.proto:41
Definition: result.h:30