Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-26048: Table 'test._test_new' doesn't exist when add trigger (use pt-osc) #1872

Open
wants to merge 2 commits into
base: 10.2
Choose a base branch
from

Conversation

cstarc
Copy link

@cstarc cstarc commented Jul 12, 2021

  • The Jira issue number for this PR is: MDEV-26048

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

  • This is a new feature and the PR is based against the latest MariaDB development branch
  • This is a bug fix and the PR is based against the earliest branch in which the bug can be reproduced

@an3l an3l changed the title fix table doesn't exist MDEV-26048: Table 'test._test_new' doesn't exist when add trigger (use pt-osc) Jul 12, 2021
@an3l an3l added this to the 10.2 milestone Jul 12, 2021
@XYHong18
Copy link

XYHong18 commented Oct 4, 2021

Why not creating an MTR test instead of providing a test case in the description of this PR?

@dlenski
Copy link
Contributor

dlenski commented Oct 4, 2021

Does pt-osc refer to https://www.percona.com/doc/percona-toolkit/3.0/pt-online-schema-change.html? It appears from your description that it can be reproduced without using this tool.

@cstarc
Copy link
Author

cstarc commented Oct 8, 2021

Why not creating an MTR test instead of providing a test case in the description of this PR?
Because I am not very familiar with MTR, it is not currently provided. of course, it's better to use MTR.

@cstarc
Copy link
Author

cstarc commented Oct 8, 2021

Does pt-osc refer to https://www.percona.com/doc/percona-toolkit/3.0/pt-online-schema-change.html? It appears from your description that it can be reproduced without using this tool.

yes. pt-osc refer to pt-online-schema-change . and it can be reproduced by using mysql client to simulate this scene.

@sanja-byelkin
Copy link
Member

Thank you for the patch, what it is really lack description what was going on and what was fixed. I am trying to reconstruct it now...

@sanja-byelkin
Copy link
Member

IMHO it is part of bigger problem of changing tables during procedure execition and shoud be fixed with all other problems. changing tables during SP execution if not preventible shoud lead to SP error (as it is now) or fixed all together (i.e. behaviour should be consistent)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants