MySQL 8.0.40
Source Code Documentation
mysql_admin_session.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_ADMIN_SESSION_H
25#define MYSQL_ADMIN_SESSION_H
26
28#include <mysql/service_srv_session_bits.h> /* MYSQL_SESSION,
29 srv_session_error_cb */
30
31/**
32 @ingroup group_components_services_inventory
33
34 A service to create an "admin" session that's not a subject to max connection
35 count limits.
36
37 This service is an extension to the sessions plugin service suite.
38 The @ref MYSQL_SESSION references are compatible with the plugin service.
39
40 @sa @ref mysql_component_mysql_admin_session_imp
41*/
42BEGIN_SERVICE_DEFINITION(mysql_admin_session)
43/**
44 Creates a new session without checking the max_connection limits
45
46 The function is the same as @ref srv_session_open plugin service API, but
47 in addition to it it also marks the newly created @ref MYSQL_SESSION as
48 "immune" to max_connections count check. The @ref MYSQL_SESSION created
49 through this function can be operated as any other @ref MYSQL_SESSION via the
50 srv_session_* functions from the @ref srv_session_service_st set.
51 @note The @ref MYSQL_SESSION created by this function need to be freed by
52 calling
53 @ref srv_session_close.
54
55 @sa @ref mysql_component_mysql_admin_session_imp, @ref srv_session_close,
56 @ref srv_session_open
57
58 @param error_cb the function to call on error
59 @param ctx the context to pass to error_cb
60 @return a newly created MYSQL_SESSION
61*/
63
64END_SERVICE_DEFINITION(mysql_admin_session)
65
66#endif /* MYSQL_ADMIN_SESSION_H */
stdx::expected< int, std::error_code > open(const char *fname, int flags, mode_t mode) noexcept
Definition: file_handle.cc:79
#define DECLARE_METHOD(retval, name, args)
Declares a method as a part of the Service definition.
Definition: service.h:103
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
These are the common definitions between the plugin service for sessions and the component service ex...
class Srv_session * MYSQL_SESSION
Definition: service_srv_session_bits.h:37
void(* srv_session_error_cb)(void *ctx, unsigned int sql_errno, const char *err_msg)
Definition: service_srv_session_bits.h:43