MySQL 8.3.0
Source Code Documentation
mysql_admin_session.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 2023, 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 also distributed 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 included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef MYSQL_ADMIN_SESSION_H
24#define MYSQL_ADMIN_SESSION_H
25
27#include <mysql/service_srv_session_bits.h> /* MYSQL_SESSION,
28 srv_session_error_cb */
29
30/**
31 @ingroup group_components_services_inventory
32
33 A service to create an "admin" session that's not a subject to max connection
34 count limits.
35
36 This service is an extension to the sessions plugin service suite.
37 The @ref MYSQL_SESSION references are compatible with the plugin service.
38
39 @sa @ref mysql_component_mysql_admin_session_imp
40*/
41BEGIN_SERVICE_DEFINITION(mysql_admin_session)
42/**
43 Creates a new session without checking the max_connection limits
44
45 The function is the same as @ref srv_session_open plugin service API, but
46 in addition to it it also marks the newly created @ref MYSQL_SESSION as
47 "immune" to max_connections count check. The @ref MYSQL_SESSION created
48 through this function can be operated as any other @ref MYSQL_SESSION via the
49 srv_session_* functions from the @ref srv_session_service_st set.
50 @note The @ref MYSQL_SESSION created by this function need to be freed by
51 calling
52 @ref srv_session_close.
53
54 @sa @ref mysql_component_mysql_admin_session_imp, @ref srv_session_close,
55 @ref srv_session_open
56
57 @param error_cb the function to call on error
58 @param ctx the context to pass to error_cb
59 @return a newly created MYSQL_SESSION
60*/
62
63END_SERVICE_DEFINITION(mysql_admin_session)
64
65#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:78
#define DECLARE_METHOD(retval, name, args)
Declares a method as a part of the Service definition.
Definition: service.h:102
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:90
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:85
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:36
void(* srv_session_error_cb)(void *ctx, unsigned int sql_errno, const char *err_msg)
Definition: service_srv_session_bits.h:42