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

ALTER TABLE event take infinite time which for example breaks mysql_upgrade

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 10.5.8, 10.5
    • 10.5.9
    • Events, Locking
    • None

    Description

      Upgrade from mariadb 10.3 to 10.5.8
      mysql_upgrade scripts executes:
      ALTER TABLE event DROP PRIMARY KEY, ADD PRIMARY KEY(db, name)
      this however takes infinite time if there are any events in table event. Its the same if query is executed manualy on mysql database. If events are removed then query is executed ok and mysql_upgrade works fine.

      Attachments

        Issue Links

          Activity

            naox naox created issue -
            naox naox made changes -
            Field Original Value New Value
            Description Upgrade from mariadb 10.3 to 10.5.8
            mysql_upgrade scripts executes:
            ALTER TABLE event DROP PRIMARY KEY, ADD PRIMARY KEY(db, name)
            this however takes infinite time if there are any events in table event. Its the same if query is executed manualy on mysql database. If events are removed then query is executed ok and mysql_upgrade works fine.
            Upgrade from mariadb 10.3 to 10.5.8
            mysql_upgrade scripts executes:
            ALTER TABLE event DROP PRIMARY KEY, ADD PRIMARY KEY(db, name)
            this however takes infinite time if there are any events in table event. Its the same if query is executed manualy on mysql database. If events are removed then query is executed ok and mysql_upgrade works fine.

            Also if would be nice if mysql_upgrade would honor --verbose flag and pass it to mysql command then. Without it its very hard to debug anything.
            naox naox made changes -
            Description Upgrade from mariadb 10.3 to 10.5.8
            mysql_upgrade scripts executes:
            ALTER TABLE event DROP PRIMARY KEY, ADD PRIMARY KEY(db, name)
            this however takes infinite time if there are any events in table event. Its the same if query is executed manualy on mysql database. If events are removed then query is executed ok and mysql_upgrade works fine.

            Also if would be nice if mysql_upgrade would honor --verbose flag and pass it to mysql command then. Without it its very hard to debug anything.
            Upgrade from mariadb 10.3 to 10.5.8
            mysql_upgrade scripts executes:
            ALTER TABLE event DROP PRIMARY KEY, ADD PRIMARY KEY(db, name)
            this however takes infinite time if there are any events in table event. Its the same if query is executed manualy on mysql database. If events are removed then query is executed ok and mysql_upgrade works fine.
            elenst Elena Stepanova made changes -
            Component/s Events [ 10102 ]
            Component/s Locking [ 10900 ]
            Fix Version/s 10.5 [ 23123 ]
            Affects Version/s 10.5 [ 23123 ]
            Priority Minor [ 4 ] Blocker [ 1 ]
            elenst Elena Stepanova made changes -
            Assignee Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Michael Widenius [ monty ]
            monty Michael Widenius made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            monty Michael Widenius made changes -
            Comment [ I was trying to repeat this problem with this test:

            #
            # MDEV-24452 ALTER TABLE event take infinite time which for example breaks
            # mysql_upgrade
            #

            SET GLOBAL event_scheduler=1;

            CREATE TABLE t1 (a int primary key, b int);
            insert into t1 values (1,1),(2,2),(3,3);
            CREATE TABLE t2 (a int primary key);

            CREATE EVENT e_t1 ON SCHEDULE EVERY 1 SECOND DO insert ignore into test.t2 select a from test.t1;

            let $wait_condition=SELECT count(*) > 0 from t2;
            --source include/wait_condition.inc
            select * from t2;

            ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(a);
            drop event e_t1;
            drop table t1,t2;

            SET GLOBAL event_scheduler=default;

            I did run this with 10.5.9 (should be same as 10.5.8) and I had no issues even when running it with --repeat=100

            noax, what kind of event do you have running? ]
            monty Michael Widenius made changes -
            issue.field.resolutiondate 2021-01-21 17:09:32.0 2021-01-21 17:09:32.601
            monty Michael Widenius made changes -
            Fix Version/s 10.5.9 [ 25109 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            vlad.lesin Vladislav Lesin made changes -
            vlad.lesin Vladislav Lesin made changes -
            vlad.lesin Vladislav Lesin made changes -
            vlad.lesin Vladislav Lesin made changes -
            vlad.lesin Vladislav Lesin made changes -
            vlad.lesin Vladislav Lesin made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 117242 ] MariaDB v4 [ 158713 ]
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 194762

            People

              monty Michael Widenius
              naox naox
              Votes:
              0 Vote for this issue
              Watchers:
              8 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.