MySQL 9.1.0
Source Code Documentation
mysql_stored_program_imp.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 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_STORED_PROGRAM_IMP_H
25#define MYSQL_STORED_PROGRAM_IMP_H
26
27#include <cstdint>
29
32
33/**
34 Implementation of the mysql_stored_program services
35*/
37 public:
39 const char *key, void *value));
40};
41
42/*
43 * Argument-related services:
44 */
45
47 public:
49 (stored_program_handle sp_handle, uint16_t index,
50 const char *key, void *value));
51};
52
54 public:
56 const char *key, void *value));
57};
58
60 public:
62 (stored_program_runtime_context sp_runtime_context,
63 char const **value));
64};
65
67 public:
69 (stored_program_runtime_context sp_runtime_context,
70 uint16_t index, uint32_t *year, bool *is_null));
72 (stored_program_runtime_context sp_runtime_context,
73 uint16_t index, uint32_t year));
74};
75
77 public:
79 (stored_program_runtime_context sp_runtime_context,
80 uint16_t index, uint32_t *hour, uint32_t *minute,
81 uint32_t *second, uint64_t *micro, bool *negative,
82 bool *is_null));
84 (stored_program_runtime_context sp_runtime_context,
85 uint16_t index, uint32_t hour, uint32_t minute,
86 uint32_t second, uint64_t micro, bool negative,
87 uint8_t decimals));
88};
89
91 public:
93 (stored_program_runtime_context sp_runtime_context,
94 uint16_t index, uint32_t *year, uint32_t *month,
95 uint32_t *day, bool *is_null));
97 (stored_program_runtime_context sp_runtime_context,
98 uint16_t index, uint32_t year, uint32_t month,
99 uint32_t day));
100};
101
103 public:
104 static DEFINE_BOOL_METHOD(get,
105 (stored_program_runtime_context sp_runtime_context,
106 uint16_t index, uint32_t *year, uint32_t *month,
107 uint32_t *day, uint32_t *hour, uint32_t *minute,
108 uint32_t *second, uint64_t *micro, bool *negative,
109 int32_t *time_zone_offset, bool *is_null));
110 static DEFINE_BOOL_METHOD(
111 set, (stored_program_runtime_context sp_runtime_context, uint16_t index,
112 uint32_t year, uint32_t month, uint32_t day, uint32_t hour,
113 uint32_t minute, uint32_t second, uint64_t micro, bool negative,
114 uint32_t decimals, int32_t time_zone_offset, bool time_zone_aware));
115};
116
118 public:
119 static DEFINE_BOOL_METHOD(get,
120 (stored_program_runtime_context sp_runtime_context,
121 uint16_t index, uint32_t *year, uint32_t *month,
122 uint32_t *day, uint32_t *hour, uint32_t *minute,
123 uint32_t *second, uint64_t *micro, bool *negative,
124 int32_t *time_zone_offset, bool *is_null));
125 static DEFINE_BOOL_METHOD(
126 set, (stored_program_runtime_context sp_runtime_context, uint16_t index,
127 uint32_t year, uint32_t month, uint32_t day, uint32_t hour,
128 uint32_t minute, uint32_t second, uint64_t micro, bool negative,
129 uint32_t decimals, int32_t time_zone_offset, bool time_zone_aware));
130};
131
133 public:
134 static DEFINE_BOOL_METHOD(set,
135 (stored_program_runtime_context sp_runtime_context,
136 uint16_t index));
137};
138
140 public:
141 static DEFINE_BOOL_METHOD(get,
142 (stored_program_runtime_context sp_runtime_context,
143 uint16_t index, char const **buffer,
144 size_t *out_len, bool *is_null));
145 static DEFINE_BOOL_METHOD(set,
146 (stored_program_runtime_context sp_runtime_context,
147 uint16_t index, char const *string,
148 size_t length));
149};
150
152 public:
153 static DEFINE_BOOL_METHOD(set,
154 (stored_program_runtime_context sp_runtime_context,
155 uint16_t index, char const *string, size_t length,
157};
158
160 public:
161 static DEFINE_BOOL_METHOD(get,
162 (stored_program_runtime_context sp_runtime_context,
163 uint16_t index, int64_t *result, bool *is_null));
164 static DEFINE_BOOL_METHOD(set,
165 (stored_program_runtime_context sp_runtime_context,
166 uint16_t index, int64_t value));
167};
168
170 public:
171 static DEFINE_BOOL_METHOD(get,
172 (stored_program_runtime_context sp_runtime_context,
173 uint16_t index, uint64_t *result, bool *is_null));
174 static DEFINE_BOOL_METHOD(set,
175 (stored_program_runtime_context sp_runtime_context,
176 uint16_t index, uint64_t value));
177};
178
180 public:
181 static DEFINE_BOOL_METHOD(get,
182 (stored_program_runtime_context sp_runtime_context,
183 uint16_t index, double *result, bool *is_null));
184 static DEFINE_BOOL_METHOD(set,
185 (stored_program_runtime_context sp_runtime_context,
186 uint16_t index, double value));
187};
188
190 public:
191 static DEFINE_BOOL_METHOD(set,
192 (stored_program_runtime_context sp_runtime_context,
193 uint32_t year));
194};
195
197 public:
198 static DEFINE_BOOL_METHOD(set,
199 (stored_program_runtime_context sp_runtime_context,
200 uint32_t hour, uint32_t minute, uint32_t second,
201 uint64_t micro, bool negative, uint8_t decimals));
202};
203
205 public:
206 static DEFINE_BOOL_METHOD(set,
207 (stored_program_runtime_context sp_runtime_context,
208 uint32_t year, uint32_t month, uint32_t day));
209};
210
212 public:
213 static DEFINE_BOOL_METHOD(set,
214 (stored_program_runtime_context sp_runtime_context,
215 uint32_t year, uint32_t month, uint32_t day,
216 uint32_t hour, uint32_t minute, uint32_t second,
217 uint64_t micro, bool negative, uint32_t decimals,
218 int32_t time_zone_offset, bool time_zone_aware));
219};
220
222 public:
223 static DEFINE_BOOL_METHOD(set,
224 (stored_program_runtime_context sp_runtime_context,
225 uint32_t year, uint32_t month, uint32_t day,
226 uint32_t hour, uint32_t minute, uint32_t second,
227 uint64_t micro, bool negative, uint32_t decimals,
228 int32_t time_zone_offset, bool time_zone_aware));
229};
230
232 public:
233 static DEFINE_BOOL_METHOD(
234 set, (stored_program_runtime_context sp_runtime_context));
235};
236
238 public:
239 static DEFINE_BOOL_METHOD(set,
240 (stored_program_runtime_context sp_runtime_context,
241 char const *string, size_t length));
242};
243
245 public:
246 static DEFINE_BOOL_METHOD(set,
247 (stored_program_runtime_context sp_runtime_context,
248 char const *string, size_t length,
250};
251
253 public:
254 static DEFINE_BOOL_METHOD(set,
255 (stored_program_runtime_context sp_runtime_context,
256 int64_t value));
257};
258
260 public:
261 static DEFINE_BOOL_METHOD(set,
262 (stored_program_runtime_context sp_runtime_context,
263 uint64_t value));
264};
265
267 public:
268 static DEFINE_BOOL_METHOD(set,
269 (stored_program_runtime_context sp_runtime_context,
270 double value));
271};
272
274 public:
277
280};
281#endif /* MYSQL_STORED_PROGRAM_IMP_H */
Definition: mysql_stored_program_imp.h:46
static mysql_service_status_t get(stored_program_handle sp_handle, uint16_t index, const char *key, void *value) noexcept
Get stored program argument metadata.
Definition: mysql_stored_program_imp.cc:286
Definition: mysql_stored_program_imp.h:273
static mysql_service_status_t get(stored_program_handle sp, external_program_handle *value) noexcept
Definition: mysql_stored_program_imp.cc:1337
static mysql_service_status_t set(stored_program_handle sp, external_program_handle value) noexcept
Definition: mysql_stored_program_imp.cc:1349
Definition: mysql_stored_program_imp.h:59
static mysql_service_status_t get_name(stored_program_runtime_context sp_runtime_context, char const **value) noexcept
Returns the field name of the return value.
Definition: mysql_stored_program_imp.cc:375
Implementation of the mysql_stored_program services.
Definition: mysql_stored_program_imp.h:36
static mysql_service_status_t get(stored_program_handle sp_handle, const char *key, void *value) noexcept
Implementation of the mysql_stored_program services.
Definition: mysql_stored_program_imp.cc:72
Definition: mysql_stored_program_imp.h:53
static mysql_service_status_t get(stored_program_handle sp_handle, const char *key, void *value) noexcept
Get stored program return metadata.
Definition: mysql_stored_program_imp.cc:322
Definition: mysql_stored_program_imp.h:204
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint32_t year, uint32_t month, uint32_t day) noexcept
Definition: mysql_stored_program_imp.cc:1085
Definition: mysql_stored_program_imp.h:211
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint32_t year, uint32_t month, uint32_t day, uint32_t hour, uint32_t minute, uint32_t second, uint64_t micro, bool negative, uint32_t decimals, int32_t time_zone_offset, bool time_zone_aware) noexcept
Definition: mysql_stored_program_imp.cc:1170
Definition: mysql_stored_program_imp.h:266
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, double value) noexcept
Set value of a float return value.
Definition: mysql_stored_program_imp.cc:1312
Definition: mysql_stored_program_imp.h:252
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, int64_t value) noexcept
Set value of an int return value.
Definition: mysql_stored_program_imp.cc:1272
Definition: mysql_stored_program_imp.h:231
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context) noexcept
Set null value.
Definition: mysql_stored_program_imp.cc:1221
Definition: mysql_stored_program_imp.h:244
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, char const *string, size_t length, CHARSET_INFO_h charset) noexcept
Definition: mysql_stored_program_imp.cc:1251
Definition: mysql_stored_program_imp.h:237
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, char const *string, size_t length) noexcept
Set value of a string return value.
Definition: mysql_stored_program_imp.cc:1242
Definition: mysql_stored_program_imp.h:196
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint32_t hour, uint32_t minute, uint32_t second, uint64_t micro, bool negative, uint8_t decimals) noexcept
Definition: mysql_stored_program_imp.cc:1054
Definition: mysql_stored_program_imp.h:221
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint32_t year, uint32_t month, uint32_t day, uint32_t hour, uint32_t minute, uint32_t second, uint64_t micro, bool negative, uint32_t decimals, int32_t time_zone_offset, bool time_zone_aware) noexcept
Definition: mysql_stored_program_imp.cc:1202
Definition: mysql_stored_program_imp.h:259
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint64_t value) noexcept
Set value of an unsigned int return value.
Definition: mysql_stored_program_imp.cc:1292
Definition: mysql_stored_program_imp.h:189
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint32_t year) noexcept
Definition: mysql_stored_program_imp.cc:1030
Definition: mysql_stored_program_imp.h:90
static mysql_service_status_t get(stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t *year, uint32_t *month, uint32_t *day, bool *is_null) noexcept
Definition: mysql_stored_program_imp.cc:627
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t year, uint32_t month, uint32_t day) noexcept
Definition: mysql_stored_program_imp.cc:657
Definition: mysql_stored_program_imp.h:102
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t year, uint32_t month, uint32_t day, uint32_t hour, uint32_t minute, uint32_t second, uint64_t micro, bool negative, uint32_t decimals, int32_t time_zone_offset, bool time_zone_aware) noexcept
Definition: mysql_stored_program_imp.cc:744
static mysql_service_status_t get(stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t *year, uint32_t *month, uint32_t *day, uint32_t *hour, uint32_t *minute, uint32_t *second, uint64_t *micro, bool *negative, int32_t *time_zone_offset, bool *is_null) noexcept
Definition: mysql_stored_program_imp.cc:515
Definition: mysql_stored_program_imp.h:179
static mysql_service_status_t get(stored_program_runtime_context sp_runtime_context, uint16_t index, double *result, bool *is_null) noexcept
Get a float time value.
Definition: mysql_stored_program_imp.cc:988
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint16_t index, double value) noexcept
Set value of a float argument.
Definition: mysql_stored_program_imp.cc:1012
Definition: mysql_stored_program_imp.h:159
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint16_t index, int64_t value) noexcept
Set value of an int argument.
Definition: mysql_stored_program_imp.cc:920
static mysql_service_status_t get(stored_program_runtime_context sp_runtime_context, uint16_t index, int64_t *result, bool *is_null) noexcept
Get value of an int argument.
Definition: mysql_stored_program_imp.cc:896
Definition: mysql_stored_program_imp.h:132
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint16_t index) noexcept
Set null value.
Definition: mysql_stored_program_imp.cc:798
Definition: mysql_stored_program_imp.h:151
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint16_t index, char const *string, size_t length, CHARSET_INFO_h charset) noexcept
Definition: mysql_stored_program_imp.cc:873
Definition: mysql_stored_program_imp.h:139
static mysql_service_status_t get(stored_program_runtime_context sp_runtime_context, uint16_t index, char const **buffer, size_t *out_len, bool *is_null) noexcept
Get value of a string argument.
Definition: mysql_stored_program_imp.cc:825
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint16_t index, char const *string, size_t length) noexcept
Set value of a string argument.
Definition: mysql_stored_program_imp.cc:864
Definition: mysql_stored_program_imp.h:76
static mysql_service_status_t get(stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t *hour, uint32_t *minute, uint32_t *second, uint64_t *micro, bool *negative, bool *is_null) noexcept
Definition: mysql_stored_program_imp.cc:426
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t hour, uint32_t minute, uint32_t second, uint64_t micro, bool negative, uint8_t decimals) noexcept
Definition: mysql_stored_program_imp.cc:593
Definition: mysql_stored_program_imp.h:117
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t year, uint32_t month, uint32_t day, uint32_t hour, uint32_t minute, uint32_t second, uint64_t micro, bool negative, uint32_t decimals, int32_t time_zone_offset, bool time_zone_aware) noexcept
Definition: mysql_stored_program_imp.cc:777
static mysql_service_status_t get(stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t *year, uint32_t *month, uint32_t *day, uint32_t *hour, uint32_t *minute, uint32_t *second, uint64_t *micro, bool *negative, int32_t *time_zone_offset, bool *is_null) noexcept
Definition: mysql_stored_program_imp.cc:547
Definition: mysql_stored_program_imp.h:169
static mysql_service_status_t get(stored_program_runtime_context sp_runtime_context, uint16_t index, uint64_t *result, bool *is_null) noexcept
Get value of an unsigned int argument.
Definition: mysql_stored_program_imp.cc:942
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint16_t index, uint64_t value) noexcept
Set value of an unsigned int argument.
Definition: mysql_stored_program_imp.cc:966
Definition: mysql_stored_program_imp.h:66
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t year) noexcept
Definition: mysql_stored_program_imp.cc:567
static mysql_service_status_t get(stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t *year, bool *is_null) noexcept
Definition: mysql_stored_program_imp.cc:397
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
Services for reading and storing various stored program properties of the server stored program's obj...
struct stored_program_runtime_context_imp * stored_program_runtime_context
Definition: mysql_stored_program.h:35
struct CHARSET_INFO_h_imp * CHARSET_INFO_h
Definition: mysql_string.h:41
const std::string charset("charset")
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Specifies macros to define Service Implementations.
#define DEFINE_BOOL_METHOD(name, args)
A short macro to define method that returns bool, which is the most common case.
Definition: service_implementation.h:88
Definition: result.h:30