.

DELIMITER //

CREATE PROCEDURE dorepeat(p1 INT)
 BEGIN
  SET @x = 0;
  REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT;
 END
//

CALL dorepeat(1000)//

SELECT @x//
+------+
| @x   |
+------+
| 1001 |
+------+

URL: https://mariadb.com/kb/en/repeat-loop/https://mariadb.com/kb/en/repeat-loop/