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

MDL BF-BF conflict on ALTER and UPDATE with multi-level foreign key parents #479

Open
wants to merge 4 commits into
base: 10.5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions include/mysql/service_wsrep.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ extern struct wsrep_service_st {
#define wsrep_thd_is_local(T) wsrep_service->wsrep_thd_is_local_func(T)
#define wsrep_thd_self_abort(T) wsrep_service->wsrep_thd_self_abort_func(T)
#define wsrep_thd_append_key(T,W,N,K) wsrep_service->wsrep_thd_append_key_func(T,W,N,K)
#define wsrep_thd_append_table_key(T,D,B,K) wsrep_service->wsrep_thd_append_table_key_func(T,D,B,K)
#define wsrep_thd_client_state_str(T) wsrep_service->wsrep_thd_client_state_str_func(T)
#define wsrep_thd_client_mode_str(T) wsrep_service->wsrep_thd_client_mode_str_func(T)
#define wsrep_thd_transaction_state_str(T) wsrep_service->wsrep_thd_transaction_state_str_func(T)
Expand Down Expand Up @@ -228,6 +229,11 @@ extern "C" int wsrep_thd_append_key(MYSQL_THD thd,
int n_keys,
enum Wsrep_service_key_type);

extern "C" int wsrep_thd_append_table_key(MYSQL_THD thd,
const char* db,
const char* table,
enum Wsrep_service_key_type);

extern const char* wsrep_sr_table_name_full;

extern "C" const char* wsrep_get_sr_table_name();
Expand Down
38 changes: 38 additions & 0 deletions mysql-test/suite/galera/r/MDEV-35018.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
connection node_2;
connection node_1;
connection node_2;
SET GLOBAL wsrep_slave_threads=2;
CREATE TABLE t1 (
id INTEGER PRIMARY KEY,
f2 INTEGER);
CREATE TABLE t2 (
f1 INT PRIMARY KEY,
t1_id INT NOT NULL,
f2 INTEGER NOT NULL,
KEY key_t1_id(t1_id),
CONSTRAINT key_t1_id FOREIGN KEY (t1_id) REFERENCES t1 (id) ON UPDATE CASCADE ON DELETE CASCADE);
INSERT INTO t1 VALUES (1,0);
INSERT INTO t1 VALUES (2,0);
INSERT INTO t2 VALUES (1,1,1234);
INSERT INTO t2 VALUES (2,2,1234);
connection node_2;
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_toi";
connection node_1;
DROP TABLE t2;
connection node_2;
SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_toi_reached";
SET SESSION wsrep_sync_wait = 0;
1
connection node_1;
UPDATE t1 SET f2 = 1 WHERE id=2;
connection node_2;
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_toi";
SET SESSION wsrep_sync_wait = DEFAULT;
SELECT * FROM t1;
id f2
1 0
2 1
SET DEBUG_SYNC = 'RESET';
SET GLOBAL DEBUG_DBUG = '';
SET GLOBAL wsrep_slave_threads = DEFAULT;
DROP TABLE t1;
Loading