MySQL 8.0.40
Source Code Documentation
show_variable_query_extractor.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2014, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef SHOW_VARIABLE_QUERY_EXTRACTOR_INCLUDED
27#define SHOW_VARIABLE_QUERY_EXTRACTOR_INCLUDED
28
29#include <string>
30#include <vector>
31
33#include "my_inttypes.h"
34#include "mysql.h"
35
36namespace Mysql {
37namespace Tools {
38namespace Base {
39
40/**
41 Extracts the value of server variable.
42 */
44 public:
45 /**
46 Extract the value of server variable.
47
48 @param[in] query_runner MySQL query runner to use.
49 @param[in] variable Name of variable to get value of.
50 @param[out] value reference to String to store variable value to.
51 @param[out] exists reference to bool to store if variable was found.
52 @return nonzero if error was encountered.
53 */
54 static int64 get_variable_value(Mysql_query_runner *query_runner,
55 std::string variable, std::string &value,
56 bool &exists);
57
58 private:
60 /**
61 Result row callback to be used in query runner.
62 */
64
65 /**
66 Temporary placeholder for extracted value.
67 */
69
70 /**
71 Temporary placeholder for value received flag.
72 */
74};
75
76} // namespace Base
77} // namespace Tools
78} // namespace Mysql
79
80#endif
Definition: mysql_query_runner.h:137
Helper class to run SQL query on existing MySQL database server connection, receive all data and all ...
Definition: mysql_query_runner.h:49
Extracts the value of server variable.
Definition: show_variable_query_extractor.h:43
Show_variable_query_extractor()
Definition: show_variable_query_extractor.cc:35
int64 extract_variable(const Mysql_query_runner::Row &result_row)
Result row callback to be used in query runner.
Definition: show_variable_query_extractor.cc:38
static int64 get_variable_value(Mysql_query_runner *query_runner, std::string variable, std::string &value, bool &exists)
Extract the value of server variable.
Definition: show_variable_query_extractor.cc:46
bool m_exists
Temporary placeholder for value received flag.
Definition: show_variable_query_extractor.h:73
std::string m_extracted_variable
Temporary placeholder for extracted value.
Definition: show_variable_query_extractor.h:68
Some integer typedefs for easier portability.
int64_t int64
Definition: my_inttypes.h:68
This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient.
Definition: abstract_connection_program.h:38
static int exists(node_address *name, node_list const *nodes, u_int with_uid)
Definition: node_list.cc:106