MySQL 8.4.0
Source Code Documentation
mysql_stored_program.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_H
25#define MYSQL_STORED_PROGRAM_H
26
28#include <cstddef> // size_t
29#include <cstdint> // intXX_t
32
37
38/**
39 @file
40 Services for reading and storing various stored program properties
41 of the server stored program's object and its contexts.
42*/
43
44BEGIN_SERVICE_DEFINITION(mysql_stored_program_metadata_query)
45
46/**
47 Get stored program data
48
49 Accepted keys and corresponding data type
50
51 "sp_name" -> mysql_cstring_with_length *
52 "database_name" -> mysql_cstring_with_length *
53 "qualified_name" -> mysql_cstring_with_length *
54 "sp_language" -> mysql_cstring_with_length *
55 "sp_body" -> mysql_cstring_with_length *
56 "sp_type" -> uint16_t
57 "argument_count" -> uint32_t
58
59 @param [in] sp_handle Handle to stored procedure structure
60 @param [in] key Metadata name
61 @param [out] value Metadata value
62
63 @returns Status of operation
64 @retval false Success
65 @retval true Failure
66*/
67
68DECLARE_BOOL_METHOD(get, (stored_program_handle sp_handle, const char *key,
69 void *value));
70
71END_SERVICE_DEFINITION(mysql_stored_program_metadata_query)
72
73/*
74 * Argument-related services:
75 */
76
77BEGIN_SERVICE_DEFINITION(mysql_stored_program_argument_metadata_query)
78
79/**
80 Get stored program argument metadata
81
82 "argument_name" -> const char *
83 "sql_type" -> uint64_t
84 "in_variable" -> boolean
85 "out_variable" -> boolean
86 "is_signed" -> boolean (Applicable to numeric data types)
87 "is_nullable" -> boolean
88 "byte_length" -> uint64_t
89 "char_length" -> uint64_t (Applicable to string data types)
90 "charset" -> char const *
91
92 @param [in] sp_handle Handle to stored procedure structure
93 @param [in] index Argument index
94 @param [in] key Metadata name
95 @param [out] value Metadata value
96
97
98 @returns status of get operation
99 @retval false Success
100 @retval true Failure
101*/
102
103DECLARE_BOOL_METHOD(get, (stored_program_handle sp_handle, uint16_t index,
104 const char *key, void *value));
105
106END_SERVICE_DEFINITION(mysql_stored_program_argument_metadata_query)
107
108BEGIN_SERVICE_DEFINITION(mysql_stored_program_return_metadata_query)
109
110/**
111 Get stored program return value metadata
112
113 "argument_name" -> const char *
114 "sql_type" -> uint64_t
115 "is_signed" -> boolean (Applicable to numeric data types)
116 "is_nullable" -> boolean
117 "byte_length" -> uint64_t
118 "char_length" -> uint64_t (Applicable to string data types)
119 "charset" -> char const *
120
121 @param [in] sp_handle Handle to stored procedure structure
122 @param [in] key Metadata name
123 @param [out] value Metadata value
124
125
126 @returns status of get operation
127 @retval false Success
128 @retval true Failure
129*/
130
131DECLARE_BOOL_METHOD(get, (stored_program_handle sp_handle, const char *key,
132 void *value));
133
134END_SERVICE_DEFINITION(mysql_stored_program_return_metadata_query)
135
136BEGIN_SERVICE_DEFINITION(mysql_stored_program_field_name)
137
138/**
139 Returns the field name of the return value
140 @param [in] sp_runtime_context stored program runtime context.
141 If null, current runtime context
142 will be used.
143 @param [out] value The field name of the return value
144
145
146 @returns status of get operation
147 @retval false Success
148 @retval true Failure
149*/
150
152 char const **value));
153
154END_SERVICE_DEFINITION(mysql_stored_program_field_name)
155
156BEGIN_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_year)
157
158/**
159 @param [in] sp_runtime_context stored program runtime context.
160 If null, current runtime context will
161 be used.
162 @param [in] index Argument position
163 @param [out] year Year
164 @param [out] is_null Flag to indicate if value is null
165
166 @returns Status of operation
167 @retval false Success
168 @retval true Error
169*/
170
172 uint16_t index, uint32_t *year, bool *is_null));
173
174/**
175 @param [in] sp_runtime_context stored program runtime context.
176 If null, current runtime context will be
177 used.
178 @param [in] index Argument location
179 @param [in] year Year
180
181 @returns Status of operation
182 @retval false Success
183 @retval true Error
184*/
185
187 uint16_t index, uint32_t year));
188
189END_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_year)
190
191BEGIN_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_time)
192
193/**
194 @param [in] sp_runtime_context stored program runtime context.
195 If null, current runtime context will
196 be used.
197 @param [in] index Argument position
198 @param [out] hour Hour of the day
199 @param [out] minute Minute of the hour
200 @param [out] second Second of the minute
201 @param [out] micro Micro second of the second
202 @param [out] negative Is negative
203 @param [out] is_null Flag to indicate if value is null
204
205 @returns Status of operation
206 @retval false Success
207 @retval true Error
208*/
209
211 uint16_t index, uint32_t *hour, uint32_t *minute,
212 uint32_t *second, uint64_t *micro, bool *negative,
213 bool *is_null));
214
215/**
216 @param [in] sp_runtime_context stored program runtime context.
217 If null, current runtime context will be
218 used.
219 @param [in] index Argument location
220 @param [in] hour Hour of the day
221 @param [in] minute Minute of the hour
222 @param [in] second Second of the minute
223 @param [in] micro Micro second of the second
224 @param [in] negative Is negative
225 @param [in] decimals Precision information
226
227 @returns Status of operation
228 @retval false Success
229 @retval true Error
230*/
231
233 uint16_t index, uint32_t hour, uint32_t minute,
234 uint32_t second, uint64_t micro, bool negative,
235 uint8_t decimals));
236
237END_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_time)
238
239BEGIN_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_date)
240
241/**
242 @param [in] sp_runtime_context stored program runtime context.
243 If null, current runtime context will be
244 used.
245 @param [in] index Argument position
246 @param [out] year Year information
247 @param [out] month Month of the year
248 @param [out] day Day of the month
249 @param [out] is_null Flag to indicate if value is null
250
251 @returns Status of operation
252 @retval false Success
253 @retval true Error
254*/
255
257 uint16_t index, uint32_t *year, uint32_t *month,
258 uint32_t *day, bool *is_null));
259
260/**
261 @param [in] sp_runtime_context stored program runtime context.
262 If null, current runtime context will be
263 used.
264 @param [in] index Argument position
265 @param [in] year Year information
266 @param [in] month Month of the year
267 @param [in] day Day of the month
268
269 @returns Status of operation
270 @retval false Success
271 @retval true Error
272*/
273
275 uint16_t index, uint32_t year, uint32_t month,
276 uint32_t day));
277
278END_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_date)
279
280BEGIN_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_datetime)
281
282/**
283 @param [in] sp_runtime_context stored program runtime context.
284 If null, current runtime context will
285 be used.
286 @param [in] index Argument position
287 @param [out] year Year part
288 @param [out] month Month of the year
289 @param [out] day Day of the month
290 @param [out] hour Hour of the day
291 @param [out] minute Minute of the hour
292 @param [out] second Second of the minute
293 @param [out] micro Micro second of the second
294 @param [out] negative Is negative
295 @param [out] time_zone_offset Time zone offset in seconds
296 @param [out] is_null Flag to indicate if value is null
297
298 @returns Status of operation
299 @retval false Success
300 @retval true Error
301*/
302
304 uint16_t index, uint32_t *year, uint32_t *month,
305 uint32_t *day, uint32_t *hour, uint32_t *minute,
306 uint32_t *second, uint64_t *micro, bool *negative,
307 int32_t *time_zone_offset, bool *is_null));
308
309/**
310 @param [in] sp_runtime_context stored program runtime context.
311 If null, current runtime context will be
312 used.
313 @param [in] index Argument position
314 @param [in] year Year part
315 @param [in] month Month of the year
316 @param [in] day Day of the month
317 @param [in] hour Hour of the day
318 @param [in] minute Minute of the hour
319 @param [in] second Second of the minute
320 @param [in] micro Micro second of the second
321 @param [in] negative Is negative
322 @param [in] decimals Precision information
323 @param [in] time_zone_offset Time zone offset in seconds
324 @param [in] time_zone_aware Is time zone aware
325
326 @returns Status of operation
327 @retval false Success
328 @retval true Error
329*/
330
332 uint16_t index, uint32_t year, uint32_t month,
333 uint32_t day, uint32_t hour, uint32_t minute,
334 uint32_t second, uint64_t micro, bool negative,
335 uint32_t decimals, int32_t time_zone_offset,
336 bool time_zone_aware));
337
338END_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_datetime)
339
340BEGIN_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_timestamp)
341
342/**
343 @param [in] sp_runtime_context stored program runtime context.
344 If null, current runtime context will
345 be used.
346 @param [in] index Argument position
347 @param [out] year Year part
348 @param [out] month Month of the year
349 @param [out] day Day of the month
350 @param [out] hour Hour of the day
351 @param [out] minute Minute of the hour
352 @param [out] second Second of the minute
353 @param [out] micro Micro second of the second
354 @param [out] negative Is negative
355 @param [out] time_zone_offset Time zone offset in seconds
356 @param [out] is_null Flag to indicate if value is null
357
358 @returns Status of operation
359 @retval false Success
360 @retval true Error
361*/
362
364 uint16_t index, uint32_t *year, uint32_t *month,
365 uint32_t *day, uint32_t *hour, uint32_t *minute,
366 uint32_t *second, uint64_t *micro, bool *negative,
367 int32_t *time_zone_offset, bool *is_null));
368
369/**
370 @param [in] sp_runtime_context stored program runtime context.
371 If null, current runtime context will be
372 used.
373 @param [in] index Argument position
374 @param [in] year Year part
375 @param [in] month Month of the year
376 @param [in] day Day of the month
377 @param [in] hour Hour of the day
378 @param [in] minute Minute of the hour
379 @param [in] second Second of the minute
380 @param [in] micro Micro second of the second
381 @param [in] negative Is negative
382 @param [in] decimals Precision information
383 @param [in] time_zone_offset Time zone offset in seconds
384 @param [in] time_zone_aware Is time zone aware
385
386 @returns Status of operation
387 @retval false Success
388 @retval true Error
389*/
390
392 uint16_t index, uint32_t year, uint32_t month,
393 uint32_t day, uint32_t hour, uint32_t minute,
394 uint32_t second, uint64_t micro, bool negative,
395 uint32_t decimals, int32_t time_zone_offset,
396 bool time_zone_aware));
397
398END_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_timestamp)
399
400BEGIN_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_null)
401
402/**
403 Set null value
404
405 @param [in] sp_runtime_context stored program runtime context.
406 If null, current runtime context will be
407 used.
408 @param [in] index Argument position
409
410 @returns Status of operation
411 @retval false Success
412 @retval true Error
413*/
414
416 uint16_t index));
417END_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_null)
418
419BEGIN_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_string)
420
421/**
422 Get value of a string argument
423
424 @param [in] sp_runtime_context stored program runtime context.
425 If null, current runtime context will be
426 used.
427 @param [in] index Argument position
428 @param [out] value A pointer to the current value
429 @param [out] length Length of the current value
430 @param [out] is_null Flag to indicate if value is null
431
432 @returns Status of operation
433 @retval false Success
434 @retval true Error
435*/
436
438 uint16_t index, char const **value, size_t *length,
439 bool *is_null));
440/**
441 Set value of a string argument
442
443 @param [in] sp_runtime_context stored program runtime context.
444 If null, current runtime context will be
445 used.
446 @param [in] index Argument position
447 @param [in] string Value of the argument
448 @param [in] length Length of the string
449
450 @returns Status of operation
451 @retval false Success
452 @retval true Error
453*/
454
456 uint16_t index, char const *string, size_t length));
457
458END_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_string)
459
460BEGIN_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_int)
461
462/**
463 Get value of an int argument
464
465 @param [in] sp_runtime_context stored program runtime context.
466 If null, current runtime context will be
467 used.
468 @param [in] index Argument position
469 @param [out] result Value of the argument
470 @param [out] is_null Flag to indicate if value is null
471
472 @returns Status of operation
473 @retval false Success
474 @retval true Error
475*/
476
478 uint16_t index, int64_t *result, bool *is_null));
479
480/**
481 Set value of an int argument
482
483 @param [in] sp_runtime_context stored program runtime context.
484 If null, current runtime context will be
485 used.
486 @param [in] index Argument position
487 @param [in] value Value to be set
488
489 @returns Status of operation
490 @retval false Success
491 @retval true Error
492*/
493
495 uint16_t index, int64_t value));
496
497END_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_int)
498
499BEGIN_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_unsigned_int)
500
501/**
502 Get value of an unsigned int argument
503
504 @param [in] sp_runtime_context stored program runtime context.
505 If null, current runtime context will be
506 used.
507 @param [in] index Argument position
508 @param [out] result Value of the argument
509 @param [out] is_null Flag to indicate if value is null
510
511 @returns Status of operation
512 @retval false Success
513 @retval true Error
514*/
515
517 uint16_t index, uint64_t *result, bool *is_null));
518
519/**
520 Set value of an unsigned int argument
521
522 @param [in] sp_runtime_context stored program runtime context.
523 If null, current runtime context will be
524 used.
525 @param [in] index Argument position
526 @param [in] value Value to be set
527
528 @returns Status of operation
529 @retval false Success
530 @retval true Error
531*/
532
534 uint16_t index, uint64_t value));
535
536END_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_unsigned_int)
537
538BEGIN_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_float)
539
540/**
541 Get a float value
542
543 @param [in] sp_runtime_context stored program runtime context.
544 If null, current runtime context will be
545 used.
546 @param [in] index Argument position
547 @param [out] result Value of the argument
548 @param [out] is_null Flag to indicate if value is null
549
550 @returns Status of operation
551 @retval false Success
552 @retval true Error
553*/
554
556 uint16_t index, double *result, bool *is_null));
557
558/**
559 Set value of a float argument
560
561 @param [in] sp_runtime_context stored program runtime context.
562 If null, current runtime context will be
563 used.
564 @param [in] index Argument position
565 @param [in] value value to be set
566
567 @returns Status of operation
568 @retval false Success
569 @retval true Error
570*/
571
573 uint16_t index, double value));
574
575END_SERVICE_DEFINITION(mysql_stored_program_runtime_argument_float)
576
577BEGIN_SERVICE_DEFINITION(mysql_stored_program_return_value_year)
578
579/**
580 @param [in] sp_runtime_context stored program runtime context.
581 If null, current runtime context will be
582 used.
583 @param [in] year Year
584
585 @returns Status of operation
586 @retval false Success
587 @retval true Error
588*/
589
591 uint32_t year));
592
593END_SERVICE_DEFINITION(mysql_stored_program_return_value_year)
594
595BEGIN_SERVICE_DEFINITION(mysql_stored_program_return_value_time)
596
597/**
598 @param [in] sp_runtime_context stored program runtime context.
599 If null, current runtime context will be
600 used.
601 @param [in] hour Hour of the day
602 @param [in] minute Minute of the hour
603 @param [in] second Second of the minute
604 @param [in] micro Micro second of the second
605 @param [in] negative Is negative
606 @param [in] decimals Precision information
607
608 @returns Status of operation
609 @retval false Success
610 @retval true Error
611*/
612
614 uint32_t hour, uint32_t minute, uint32_t second,
615 uint64_t micro, bool negative, uint8_t decimals));
616
617END_SERVICE_DEFINITION(mysql_stored_program_return_value_time)
618
619BEGIN_SERVICE_DEFINITION(mysql_stored_program_return_value_date)
620
621/**
622 @param [in] sp_runtime_context stored program runtime context.
623 If null, current runtime context will be
624 used.
625 @param [in] year Year information
626 @param [in] month Month of the year
627 @param [in] day Day of the month
628
629 @returns Status of operation
630 @retval false Success
631 @retval true Error
632*/
633
635 uint32_t year, uint32_t month, uint32_t day));
636
637END_SERVICE_DEFINITION(mysql_stored_program_return_value_date)
638
639BEGIN_SERVICE_DEFINITION(mysql_stored_program_return_value_datetime)
640
641/**
642 @param [in] sp_runtime_context stored program runtime context.
643 If null, current runtime context will be
644 used.
645 @param [in] year Year part
646 @param [in] month Month of the year
647 @param [in] day Day of the month
648 @param [in] hour Hour of the day
649 @param [in] minute Minute of the hour
650 @param [in] second Second of the minute
651 @param [in] micro Micro second of the second
652 @param [in] negative Is negative
653 @param [in] decimals Precision information
654 @param [in] time_zone_offset Time zone offset in seconds
655 @param [in] time_zone_aware Is time zone aware
656
657 @returns Status of operation
658 @retval false Success
659 @retval true Error
660*/
661
663 uint32_t year, uint32_t month, uint32_t day,
664 uint32_t hour, uint32_t minute, uint32_t second,
665 uint64_t micro, bool negative, uint32_t decimals,
666 int32_t time_zone_offset, bool time_zone_aware));
667
668END_SERVICE_DEFINITION(mysql_stored_program_return_value_datetime)
669
670BEGIN_SERVICE_DEFINITION(mysql_stored_program_return_value_timestamp)
671
672/**
673 @param [in] sp_runtime_context stored program runtime context.
674 If null, current runtime context will be
675 used.
676 @param [in] year Year part
677 @param [in] month Month of the year
678 @param [in] day Day of the month
679 @param [in] hour Hour of the day
680 @param [in] minute Minute of the hour
681 @param [in] second Second of the minute
682 @param [in] micro Micro second of the second
683 @param [in] negative Is negative
684 @param [in] decimals Precision information
685 @param [in] time_zone_offset Time zone offset in seconds
686 @param [in] time_zone_aware Is time zone aware
687
688 @returns Status of operation
689 @retval false Success
690 @retval true Error
691*/
692
694 uint32_t year, uint32_t month, uint32_t day,
695 uint32_t hour, uint32_t minute, uint32_t second,
696 uint64_t micro, bool negative, uint32_t decimals,
697 int32_t time_zone_offset, bool time_zone_aware));
698
699END_SERVICE_DEFINITION(mysql_stored_program_return_value_timestamp)
700
701BEGIN_SERVICE_DEFINITION(mysql_stored_program_return_value_null)
702
703/**
704 Set null value
705
706 @param [in] sp_runtime_context stored program runtime context.
707 If null, current runtime context will be
708 used.
709
710 @returns Status of operation
711 @retval false Success
712 @retval true Error
713*/
714
716END_SERVICE_DEFINITION(mysql_stored_program_return_value_null)
717
718BEGIN_SERVICE_DEFINITION(mysql_stored_program_return_value_string)
719
720/**
721 Set value of a string return value
722
723 @param [in] sp_runtime_context stored program runtime context.
724 If null, current runtime context will be
725 used.
726 @param [in] string Value of the argument
727 @param [in] length Length of the string
728
729 @returns Status of operation
730 @retval false Success
731 @retval true Error
732*/
733
735 char const *string, size_t length));
736
737END_SERVICE_DEFINITION(mysql_stored_program_return_value_string)
738
739BEGIN_SERVICE_DEFINITION(mysql_stored_program_return_value_int)
740
741/**
742 Set value of an int return value
743
744 @param [in] sp_runtime_context stored program runtime context.
745 If null, current runtime context will be
746 used.
747 @param [in] value Value to be set
748
749 @returns Status of operation
750 @retval false Success
751 @retval true Error
752*/
753
755 int64_t value));
756
757END_SERVICE_DEFINITION(mysql_stored_program_return_value_int)
758
759BEGIN_SERVICE_DEFINITION(mysql_stored_program_return_value_unsigned_int)
760
761/**
762 Set value of an unsigned int return value
763
764 @param [in] sp_runtime_context stored program runtime context.
765 If null, current runtime context will be
766 used.
767 @param [in] value Value to be set
768
769 @returns Status of operation
770 @retval false Success
771 @retval true Error
772*/
773
775 uint64_t value));
776
777END_SERVICE_DEFINITION(mysql_stored_program_return_value_unsigned_int)
778
779BEGIN_SERVICE_DEFINITION(mysql_stored_program_return_value_float)
780
781/**
782 Set value of a float return value
783
784 @param [in] sp_runtime_context stored program runtime context.
785 If null, current runtime context will be
786 used.
787 @param [in] value value to be set
788
789 @returns Status of operation
790 @retval false Success
791 @retval true Error
792*/
793
795 double value));
796
797END_SERVICE_DEFINITION(mysql_stored_program_return_value_float)
798
799/**
800 @ingroup group_components_services_stored_programs
801
802 Service to get and change the stored program's external language handle.
803
804 In general, the server stored program object does handle
805 the lifetime of the external language objects.
806 It initiates the creation, parsing, execution and destruction of such objects.
807 But, in rare cases, the external language component may request the server to
808 change its external language object. Example of such cases are:
809 * The stored program is aborted. The external language object needs to be
810 destroyed and detached from the server object.
811 * The session was reset. Either by explicit user demand, or when incompatible
812 changes happen such as timezone change. All of its objects need to be
813 destroyed and detached.
814 * The limit of external language objects is reached. The oldest objects
815 may be destroyed and detached.
816 * The limit of external language sessions is reached. The oldest sessions
817 may be destroyed, together with their language objects.
818 * The external language object is changed. The new object needs to replace
819 the existing one.
820 @note Both the external language session and external language object
821 services support lazy (re)initialization. The current object may be
822 detached and destroyed. When another request to
823 the same stored program comes, a new object will be created.
824
825 Used approximately as follows:
826
827 @code
828 // Get the current external_program_handle.
829 external_program_handle old_sp = nullptr;
830 if (SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
831 ->get(stored_program_handle, &old_sp))
832 return 1;
833
834 // Detach and destroy the current external_program_handle.
835 if (SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
836 ->set(stored_program_handle, nullptr))
837 return 1;
838 if (old_sp) destroy_stored_program(old_sp);
839
840 // Create and attach a new external_program_handle.
841 external_program_handle old_sp = create_stored_program();
842 return SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
843 ->set(stored_program_handle, nullptr);
844
845 external_program_handle new_sp = create_stored_program();
846 return SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
847 ->set(stored_program_handle, new_sp);
848
849 @endcode
850*/
851BEGIN_SERVICE_DEFINITION(mysql_stored_program_external_program_handle)
852
853/**
854 Obtain the currently attached Language Component's Stored Program
855 from the server object.
856 @note: Only stored_program_handle belonging to current thread are supported.
857
858 @param [in] sp stored_program_handle
859 @param [out] value Language Component's Stored Program.
860
861 @returns Status of operation
862 @retval false Success
863 @retval true Error
864*/
865
868
869/**
870 Attach or detach the Language Component's Stored Program from the server
871 object. In order to detach the current Stored Program from the server
872 - provide nullptr value.
873 @note: Only stored_program_handle belonging to current thread are supported.
874
875 @param [in] sp stored_program_handle
876 @param [in] value Language Component's Stored Program.
877 Use nullptr to detach the current value from the server.
878
879 @returns Status of operation
880 @retval false Success
881 @retval true Error
882*/
883
886
887END_SERVICE_DEFINITION(mysql_stored_program_external_program_handle)
888#endif /* MYSQL_STORED_PROGRAM_H */
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
struct stored_program_runtime_context_imp * stored_program_runtime_context
Definition: mysql_stored_program.h:34
struct time_zone_handle_imp * time_zone_handle
Definition: mysql_stored_program.h:35
String related data structures.
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
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
required string key
Definition: replication_asynchronous_connection_failover.proto:60
#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
#define DEFINE_SERVICE_HANDLE(name)
Defines an object type that is meant for carrying handles to the implementation-specific objects used...
Definition: service.h:129
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:112
Definition: result.h:30