Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8652

Partitioned table creation problem when creating from procedure context twice in same session

    Details

      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
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              elenst Elena Stepanova added a comment -

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

              Oleksandr Byelkin, 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).

              Show
              elenst Elena Stepanova added a comment - Most likely it is either a duplicate of, or closely related to MDEV-7990 ( https://bugs.mysql.com/bug.php?id=77333 ). Oleksandr Byelkin , 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).
              Hide
              elenst Elena Stepanova added a comment -

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

              Show
              elenst Elena Stepanova added a comment - Actually, since the fix for MDEV-7990 already exists somewhere, the issue is in review, I will check it myself first.
              Hide
              elenst Elena Stepanova added a comment -

              Confirmed, patch for MDEV-7990 fixes this issue.

              Oleksandr Byelkin, 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).

              Show
              elenst Elena Stepanova added a comment - Confirmed, patch for MDEV-7990 fixes this issue. Oleksandr Byelkin , 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).

                People

                • Assignee:
                  sanja Oleksandr Byelkin
                  Reporter:
                  hholzgra Hartmut Holzgraefe
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated: