Skip to content

Commit a6e95ec

Browse files
add restart test
1 parent 22ed297 commit a6e95ec

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CREATE PROCEDURE p1(IN x COMPLEX, OUT y COMPLEX)
2+
BEGIN
3+
SET y = x;
4+
END//
5+
CREATE FUNCTION f1(x COMPLEX) RETURNS COMPLEX DETERMINISTIC
6+
BEGIN
7+
RETURN x;
8+
END//
9+
# restart
10+
CALL p1('(1.0,2.0)', @out);
11+
SELECT @out;
12+
@out
13+
(1,2)
14+
SELECT f1('(3.0,4.0)');
15+
f1('(3.0,4.0)')
16+
(3,4)
17+
DROP PROCEDURE p1;
18+
DROP FUNCTION f1;
19+
SET @out = NULL;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Test that stored procedures and functions with COMPLEX type work after server restart.
2+
# Verifies that custom type metadata survives cache invalidation and DD round-trip.
3+
4+
--source include/villagesql/install_complex_extension.inc
5+
6+
delimiter //;
7+
CREATE PROCEDURE p1(IN x COMPLEX, OUT y COMPLEX)
8+
BEGIN
9+
SET y = x;
10+
END//
11+
delimiter ;//
12+
13+
delimiter //;
14+
CREATE FUNCTION f1(x COMPLEX) RETURNS COMPLEX DETERMINISTIC
15+
BEGIN
16+
RETURN x;
17+
END//
18+
delimiter ;//
19+
20+
# Restart to clear SP cache - types must be restored from DD + custom_sp_params.
21+
--source include/restart_mysqld.inc
22+
23+
CALL p1('(1.0,2.0)', @out);
24+
SELECT @out;
25+
26+
SELECT f1('(3.0,4.0)');
27+
28+
DROP PROCEDURE p1;
29+
DROP FUNCTION f1;
30+
31+
# Clear user variables so TypeContext refs are released before UNINSTALL.
32+
SET @out = NULL;
33+
34+
--source include/villagesql/uninstall_complex_extension.inc

0 commit comments

Comments
 (0)