[MDEV-8652] Partitioned table creation problem when creating from procedure context twice in same session Created: 2015-08-19  Updated: 2022-11-09  Resolved: 2022-11-08

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Procedure, Partitioning
Affects Version/s: 10.0.20, 5.5, 10.0, 10.1
Fix Version/s: 10.2.42

Type: Bug Priority: Minor
Reporter: Hartmut Holzgraefe Assignee: Lena Startseva
Resolution: Fixed Votes: 0
Labels: upstream
Environment:

linux


Issue Links:
Relates
relates to MDEV-7990 ERROR 1526 when procedure executed fo... Closed

 Description   

When DROPing and reCREATing a partitioned table using a stored procedure the 2nd attempt from the same session leads to a

"VALUES LESS THAN value must be strictly increasing for each partition"

error. When closing the connection, reconnecting, and then re-executing the procedure the CREATE works well again, but another call from the same session makes it fail once more

Minimalized test case:

DROP PROCEDURE IF EXISTS p1;
 
DELIMITER //
 
CREATE PROCEDURE p1()
BEGIN
  DROP TABLE IF EXISTS t1 ;
 
  CREATE TABLE t1 (
    id INT PRIMARY KEY
  )
  PARTITION BY RANGE (id) (
    PARTITION P1 VALUES LESS THAN (2),
    PARTITION P2 VALUES LESS THAN (3)
  ); 
END //
 
DELIMITER ;
 
call p1(); -- works
call p1(); -- fails



 Comments   
Comment by Elena Stepanova [ 2015-08-19 ]

Most likely it is either a duplicate of, or closely related to MDEV-7990 (https://bugs.mysql.com/bug.php?id=77333).

sanja, after you fix MDEV-7990, please check that this issue also goes away, and add it to the test case (if it does not go away, please treat it as a separate bug report).

Comment by Elena Stepanova [ 2015-08-19 ]

Actually, since the fix for MDEV-7990 already exists somewhere, the issue is in review, I will check it myself first.

Comment by Elena Stepanova [ 2015-08-19 ]

Confirmed, patch for MDEV-7990 fixes this issue.

sanja, please add this test case to your patch as well (creation of a table, as far as I could see yours only has ALTER table inside a function).

Comment by Lena Startseva [ 2022-01-25 ]

Branch: bb-10.2-MDEV-8652
Commit: 7e92c1ff414cce5d1440d5eb7799371998c07e36

Comment by Oleksandr Byelkin [ 2022-01-25 ]

--source include/have_partition.inc

should be added at the beginning of the test

Comment by Oleksandr Byelkin [ 2022-01-25 ]

Sorry my bad, it was there. OK to push.

Comment by Hartmut Holzgraefe [ 2022-05-01 ]

The error message was no longer reproducible in 10.0.22 already. Is this still waiting for better test coverage, or can it be considered ready to close by now?

Generated at Thu Feb 08 07:28:46 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.