-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5.5 without InnoDB/XtraDB changes
- Loading branch information
Showing
14 changed files
with
396 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# Bug #20762798 FK DDL: CRASH IN DICT_FOREIGN_REMOVE_FROM_CACHE | ||
# | ||
create table t1(a int, b int, key(a),key(b))engine=innodb; | ||
create table t2(a int, b int, key(a),key(b))engine=innodb; | ||
alter table t2 add constraint b foreign key (b) references t1(a); | ||
alter table t1 add constraint b1 foreign key (b) references t2(a); | ||
alter table t2 add constraint b1 foreign key (b) references t1(a); | ||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 121 "Duplicate key on write or update") | ||
alter table t2 drop foreign key b; | ||
alter table t1 drop foreign key b1; | ||
drop table t2; | ||
drop table t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--source include/have_innodb.inc | ||
|
||
--echo # | ||
--echo # Bug #20762798 FK DDL: CRASH IN DICT_FOREIGN_REMOVE_FROM_CACHE | ||
--echo # | ||
|
||
create table t1(a int, b int, key(a),key(b))engine=innodb; | ||
create table t2(a int, b int, key(a),key(b))engine=innodb; | ||
|
||
alter table t2 add constraint b foreign key (b) references t1(a); | ||
alter table t1 add constraint b1 foreign key (b) references t2(a); | ||
|
||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ | ||
--error ER_CANT_CREATE_TABLE | ||
alter table t2 add constraint b1 foreign key (b) references t1(a); | ||
|
||
alter table t2 drop foreign key b; | ||
alter table t1 drop foreign key b1; | ||
|
||
drop table t2; | ||
drop table t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# 18075170 - sql node restart required to avoid deadlock after | ||
# restore | ||
# | ||
CREATE TABLE t1 (id INT) ENGINE=NDBCluster; | ||
CREATE TABLE t2 (id INT) ENGINE=NDBCluster; | ||
INSERT INTO t1 VALUES (1); | ||
INSERT INTO t2 VALUES (1); | ||
DROP TABLE t1; | ||
DROP TABLE t2; | ||
SET autocommit = 0; | ||
SELECT * FROM t1; | ||
id | ||
1 | ||
SELECT * FROM t2; | ||
id | ||
1 | ||
ROLLBACK; | ||
SET autocommit = 1; | ||
drop table t1; | ||
drop table t2; | ||
SET autocommit = 0; | ||
SELECT * FROM t1; | ||
id | ||
1 | ||
SELECT * FROM t2; | ||
id | ||
1 | ||
ALTER TABLE t1 ADD val INT; | ||
ROLLBACK; | ||
SET autocommit = 1; | ||
drop table t1; | ||
drop table t2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
-- source include/have_ndb.inc | ||
-- source include/count_sessions.inc | ||
|
||
--echo # | ||
--echo # 18075170 - sql node restart required to avoid deadlock after | ||
--echo # restore | ||
--echo # | ||
# Test Auto Discover option within a transaction | ||
# and make sure the transaction is not broken. | ||
CREATE TABLE t1 (id INT) ENGINE=NDBCluster; | ||
CREATE TABLE t2 (id INT) ENGINE=NDBCluster; | ||
|
||
INSERT INTO t1 VALUES (1); | ||
INSERT INTO t2 VALUES (1); | ||
|
||
-- source include/ndb_backup.inc | ||
|
||
DROP TABLE t1; | ||
DROP TABLE t2; | ||
|
||
-- source include/ndb_restore_master.inc | ||
|
||
SET autocommit = 0; | ||
SELECT * FROM t1; | ||
|
||
# Without fix below select was resulting in DEADLOCK error. With fix select | ||
# should succeed. | ||
SELECT * FROM t2; | ||
ROLLBACK; | ||
SET autocommit = 1; | ||
|
||
drop table t1; | ||
drop table t2; | ||
|
||
# | ||
# Checking lock preservation in transaction | ||
# | ||
# Using existing backup to create the scenario. Tables are deleted as part of | ||
# above test cleanup. Thus restoring the backup will bring the system to | ||
# required state. | ||
-- source include/ndb_restore_master.inc | ||
|
||
SET autocommit = 0; | ||
SELECT * FROM t1; | ||
SELECT * FROM t2; | ||
|
||
connect(con2, localhost, root); | ||
--SEND ALTER TABLE t1 ADD val INT | ||
|
||
connection default; | ||
# Alter from con2 will be in waiting state as there is a lock on t1 from | ||
# default connection due to active transaction. We check for this condition | ||
# then releasing the lock by rollbacking active transaction. | ||
let $wait_condition= | ||
SELECT count(*) = 1 FROM information_schema.processlist WHERE state | ||
LIKE "Waiting%" AND info = "ALTER TABLE t1 ADD val INT"; | ||
--source include/wait_condition.inc | ||
ROLLBACK; | ||
SET autocommit = 1; | ||
|
||
connection con2; | ||
--REAP | ||
|
||
disconnect con2; | ||
connection default; | ||
drop table t1; | ||
drop table t2; | ||
|
||
# Wait till all disconnects are completed | ||
-- source include/wait_until_count_sessions.inc |
File renamed without changes.
Oops, something went wrong.