Debian Codegraph @

mysql-test/suite/service_udf_registration/t/udf_reg_same_func.test

raw
1 # Test of register same UDFs with 2 different components. Must work and give errors.
2 # Register myfunc_int.
3 INSTALL COMPONENT "file://component_udf_reg_int_same_func";
4
5 # Verify, that UDF is working.
6 select myfunc_int(5);
7 select myfunc_int(5,6,9);
8
9 # Check performance_schema.
10 SELECT * FROM performance_schema.user_defined_functions
11 WHERE udf_name IN('myfunc_int')
12 ORDER BY udf_name;
13
14 # Try to register sam UDF (myfunc_int) with another component: Error.
15 --error ER_COMPONENTS_LOAD_CANT_INITIALIZE
16 INSTALL COMPONENT "file://component_udf_reg_int_func";
17
18 # Verify, that UDF is still working.
19 select myfunc_int(5);
20 select myfunc_int(5,6,9);
21
22 # Check performance_schema has stiil the same contents..
23 SELECT * FROM performance_schema.user_defined_functions
24 WHERE udf_name IN('myfunc_int')
25 ORDER BY udf_name;
26
27 # Unregister the UDF myfunc_int.
28 UNINSTALL COMPONENT "file://component_udf_reg_int_same_func";
29
30 # Check performsance_schema.
31 SELECT * FROM performance_schema.user_defined_functions
32 WHERE udf_name IN('myfunc_int')
33 ORDER BY udf_name;
34
35 # UDF not more registered.
36 --error ER_SP_DOES_NOT_EXIST
37 select myfunc_int(5);
38
39 # Reject to unload a not loaded component.
40 --error ER_COMPONENTS_UNLOAD_NOT_LOADED
41 UNINSTALL COMPONENT "file://component_udf_reg_int_func";
42