Debian Codegraph @

mysql-test/suite/service_udf_registration/r/udf_reg_3_func.result

raw
1 INSTALL COMPONENT "file://component_udf_reg_3_func";
2 SELECT myfunc_double();
3 ERROR HY000: Can't initialize function 'myfunc_double'; myfunc_double must have at least one argument
4 SELECT myfunc_double(1);
5 myfunc_double(1)
6 49.00
7 SELECT myfunc_double(78654);
8 myfunc_double(78654)
9 54.00
10 SELECT myfunc_int();
11 myfunc_int()
12 0
13 SELECT myfunc_int(5);
14 myfunc_int(5)
15 5
16 SELECT myfunc_int('MySQL V8.0');
17 myfunc_int('MySQL V8.0')
18 10
19 CREATE TABLE t1(a INT, b INT);
20 INSERT INTO t1 values (1,1),(2,2);
21 SELECT myfunc_int(a AS attr_name) FROM t1;
22 myfunc_int(a AS attr_name)
23 1
24 2
25 DROP TABLE t1;
26 CREATE TABLE t1(sum int, price float(24));
27 INSERT INTO t1 VALUES(100, 50.00), (100, 100.00);
28 SELECT avgcost(sum, price) from t1;
29 avgcost(sum, price)
30 75.0000
31 DELETE from t1;
32 INSERT INTO t1 VALUES(100, 54.33), (200, 199.99);
33 SELECT avgcost(sum, price) from t1;
34 avgcost(sum, price)
35 151.4367
36 DROP TABLE t1;
37 UNINSTALL COMPONENT "file://component_udf_reg_3_func";
38 SELECT myfunc_double(1);
39 ERROR 42000: FUNCTION test.myfunc_double does not exist
40 SELECT myfunc_int(1);
41 ERROR 42000: FUNCTION test.myfunc_int does not exist
42 INSTALL COMPONENT "file://component_udf_reg_3_func";
43 SELECT myfunc_double(78654);
44 myfunc_double(78654)
45 54.00
46 SELECT myfunc_int(5);
47 myfunc_int(5)
48 5
49 INSTALL COMPONENT "file://component_udf_unreg_int_func";
50 UNINSTALL COMPONENT "file://component_udf_unreg_int_func";
51 SELECT myfunc_double(78654);
52 myfunc_double(78654)
53 54.00
54 SELECT myfunc_int(5);
55 ERROR 42000: FUNCTION test.myfunc_int does not exist
56 UNINSTALL COMPONENT "file://component_udf_reg_3_func";