MDEV-26048: Table 'test._test_new' doesn't exist when add trigger (use pt-osc) #1872
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
the patch try to solve the problem : Table 'test._test_new' doesn't exist when add trigger (use pt-osc).
after patch apply it will not report table doesn‘t exist.
and I'm not sure this patch may introduce side-effects in
other parts of the server.
How can this PR be tested?
create table t1(key1 int, key2 int);
DELIMITER $
CREATE PROCEDURE sp()
BEGIN
DECLARE a INT DEFAULT 1;
WHILE a < 20001 DO
INSERT INTO t1 VALUES(1,1);
SET a = a + 1;
END WHILE;
END$
DELIMITER ;
connect (user1, localhost, root, ,);
connect (user2, localhost, root, ,);
connection user1;
--send call sp();
connection user2;
create table t2(key1 int, key2 int);
CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW DELETE FROM t2 ;
DROP TRIGGER tr1;
CREATE TRIGGER tr2 AFTER INSERT ON t1 FOR EACH ROW insert INTO t2 VALUES (1,1);
DROP TRIGGER tr2;
DROP TABLE t2;
connection user1;
--reap
select count(*) from t1;
provide by Alice Sherepa.
Basing the PR against the correct MariaDB version