[MDEV-19905] REPEAT statement_list has one more iteration Created: 2019-06-28  Updated: 2019-06-29  Resolved: 2019-06-29

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Procedure, Server
Affects Version/s: 10.3.16
Fix Version/s: 10.3.17

Type: Bug Priority: Major
Reporter: Anel Husakovic Assignee: Anel Husakovic
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

Based on comment of a question in KB open question.
There is different result in 10.2 and 10.3 for REPEAT
stated here:

DELETE FROM t1;
 
DELIMITER //
 
CREATE PROCEDURE dorepeat(p1 INT)
  BEGIN
    SET @x = 0;
    REPEAT 
      SET @x = @x + 1; 
      INSERT INTO t1 VALUES ("");
    UNTIL @x >= p1 
    END REPEAT;
  END
//
 
CALL dorepeat(100)//
 
SELECT @x//
DELIMITER ;
SELECT * FROM t1;
DROP TABLE t1;

In 10.2 we are obtaining like so:

MariaDB [test]> SELECT @x//
+------+
| @x   |
+------+
|  100 |
+------+
1 row in set (0.001 sec)

and in 10.3 we are obtaining bug (one more iteration), like so:

MariaDB [test]> SELECT @x//
+------+
| @x   |
+------+
|  101 |
+------+
1 row in set (0.000 sec)



 Comments   
Comment by Anel Husakovic [ 2019-06-29 ]

I really cannot reproduce it (day after obtaining this bug). Don't know which settings I used to obtain the same.

For now I will close MDEV. If by chance, I figure it out what happened during my test phase, I will reopen it again.

Generated at Thu Feb 08 08:55:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.