MySQL 8.4.2
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>
28
31
32/**
33 Implementation of the mysql_stored_program services
34*/
36 public:
38 const char *key, void *value));
39};
40
41/*
42 * Argument-related services:
43 */
44
46 public:
48 (stored_program_handle sp_handle, uint16_t index,
49 const char *key, void *value));
50};
51
53 public:
55 const char *key, void *value));
56};
57
59 public:
61 (stored_program_runtime_context sp_runtime_context,
62 char const **value));
63};
64
66 public:
68 (stored_program_runtime_context sp_runtime_context,
69 uint16_t index, uint32_t *year, bool *is_null));
71 (stored_program_runtime_context sp_runtime_context,
72 uint16_t index, uint32_t year));
73};
74
76 public:
78 (stored_program_runtime_context sp_runtime_context,
79 uint16_t index, uint32_t *hour, uint32_t *minute,
80 uint32_t *second, uint64_t *micro, bool *negative,
81 bool *is_null));
83 (stored_program_runtime_context sp_runtime_context,
84 uint16_t index, uint32_t hour, uint32_t minute,
85 uint32_t second, uint64_t micro, bool negative,
86 uint8_t decimals));
87};
88
90 public:
92 (stored_program_runtime_context sp_runtime_context,
93 uint16_t index, uint32_t *year, uint32_t *month,
94 uint32_t *day, bool *is_null));
96 (stored_program_runtime_context sp_runtime_context,
97 uint16_t index, uint32_t year, uint32_t month,
98 uint32_t day));
99};
100
102 public:
103 static DEFINE_BOOL_METHOD(get,
104 (stored_program_runtime_context sp_runtime_context,
105 uint16_t index, uint32_t *year, uint32_t *month,
106 uint32_t *day, uint32_t *hour, uint32_t *minute,
107 uint32_t *second, uint64_t *micro, bool *negative,
108 int32_t *time_zone_offset, bool *is_null));
109 static DEFINE_BOOL_METHOD(
110 set, (stored_program_runtime_context sp_runtime_context, uint16_t index,
111 uint32_t year, uint32_t month, uint32_t day, uint32_t hour,
112 uint32_t minute, uint32_t second, uint64_t micro, bool negative,
113 uint32_t decimals, int32_t time_zone_offset, bool time_zone_aware));
114};
115
117 public:
118 static DEFINE_BOOL_METHOD(get,
119 (stored_program_runtime_context sp_runtime_context,
120 uint16_t index, uint32_t *year, uint32_t *month,
121 uint32_t *day, uint32_t *hour, uint32_t *minute,
122 uint32_t *second, uint64_t *micro, bool *negative,
123 int32_t *time_zone_offset, bool *is_null));
124 static DEFINE_BOOL_METHOD(
125 set, (stored_program_runtime_context sp_runtime_context, uint16_t index,
126 uint32_t year, uint32_t month, uint32_t day, uint32_t hour,
127 uint32_t minute, uint32_t second, uint64_t micro, bool negative,
128 uint32_t decimals, int32_t time_zone_offset, bool time_zone_aware));
129};
130
132 public:
133 static DEFINE_BOOL_METHOD(set,
134 (stored_program_runtime_context sp_runtime_context,
135 uint16_t index));
136};
137
139 public:
140 static DEFINE_BOOL_METHOD(get,
141 (stored_program_runtime_context sp_runtime_context,
142 uint16_t index, char const **buffer,
143 size_t *out_len, bool *is_null));
144 static DEFINE_BOOL_METHOD(set,
145 (stored_program_runtime_context sp_runtime_context,
146 uint16_t index, char const *string,
147 size_t length));
148};
149
151 public:
152 static DEFINE_BOOL_METHOD(get,
153 (stored_program_runtime_context sp_runtime_context,
154 uint16_t index, int64_t *result, bool *is_null));
155 static DEFINE_BOOL_METHOD(set,
156 (stored_program_runtime_context sp_runtime_context,
157 uint16_t index, int64_t value));
158};
159
161 public:
162 static DEFINE_BOOL_METHOD(get,
163 (stored_program_runtime_context sp_runtime_context,
164 uint16_t index, uint64_t *result, bool *is_null));
165 static DEFINE_BOOL_METHOD(set,
166 (stored_program_runtime_context sp_runtime_context,
167 uint16_t index, uint64_t value));
168};
169
171 public:
172 static DEFINE_BOOL_METHOD(get,
173 (stored_program_runtime_context sp_runtime_context,
174 uint16_t index, double *result, bool *is_null));
175 static DEFINE_BOOL_METHOD(set,
176 (stored_program_runtime_context sp_runtime_context,
177 uint16_t index, double value));
178};
179
181 public:
182 static DEFINE_BOOL_METHOD(set,
183 (stored_program_runtime_context sp_runtime_context,
184 uint32_t year));
185};
186
188 public:
189 static DEFINE_BOOL_METHOD(set,
190 (stored_program_runtime_context sp_runtime_context,
191 uint32_t hour, uint32_t minute, uint32_t second,
192 uint64_t micro, bool negative, uint8_t decimals));
193};
194
196 public:
197 static DEFINE_BOOL_METHOD(set,
198 (stored_program_runtime_context sp_runtime_context,
199 uint32_t year, uint32_t month, uint32_t day));
200};
201
203 public:
204 static DEFINE_BOOL_METHOD(set,
205 (stored_program_runtime_context sp_runtime_context,
206 uint32_t year, uint32_t month, uint32_t day,
207 uint32_t hour, uint32_t minute, uint32_t second,
208 uint64_t micro, bool negative, uint32_t decimals,
209 int32_t time_zone_offset, bool time_zone_aware));
210};
211
213 public:
214 static DEFINE_BOOL_METHOD(set,
215 (stored_program_runtime_context sp_runtime_context,
216 uint32_t year, uint32_t month, uint32_t day,
217 uint32_t hour, uint32_t minute, uint32_t second,
218 uint64_t micro, bool negative, uint32_t decimals,
219 int32_t time_zone_offset, bool time_zone_aware));
220};
221
223 public:
224 static DEFINE_BOOL_METHOD(
225 set, (stored_program_runtime_context sp_runtime_context));
226};
227
229 public:
230 static DEFINE_BOOL_METHOD(set,
231 (stored_program_runtime_context sp_runtime_context,
232 char const *string, size_t length));
233};
234
236 public:
237 static DEFINE_BOOL_METHOD(set,
238 (stored_program_runtime_context sp_runtime_context,
239 int64_t value));
240};
241
243 public:
244 static DEFINE_BOOL_METHOD(set,
245 (stored_program_runtime_context sp_runtime_context,
246 uint64_t value));
247};
248
250 public:
251 static DEFINE_BOOL_METHOD(set,
252 (stored_program_runtime_context sp_runtime_context,
253 double value));
254};
255
257 public:
260
263};
264#endif /* MYSQL_STORED_PROGRAM_IMP_H */
Definition: mysql_stored_program_imp.h:45
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:282
Definition: mysql_stored_program_imp.h:256
static mysql_service_status_t get(stored_program_handle sp, external_program_handle *value) noexcept
Definition: mysql_stored_program_imp.cc:1310
static mysql_service_status_t set(stored_program_handle sp, external_program_handle value) noexcept
Definition: mysql_stored_program_imp.cc:1322
Definition: mysql_stored_program_imp.h:58
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:372
Implementation of the mysql_stored_program services.
Definition: mysql_stored_program_imp.h:35
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:68
Definition: mysql_stored_program_imp.h:52
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:319
Definition: mysql_stored_program_imp.h:195
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:1068
Definition: mysql_stored_program_imp.h:202
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:1153
Definition: mysql_stored_program_imp.h:249
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:1285
Definition: mysql_stored_program_imp.h:235
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:1245
Definition: mysql_stored_program_imp.h:222
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context) noexcept
Set null value.
Definition: mysql_stored_program_imp.cc:1204
Definition: mysql_stored_program_imp.h:228
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:1225
Definition: mysql_stored_program_imp.h:187
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:1037
Definition: mysql_stored_program_imp.h:212
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:1185
Definition: mysql_stored_program_imp.h:242
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:1265
Definition: mysql_stored_program_imp.h:180
static mysql_service_status_t set(stored_program_runtime_context sp_runtime_context, uint32_t year) noexcept
Definition: mysql_stored_program_imp.cc:1013
Definition: mysql_stored_program_imp.h:89
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:624
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:654
Definition: mysql_stored_program_imp.h:101
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:741
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:512
Definition: mysql_stored_program_imp.h:170
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:971
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:995
Definition: mysql_stored_program_imp.h:150
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:903
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:879
Definition: mysql_stored_program_imp.h:131
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:795
Definition: mysql_stored_program_imp.h:138
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:822
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:857
Definition: mysql_stored_program_imp.h:75
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:423
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:590
Definition: mysql_stored_program_imp.h:116
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:774
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:544
Definition: mysql_stored_program_imp.h:160
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:925
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:949
Definition: mysql_stored_program_imp.h:65
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:564
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:394
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:34
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