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

Table 'test._test_new' doesn't exist when add trigger (use pt-osc)

    XMLWordPrintable

    Details

      Description

      procedure

      DELIMITER $$
      USE `test`$$
      DROP PROCEDURE IF EXISTS `kz_test`$$
      CREATE PROCEDURE `kz_test`()
      BEGIN
      DECLARE i INT DEFAULT 1;
      DECLARE a INT DEFAULT 1;
      WHILE i < 1000001 DO

      WHILE a < 20001 DO
      SELECT CONCAT('ccccc ', i,a);
      INSERT INTO test.test VALUES(CONCAT(i,a),1);
      SET a = a + 1;
      END WHILE;
      SELECT CONCAT('aaaaa', i);
      COMMIT;
      SELECT CONCAT('bbbbb', i);
      SET a = 1;
      SET i = i + 10000;
      END WHILE;
      END$$
      DELIMITER ;


      table

      use test;
      create table test(key1 int not null, key2 int not null)engine=innodb;


      sql

      first connect1:
      call kz_test();

      then connect 2:
      use test;
      create table _test_new(key1 int not null, key2 int not null)engine=innodb;
      CREATE TRIGGER `pt_osc_test_test_del` AFTER DELETE ON `test`.`test` FOR EACH ROW DELETE IGNORE FROM `test`.`_test_new` WHERE `test`.`_test_new`.`key1` <=> OLD.`key1`;
      CREATE TRIGGER `pt_osc_test_test_ins` AFTER INSERT ON `test`.`test` FOR EACH ROW REPLACE INTO `test`.`_test_new` (`key1`, `key2`) VALUES (NEW.`key1`, NEW.`key2`);
      DROP TRIGGER IF EXISTS `test`.`pt_osc_test_test_del`;
      DROP TRIGGER IF EXISTS `test`.`pt_osc_test_test_ins`;
      drop table _test_new;

      then conenct 1 will error ,msg : Table 'test._test_new' doesn't exist.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              cstarc chu huaxing
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration

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