MySQL 8.4.2
Source Code Documentation
mysql_stored_program.h File Reference

Services for reading and storing various stored program properties of the server stored program's object and its contexts. More...

#include <mysql/components/service.h>
#include <cstddef>
#include <cstdint>
#include "bits/mysql_stored_program_bits.h"
#include "defs/mysql_string_defs.h"

Go to the source code of this file.

Classes

struct  s_mysql_mysql_stored_program_metadata_query
 
struct  s_mysql_mysql_stored_program_argument_metadata_query
 
struct  s_mysql_mysql_stored_program_return_metadata_query
 
struct  s_mysql_mysql_stored_program_field_name
 
struct  s_mysql_mysql_stored_program_runtime_argument_year
 
struct  s_mysql_mysql_stored_program_runtime_argument_time
 
struct  s_mysql_mysql_stored_program_runtime_argument_date
 
struct  s_mysql_mysql_stored_program_runtime_argument_datetime
 
struct  s_mysql_mysql_stored_program_runtime_argument_timestamp
 
struct  s_mysql_mysql_stored_program_runtime_argument_null
 
struct  s_mysql_mysql_stored_program_runtime_argument_string
 
struct  s_mysql_mysql_stored_program_runtime_argument_int
 
struct  s_mysql_mysql_stored_program_runtime_argument_unsigned_int
 
struct  s_mysql_mysql_stored_program_runtime_argument_float
 
struct  s_mysql_mysql_stored_program_return_value_year
 
struct  s_mysql_mysql_stored_program_return_value_time
 
struct  s_mysql_mysql_stored_program_return_value_date
 
struct  s_mysql_mysql_stored_program_return_value_datetime
 
struct  s_mysql_mysql_stored_program_return_value_timestamp
 
struct  s_mysql_mysql_stored_program_return_value_null
 
struct  s_mysql_mysql_stored_program_return_value_string
 
struct  s_mysql_mysql_stored_program_return_value_int
 
struct  s_mysql_mysql_stored_program_return_value_unsigned_int
 
struct  s_mysql_mysql_stored_program_return_value_float
 
struct  s_mysql_mysql_stored_program_external_program_handle
 Service to get and change the stored program's external language handle. More...
 

Typedefs

typedef struct stored_program_handle_imp * stored_program_handle
 
typedef struct stored_program_runtime_context_imp * stored_program_runtime_context
 
typedef struct time_zone_handle_imp * time_zone_handle
 
typedef struct external_program_handle_imp * external_program_handle
 
typedef struct s_mysql_mysql_stored_program_metadata_query mysql_service_mysql_stored_program_metadata_query_t
 
typedef struct s_mysql_mysql_stored_program_argument_metadata_query mysql_service_mysql_stored_program_argument_metadata_query_t
 
typedef struct s_mysql_mysql_stored_program_return_metadata_query mysql_service_mysql_stored_program_return_metadata_query_t
 
typedef struct s_mysql_mysql_stored_program_field_name mysql_service_mysql_stored_program_field_name_t
 
typedef struct s_mysql_mysql_stored_program_runtime_argument_year mysql_service_mysql_stored_program_runtime_argument_year_t
 
typedef struct s_mysql_mysql_stored_program_runtime_argument_time mysql_service_mysql_stored_program_runtime_argument_time_t
 
typedef struct s_mysql_mysql_stored_program_runtime_argument_date mysql_service_mysql_stored_program_runtime_argument_date_t
 
typedef struct s_mysql_mysql_stored_program_runtime_argument_datetime mysql_service_mysql_stored_program_runtime_argument_datetime_t
 
typedef struct s_mysql_mysql_stored_program_runtime_argument_timestamp mysql_service_mysql_stored_program_runtime_argument_timestamp_t
 
typedef struct s_mysql_mysql_stored_program_runtime_argument_null mysql_service_mysql_stored_program_runtime_argument_null_t
 
typedef struct s_mysql_mysql_stored_program_runtime_argument_string mysql_service_mysql_stored_program_runtime_argument_string_t
 
typedef struct s_mysql_mysql_stored_program_runtime_argument_int mysql_service_mysql_stored_program_runtime_argument_int_t
 
typedef struct s_mysql_mysql_stored_program_runtime_argument_unsigned_int mysql_service_mysql_stored_program_runtime_argument_unsigned_int_t
 
typedef struct s_mysql_mysql_stored_program_runtime_argument_float mysql_service_mysql_stored_program_runtime_argument_float_t
 
typedef struct s_mysql_mysql_stored_program_return_value_year mysql_service_mysql_stored_program_return_value_year_t
 
typedef struct s_mysql_mysql_stored_program_return_value_time mysql_service_mysql_stored_program_return_value_time_t
 
typedef struct s_mysql_mysql_stored_program_return_value_date mysql_service_mysql_stored_program_return_value_date_t
 
typedef struct s_mysql_mysql_stored_program_return_value_datetime mysql_service_mysql_stored_program_return_value_datetime_t
 
typedef struct s_mysql_mysql_stored_program_return_value_timestamp mysql_service_mysql_stored_program_return_value_timestamp_t
 
typedef struct s_mysql_mysql_stored_program_return_value_null mysql_service_mysql_stored_program_return_value_null_t
 
typedef struct s_mysql_mysql_stored_program_return_value_string mysql_service_mysql_stored_program_return_value_string_t
 
typedef struct s_mysql_mysql_stored_program_return_value_int mysql_service_mysql_stored_program_return_value_int_t
 
typedef struct s_mysql_mysql_stored_program_return_value_unsigned_int mysql_service_mysql_stored_program_return_value_unsigned_int_t
 
typedef struct s_mysql_mysql_stored_program_return_value_float mysql_service_mysql_stored_program_return_value_float_t
 
typedef struct s_mysql_mysql_stored_program_external_program_handle mysql_service_mysql_stored_program_external_program_handle_t
 Service to get and change the stored program's external language handle. More...
 

Detailed Description

Services for reading and storing various stored program properties of the server stored program's object and its contexts.

Typedef Documentation

◆ external_program_handle

typedef struct external_program_handle_imp* external_program_handle

◆ mysql_service_mysql_stored_program_argument_metadata_query_t

◆ mysql_service_mysql_stored_program_external_program_handle_t

Service to get and change the stored program's external language handle.

In general, the server stored program object does handle the lifetime of the external language objects. It initiates the creation, parsing, execution and destruction of such objects. But, in rare cases, the external language component may request the server to change its external language object. Example of such cases are: The stored program is aborted. The external language object needs to be destroyed and detached from the server object. The session was reset. Either by explicit user demand, or when incompatible changes happen such as timezone change. All of its objects need to be destroyed and detached. The limit of external language objects is reached. The oldest objects may be destroyed and detached. The limit of external language sessions is reached. The oldest sessions may be destroyed, together with their language objects. The external language object is changed. The new object needs to replace the existing one.

Note
Both the external language session and external language object services support lazy (re)initialization. The current object may be detached and destroyed. When another request to the same stored program comes, a new object will be created.

Used approximately as follows:

// Get the current external_program_handle.
external_program_handle old_sp = nullptr;
if (SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
return 1;
// Detach and destroy the current external_program_handle.
if (SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
return 1;
if (old_sp) destroy_stored_program(old_sp);
// Create and attach a new external_program_handle.
external_program_handle old_sp = create_stored_program();
return SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
->set(stored_program_handle, nullptr);
external_program_handle new_sp = create_stored_program();
return SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
->set(stored_program_handle, new_sp);
#define SERVICE_PLACEHOLDER(service)
Use this macro to reference the service placeholder as defined by the REQUIRES_SERVICE_PLACEHOLDER ma...
Definition: component_implementation.h:382
struct external_program_handle_imp * external_program_handle
The handle is created by the caller of external_program_execution service.
Definition: language_service.h:37
struct stored_program_handle_imp * stored_program_handle
The handle is an opaque pointer to a sp_head item.
Definition: language_service.h:42
void get(PSI_field *, PSI_longlong *) noexcept
Definition: pfs_plugin_column_bigint_v1_all_empty.cc:32
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2882

◆ mysql_service_mysql_stored_program_field_name_t

◆ mysql_service_mysql_stored_program_metadata_query_t

◆ mysql_service_mysql_stored_program_return_metadata_query_t

◆ mysql_service_mysql_stored_program_return_value_date_t

◆ mysql_service_mysql_stored_program_return_value_datetime_t

◆ mysql_service_mysql_stored_program_return_value_float_t

◆ mysql_service_mysql_stored_program_return_value_int_t

◆ mysql_service_mysql_stored_program_return_value_null_t

◆ mysql_service_mysql_stored_program_return_value_string_t

◆ mysql_service_mysql_stored_program_return_value_time_t

◆ mysql_service_mysql_stored_program_return_value_timestamp_t

◆ mysql_service_mysql_stored_program_return_value_unsigned_int_t

◆ mysql_service_mysql_stored_program_return_value_year_t

◆ mysql_service_mysql_stored_program_runtime_argument_date_t

◆ mysql_service_mysql_stored_program_runtime_argument_datetime_t

◆ mysql_service_mysql_stored_program_runtime_argument_float_t

◆ mysql_service_mysql_stored_program_runtime_argument_int_t

◆ mysql_service_mysql_stored_program_runtime_argument_null_t

◆ mysql_service_mysql_stored_program_runtime_argument_string_t

◆ mysql_service_mysql_stored_program_runtime_argument_time_t

◆ mysql_service_mysql_stored_program_runtime_argument_timestamp_t

◆ mysql_service_mysql_stored_program_runtime_argument_unsigned_int_t

◆ mysql_service_mysql_stored_program_runtime_argument_year_t

◆ stored_program_handle

typedef struct stored_program_handle_imp* stored_program_handle

◆ stored_program_runtime_context

typedef struct stored_program_runtime_context_imp* stored_program_runtime_context

◆ time_zone_handle

typedef struct time_zone_handle_imp* time_zone_handle