@@ -32,13 +32,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
32
32
DEFINE_SERVICE_HANDLE (stored_program_handle);
33
33
DEFINE_SERVICE_HANDLE (stored_program_runtime_context);
34
34
DEFINE_SERVICE_HANDLE (time_zone_handle);
35
- DEFINE_SERVICE_HANDLE (external_program_handle);
36
-
37
- /* *
38
- @file
39
- Services for reading and storing various stored program properties
40
- of the server stored program's object and its contexts.
41
- */
42
35
43
36
BEGIN_SERVICE_DEFINITION (mysql_stored_program_metadata_query)
44
37
@@ -794,94 +787,4 @@ DECLARE_BOOL_METHOD(set, (stored_program_runtime_context sp_runtime_context,
794
787
double value));
795
788
796
789
END_SERVICE_DEFINITION (mysql_stored_program_return_value_float)
797
-
798
- /* *
799
- @ingroup group_components_services_stored_programs
800
-
801
- Service to get and change the stored program's external language handle.
802
-
803
- In general, the server stored program object does handle
804
- the lifetime of the external language objects.
805
- It initiates the creation, parsing, execution and destruction of such objects.
806
- But, in rare cases, the external language component may request the server to
807
- change its external language object. Example of such cases are:
808
- * The stored program is aborted. The external language object needs to be
809
- destroyed and detached from the server object.
810
- * The session was reset. Either by explicit user demand, or when incompatible
811
- changes happen such as timezone change. All of its objects need to be
812
- destroyed and detached.
813
- * The limit of external language objects is reached. The oldest objects
814
- may be destroyed and detached.
815
- * The limit of external language sessions is reached. The oldest sessions
816
- may be destroyed, together with their language objects.
817
- * The external language object is changed. The new object needs to replace
818
- the existing one.
819
- @note Both the external language session and external language object
820
- services support lazy (re)initialization. The current object may be
821
- detached and destroyed. When another request to
822
- the same stored program comes, a new object will be created.
823
-
824
- Used approximately as follows:
825
-
826
- @code
827
- // Get the current external_program_handle.
828
- external_program_handle old_sp = nullptr;
829
- if (SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
830
- ->get(stored_program_handle, &old_sp))
831
- return 1;
832
-
833
- // Detach and destroy the current external_program_handle.
834
- if (SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
835
- ->set(stored_program_handle, nullptr))
836
- return 1;
837
- if (old_sp) destroy_stored_program(old_sp);
838
-
839
- // Create and attach a new external_program_handle.
840
- external_program_handle old_sp = create_stored_program();
841
- return SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
842
- ->set(stored_program_handle, nullptr);
843
-
844
- external_program_handle new_sp = create_stored_program();
845
- return SERVICE_PLACEHOLDER(mysql_stored_program_external_program_handle)
846
- ->set(stored_program_handle, new_sp);
847
-
848
- @endcode
849
- */
850
- BEGIN_SERVICE_DEFINITION(mysql_stored_program_external_program_handle)
851
-
852
- /* *
853
- Obtain the currently attached Language Component's Stored Program
854
- from the server object.
855
- @note: Only stored_program_handle belonging to current thread are supported.
856
-
857
- @param [in] sp stored_program_handle
858
- @param [out] value Language Component's Stored Program.
859
-
860
- @returns Status of operation
861
- @retval false Success
862
- @retval true Error
863
- */
864
-
865
- DECLARE_BOOL_METHOD(get,
866
- (stored_program_handle sp, external_program_handle *value));
867
-
868
- /* *
869
- Attach or detach the Language Component's Stored Program from the server
870
- object. In order to detach the current Stored Program from the server
871
- - provide nullptr value.
872
- @note: Only stored_program_handle belonging to current thread are supported.
873
-
874
- @param [in] sp stored_program_handle
875
- @param [in] value Language Component's Stored Program.
876
- Use nullptr to detach the current value from the server.
877
-
878
- @returns Status of operation
879
- @retval false Success
880
- @retval true Error
881
- */
882
-
883
- DECLARE_BOOL_METHOD (set,
884
- (stored_program_handle sp, external_program_handle value));
885
-
886
- END_SERVICE_DEFINITION (mysql_stored_program_external_program_handle)
887
790
#endif /* MYSQL_STORED_PROGRAM_H */
0 commit comments