Skip to content

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

Open
cstarc wants to merge 2 commits into
MariaDB:10.2from
cstarc:10.2
Open

MDEV-26048: Table 'test._test_new' doesn't exist when add trigger (use pt-osc)#1872
cstarc wants to merge 2 commits into
MariaDB:10.2from
cstarc:10.2

Conversation

@cstarc

@cstarc cstarc commented Jul 12, 2021

Copy link
Copy Markdown
  • 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

XYHong18 commented Oct 4, 2021

Copy link
Copy Markdown

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

@dlenski

dlenski commented Oct 4, 2021

Copy link
Copy Markdown
Contributor

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

cstarc commented Oct 8, 2021

Copy link
Copy Markdown
Author

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

cstarc commented Oct 8, 2021

Copy link
Copy Markdown
Author

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
Copy Markdown
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
Copy Markdown
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)

@cvicentiu cvicentiu added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Nov 26, 2024

@gkodinov gkodinov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a preliminary review. I sincerely hope you'd still be willing to see that merged.

In case you are, here are the steps to restart this:

  • rebase on the lates 10.11: this is a bug and that is where it needs to go.
  • squash the commits into a single one with a suitable commit message describing the change
  • please make sure to add a regression test
  • reply to Sanja's comment about it being a bigger problem

Sorry for the delay and thank you in advance for your understanding and cooperation.

@gkodinov gkodinov assigned gkodinov and unassigned sanja-byelkin Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

7 participants