MySQL 8.0.30
Source Code Documentation
sql_component.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 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_component_h
24#define _sql_component_h
25
26#include <string>
27#include <vector>
28
29#include "lex_string.h"
30#include "my_sqlcommand.h"
31#include "sql/mem_root_array.h"
32#include "sql/sql_cmd.h"
33
34class THD;
35
36/**
37 This class implements the INSTALL COMPONENT statement.
38*/
39
41 public:
43 : m_urns(urns) {}
44
47 }
48
49 /**
50 Install a new component by loading it by dynamic loader service.
51
52 @param thd Thread context
53
54 @returns false if success, true otherwise
55 */
56 bool execute(THD *thd) override;
57
58 private:
60};
61
62/**
63 This class implements the UNINSTALL COMPONENT statement.
64*/
65
67 public:
69 : m_urns(urns) {}
70
73 }
74
75 /**
76 Uninstall a plugin by unloading it in the dynamic loader service.
77
78 @param thd Thread context
79
80 @returns false if success, true otherwise
81 */
82 bool execute(THD *thd) override;
83
84 private:
86};
87
88/**
89 This class implements component loading through manifest file
90*/
92 public:
93 explicit Deployed_components(const std::string program_name,
94 const std::string instance_path);
96 bool valid() const { return valid_; }
97 bool components_loaded() const { return loaded_; }
98
99 private:
100 void get_next_component(std::string &components_list,
101 std::string &one_component);
102 bool load();
103 bool unload();
104 bool make_urns(std::vector<const char *> &urns);
105
106 private:
107 std::string program_name_;
108 std::string instance_path_;
109 std::string components_;
110 std::string last_error_;
111 bool valid_;
113};
114#endif
This class implements component loading through manifest file.
Definition: sql_component.h:91
std::string components_
Definition: sql_component.h:109
bool loaded_
Definition: sql_component.h:112
bool load()
Definition: sql_component.cc:177
~Deployed_components()
Definition: sql_component.cc:127
std::string last_error_
Definition: sql_component.h:110
std::string program_name_
Definition: sql_component.h:107
bool valid_
Definition: sql_component.h:111
std::string instance_path_
Definition: sql_component.h:108
bool valid() const
Definition: sql_component.h:96
Deployed_components(const std::string program_name, const std::string instance_path)
Definition: sql_component.cc:110
bool make_urns(std::vector< const char * > &urns)
Definition: sql_component.cc:151
bool components_loaded() const
Definition: sql_component.h:97
bool unload()
Definition: sql_component.cc:240
void get_next_component(std::string &components_list, std::string &one_component)
Definition: sql_component.cc:133
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:60
This class implements the INSTALL COMPONENT statement.
Definition: sql_component.h:40
Sql_cmd_install_component(const Mem_root_array_YY< LEX_STRING > &urns)
Definition: sql_component.h:42
bool execute(THD *thd) override
Install a new component by loading it by dynamic loader service.
Definition: sql_component.cc:50
const Mem_root_array_YY< LEX_STRING > m_urns
Definition: sql_component.h:59
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_component.h:45
This class implements the UNINSTALL COMPONENT statement.
Definition: sql_component.h:66
const Mem_root_array_YY< LEX_STRING > m_urns
Definition: sql_component.h:85
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_component.h:71
Sql_cmd_uninstall_component(const Mem_root_array_YY< LEX_STRING > &urns)
Definition: sql_component.h:68
bool execute(THD *thd) override
Uninstall a plugin by unloading it in the dynamic loader service.
Definition: sql_component.cc:84
Representation of an SQL command.
Definition: sql_cmd.h:64
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:922
enum_sql_command
Definition: my_sqlcommand.h:45
@ SQLCOM_INSTALL_COMPONENT
Definition: my_sqlcommand.h:186
@ SQLCOM_UNINSTALL_COMPONENT
Definition: my_sqlcommand.h:187
Representation of an SQL command.