This repository has been archived on 2024-01-15. You can view files and clone it, but cannot push or open issues or pull requests.
vn-mysql/udfs/test/udf.sql

22 lines
380 B
MySQL
Raw Normal View History

2019-12-02 20:13:19 +00:00
/**
* Run this script and monitor server memory to make sure
* there are no memory leaks.
*/
2019-12-02 20:10:07 +00:00
DELIMITER $$
CREATE PROCEDURE udf_test(vLoops BIGINT)
BEGIN
DECLARE vI BIGINT DEFAULT 0;
2019-12-02 20:16:27 +00:00
DECLARE vRes VARCHAR(255);
2019-12-02 20:10:07 +00:00
2019-12-02 20:16:27 +00:00
WHILE vI < vLoops DO
2019-12-02 20:10:07 +00:00
SELECT minacum(2, -10, 1) INTO vRes;
2019-12-02 20:16:27 +00:00
SET vI = vI + 1;
END WHILE;
2019-12-02 20:10:07 +00:00
END$$
DELIMITER ;
CALL udf_test(POW(10, 6));
DROP PROCEDURE udf_test;