Skip to content

Commit 9a57de8

Browse files
author
Nirbhay Choubey
committed
bzr merge -r4123..4144 codership/5.6
1 parent c916085 commit 9a57de8

File tree

68 files changed

+3064
-116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+3064
-116
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ INCLUDE(cpack_rpm)
154154
INCLUDE(cpack_deb)
155155

156156
# Add macros
157+
INCLUDE(wsrep)
157158
INCLUDE(character_sets)
158159
INCLUDE(cpu_info)
159160
INCLUDE(zlib)
@@ -167,7 +168,6 @@ INCLUDE(ctest)
167168
INCLUDE(plugin)
168169
INCLUDE(install_macros)
169170
INCLUDE(mysql_add_executable)
170-
INCLUDE(wsrep)
171171

172172
# Handle options
173173
OPTION(DISABLE_SHARED
@@ -290,6 +290,7 @@ MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
290290

291291
OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP})
292292
IF (WITH_INNODB_DISALLOW_WRITES)
293+
MESSAGE(STATUS "INNODB_DISALLOW_WRITES")
293294
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_INNODB_DISALLOW_WRITES")
294295
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_INNODB_DISALLOW_WRITES")
295296
ENDIF()

cmake/wsrep.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SET(WSREP_PATCH_VERSION "10")
2323
# MariaDB addition: Revision number of the last revision merged from
2424
# codership branch visible in @@visible_comment.
2525
# Branch : codership-mysql/5.6
26-
SET(WSREP_PATCH_REVNO "4123") # Should be updated on every merge.
26+
SET(WSREP_PATCH_REVNO "4144") # Should be updated on every merge.
2727

2828
# MariaDB: Obtain patch revision number:
2929
# Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set.

mysql-test/include/mtr_warnings.sql

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,25 @@ INSERT INTO global_suppressions VALUES
229229
("Slave I/O: Setting @mariadb_slave_capability failed with error:.*"),
230230

231231
/*
232-
Galera-related warnings.
232+
Galera suppressions
233233
*/
234-
("WSREP: Could not open saved state file for reading: .*"),
235-
("WSREP: last inactive check more than .* skipping check"),
236-
("WSREP: Gap in state sequence. Need state transfer."),
237-
("WSREP: Failed to prepare for incremental state transfer: .*"),
234+
("WSREP:*down context*"),
235+
("WSREP: Failed to send state UUID:*"),
236+
("WSREP: wsrep_sst_receive_address is set to '127.0.0.1"),
237+
("WSREP: option --wsrep-casual-reads is deprecated"),
238+
("WSREP: --wsrep-casual-reads=ON takes precedence over --wsrep-sync-wait=0"),
239+
("WSREP: Could not open saved state file for reading: "),
240+
("WSREP: access file\\(gvwstate\\.dat\\) failed\\(No such file or directory\\)"),
241+
("WSREP: Gap in state sequence\\. Need state transfer\\."),
242+
("WSREP: Failed to prepare for incremental state transfer: Local state UUID \\(00000000-0000-0000-0000-000000000000\\) does not match group state UUID"),
243+
("WSREP: No existing UUID has been found, so we assume that this is the first time that this server has been started\\. Generating a new UUID: "),
244+
("WSREP: last inactive check more than"),
245+
("WSREP: binlog cache not empty \\(0 bytes\\) at connection close"),
246+
("WSREP: Failed to guess base node address"),
247+
("WSREP: Guessing address for incoming client connections failed"),
248+
("WSREP: Failed to read output of: '/sbin/ifconfig"),
249+
("WSREP: SQL statement was ineffective"),
250+
238251
("THE_LAST_SUPPRESSION")||
239252

240253

mysql-test/include/write_var_to_file.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if (`SELECT LENGTH(@@secure_file_priv) > 0`)
5151
--copy_file $_wvtf_tmp_file $write_to_file
5252
--remove_file $_wvtf_tmp_file
5353
}
54-
if (`SELECT LENGTH(@@secure_file_priv) = 0`)
54+
if (`SELECT LENGTH(@@secure_file_priv) = 0 OR LENGTH(@@secure_file_priv) IS NULL`)
5555
{
5656
--eval SELECT '$write_var' INTO DUMPFILE '$write_to_file'
5757
}

mysql-test/mysql-test-run.pl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3189,6 +3189,9 @@ ()
31893189
mtr_report(" - adding wsrep, galera to default test suites");
31903190
push @DEFAULT_SUITES, qw(wsrep galera);
31913191

3192+
# ADD scripts to $PATH to that wsrep_sst_* can be found
3193+
$ENV{'PATH'} = $ENV{'PATH'}.':'.$basedir.'/scripts';
3194+
31923195
# Check whether WSREP_PROVIDER environment variable is set.
31933196
if (defined $ENV{'WSREP_PROVIDER'}) {
31943197
if ((mtr_file_exists($ENV{'WSREP_PROVIDER'}) eq "") &&

mysql-test/suite/galera/galera_2nodes.cnf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,36 @@
22
!include include/default_mysqld.cnf
33

44
[mysqld.1]
5+
innodb_file_per_table
56
binlog-format=row
7+
innodb_file_format=Barracuda
8+
performance_schema=OFF
9+
610
wsrep_provider=@ENV.WSREP_PROVIDER
711
wsrep_cluster_address='gcomm://'
812
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
913
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
1014
# enforce read-committed characteristics across the cluster
1115
wsrep_causal_reads=ON
16+
wsrep_sync_wait = 7
17+
wsrep_node_address=127.0.0.1
18+
wsrep_node_incoming_address=127.0.0.1
1219

1320
[mysqld.2]
21+
innodb_file_per_table
1422
binlog-format=row
23+
innodb_file_format=Barracuda
24+
performance_schema=OFF
25+
1526
wsrep_provider=@ENV.WSREP_PROVIDER
1627
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
1728
wsrep_provider_options='base_port=@mysqld.2.#galera_port'
1829
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
1930
# enforce read-committed characteristics across the cluster
2031
wsrep_causal_reads=ON
32+
wsrep_sync_wait = 7
33+
wsrep_node_address=127.0.0.1
34+
wsrep_node_incoming_address=127.0.0.1
2135

2236
[ENV]
2337
NODE_MYPORT_1= @mysqld.1.port
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
CREATE TABLE grandparent (
2+
id INT NOT NULL PRIMARY KEY
3+
) ENGINE=InnoDB;
4+
CREATE TABLE parent (
5+
id INT NOT NULL PRIMARY KEY,
6+
grandparent_id INT,
7+
FOREIGN KEY (grandparent_id)
8+
REFERENCES grandparent(id)
9+
ON DELETE CASCADE
10+
) ENGINE=InnoDB;
11+
CREATE TABLE child (
12+
id INT NOT NULL PRIMARY KEY,
13+
parent_id INT,
14+
FOREIGN KEY (parent_id)
15+
REFERENCES parent(id)
16+
ON DELETE CASCADE
17+
) ENGINE=InnoDB;
18+
INSERT INTO grandparent VALUES (1),(2);
19+
INSERT INTO parent VALUES (1,1), (2,2);
20+
INSERT INTO child VALUES (1,1), (2,2);
21+
DELETE FROM grandparent WHERE id = 1;
22+
SELECT COUNT(*) = 0 FROM parent WHERE grandparent_id = 1;
23+
COUNT(*) = 0
24+
1
25+
SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1;
26+
COUNT(*) = 0
27+
1
28+
DROP TABLE child;
29+
DROP TABLE parent;
30+
DROP TABLE grandparent;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
CREATE TABLE grandparent (
2+
id INT NOT NULL PRIMARY KEY
3+
) ENGINE=InnoDB;
4+
CREATE TABLE parent (
5+
id INT NOT NULL PRIMARY KEY,
6+
grandparent_id INT,
7+
FOREIGN KEY (grandparent_id)
8+
REFERENCES grandparent(id)
9+
ON UPDATE CASCADE
10+
) ENGINE=InnoDB;
11+
CREATE TABLE child (
12+
id INT NOT NULL PRIMARY KEY,
13+
grandparent_id INT,
14+
FOREIGN KEY (grandparent_id)
15+
REFERENCES parent(grandparent_id)
16+
ON UPDATE CASCADE
17+
) ENGINE=InnoDB;
18+
INSERT INTO grandparent VALUES (1),(2);
19+
INSERT INTO parent VALUES (1,1), (2,2);
20+
INSERT INTO child VALUES (1,1), (2,2);
21+
UPDATE grandparent SET id = 3 WHERE id = 1;
22+
SELECT COUNT(*) = 1 FROM parent WHERE grandparent_id = 3;
23+
COUNT(*) = 1
24+
1
25+
SELECT COUNT(*) = 1 FROM child WHERE grandparent_id = 3;
26+
COUNT(*) = 1
27+
1
28+
DROP TABLE child;
29+
DROP TABLE parent;
30+
DROP TABLE grandparent;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
CREATE TABLE parent (
2+
id INT PRIMARY KEY,
3+
KEY (id)
4+
) ENGINE=InnoDB;
5+
CREATE TABLE child (
6+
id INT PRIMARY KEY,
7+
parent_id INT,
8+
FOREIGN KEY (parent_id)
9+
REFERENCES parent(id)
10+
) ENGINE=InnoDB;
11+
INSERT INTO parent VALUES (1), (2);
12+
INSERT INTO child VALUES (1,1);
13+
SET AUTOCOMMIT = OFF;
14+
START TRANSACTION;
15+
DELETE FROM parent WHERE id = 2;
16+
SET AUTOCOMMIT = OFF;
17+
START TRANSACTION;
18+
INSERT INTO child VALUES (2, 2);
19+
COMMIT;
20+
COMMIT;
21+
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
22+
DROP TABLE child;
23+
DROP TABLE parent;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
CREATE TABLE parent (
2+
id1 INT,
3+
id2 INT,
4+
PRIMARY KEY (id1, id2) /* Multipart PK */
5+
) ENGINE=InnoDB;
6+
CREATE TABLE child (
7+
id INT PRIMARY KEY,
8+
parent_id1 INT,
9+
FOREIGN KEY (parent_id1)
10+
REFERENCES parent(id1) /* FK is subset of PK above */
11+
ON UPDATE CASCADE
12+
ON DELETE CASCADE
13+
) ENGINE=InnoDB;
14+
INSERT INTO parent VALUES (1, 2);
15+
INSERT INTO child VALUES (1, 1);
16+
UPDATE parent SET id1 = 3 WHERE id1 = 1;
17+
SELECT COUNT(*) = 1 FROM child WHERE parent_id1 = 3;
18+
COUNT(*) = 1
19+
1
20+
DELETE FROM parent WHERE id1 = 3;
21+
SELECT COUNT(*) = 0 FROM child WHERE parent_id1 = 3;
22+
COUNT(*) = 0
23+
1
24+
DROP TABLE child;
25+
DROP TABLE parent;

0 commit comments

Comments
 (0)