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

double call procedure in one session - hard shutdown the server

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.3.12, 5.5.34, 10.0.7
    • 5.5.35, 10.0.8
    • None
    • None
    • windows 7, 64x
      mysqld 64x

    Description

      This problem exists if in table more than 10 rows
      eg.

      CREATE TABLE  `action` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `create_ts` int(10) unsigned DEFAULT '0',
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
       
      # and my test for this table
      # 1) creating routine
       
      DELIMITER $$
      DROP PROCEDURE IF EXISTS `p` $$
      CREATE PROCEDURE p (IN step TINYINT(1))
      BEGIN
        DECLARE counts INT DEFAULT 0;
        DECLARE cur1 CURSOR FOR
       
        SELECT ct.id
        FROM (SELECT NULL) AS z
        JOIN (
          SELECT id
          FROM `action`
          LIMIT 10
        ) AS ct
        JOIN (SELECT NULL) AS x ON(
          EXISTS(
            SELECT 1
            FROM `action`
            WHERE id=ct.id
            LIMIT 1
          )
        );
       
        IF step=1 THEN
          TRUNCATE action;
          REPEAT
            INSERT INTO `action`
            (create_ts) VALUES
            (UNIX_TIMESTAMP());
       
            SET counts=counts+1;
          UNTIL counts>150 END REPEAT;
       
          SET max_sp_recursion_depth=1;
       
          CALL p(2);
          CALL p(2);
        ELSEIF step=2 THEN
          OPEN cur1; CLOSE cur1;
        END IF;
      END $$
      DELIMITER ;
       
      CALL p(1);

      And as result - Lost connection to MySQL server during query

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              scotovod Pavel Tishkin
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.