Merge 10.0-galera into 10.1

This commit is contained in:
Sergei Golubchik 2015-02-06 16:14:23 +01:00
commit 8e7649867f
118 changed files with 6431 additions and 214 deletions

View file

@ -138,6 +138,7 @@ INCLUDE(cpack_rpm)
INCLUDE(cpack_deb)
# Add macros
INCLUDE(wsrep)
INCLUDE(character_sets)
INCLUDE(cpu_info)
INCLUDE(zlib)
@ -151,7 +152,6 @@ INCLUDE(ctest)
INCLUDE(plugin)
INCLUDE(install_macros)
INCLUDE(mysql_add_executable)
INCLUDE(wsrep)
# Handle options
OPTION(DISABLE_SHARED
@ -236,6 +236,7 @@ MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP})
IF (WITH_INNODB_DISALLOW_WRITES)
MESSAGE(STATUS "INNODB_DISALLOW_WRITES")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_INNODB_DISALLOW_WRITES")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_INNODB_DISALLOW_WRITES")
ENDIF()

View file

@ -153,8 +153,8 @@ SETA(CPACK_RPM_server_PACKAGE_REQUIRES
IF(WITH_WSREP)
SETA(CPACK_RPM_server_PACKAGE_REQUIRES
"galera" "rsync" "lsof" "socat" "grep" "gawk" "iproute"
"coreutils" "findutils")
"galera" "rsync" "lsof" "grep" "gawk" "iproute"
"coreutils" "findutils" "tar")
ENDIF()
SET(CPACK_RPM_server_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-prein.sh)

View file

@ -31,11 +31,11 @@ SET(WSREP_PATCH_VERSION "10")
# MariaDB addition: Revision number of the last revision merged from
# codership branch visible in @@version_comment.
# Branch : codership-mysql/5.6
SET(WSREP_PATCH_REVNO "4123") # Should be updated on every merge.
SET(WSREP_PATCH_REVNO "4144") # Should be updated on every merge.
# MariaDB addition: Revision number of the last revision merged from
# Branch : lp:maria/maria-10.0-galera
SET(WSREP_PATCH_REVNO2 "3867") # Should be updated on every merge.
SET(WSREP_PATCH_REVNO2 "3919") # Should be updated on every merge.
# MariaDB: Obtain patch revision number:
# Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set.

View file

@ -158,13 +158,13 @@ innodb_flush_method = O_DIRECT
# Mandatory settings
#wsrep_provider=
#wsrep_cluster_address=
#wsrep_slave_threads=1
#binlog_format=row
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#bind-address=0.0.0.0
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0
[mysqldump]

View file

@ -189,14 +189,14 @@ Description: MariaDB database regression test suite
Package: mariadb-server-10.1
Architecture: any
Suggests: tinyca, mailx, mariadb-test
Suggests: tinyca, mailx, mariadb-test, netcat-openbsd, socat
Recommends: libhtml-template-perl
Pre-Depends: mariadb-common, adduser (>= 3.40), debconf
Depends: mariadb-client-10.1 (>= ${source:Version}), libdbi-perl,
perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd,
lsb-base (>= 3.0-10), mariadb-server-core-10.1 (>= ${binary:Version}),
galera (>=25.2), rsync, lsof, socat | netcat, grep, gawk, iproute,
coreutils, bsdutils, findutils
galera (>=25.2), rsync, lsof, grep, gawk, iproute,
coreutils, bsdutils, findutils, tar
Provides: mariadb-server, mysql-server, virtual-mysql-server
Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}),
mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5,

View file

@ -183,14 +183,14 @@ Description: MariaDB database regression test suite
Package: mariadb-server-10.1
Architecture: any
Suggests: tinyca, mailx, mariadb-test
Suggests: tinyca, mailx, mariadb-test, netcat-openbsd, socat
Recommends: libhtml-template-perl
Pre-Depends: mariadb-common, adduser (>= 3.40), debconf
Depends: mariadb-client-10.1 (>= ${source:Version}), libdbi-perl,
perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd,
lsb-base (>= 3.0-10), mariadb-server-core-10.1 (>= ${binary:Version}),
galera (>=25.2), rsync, lsof, socat | netcat, grep, gawk, iproute,
coreutils, bsdutils, findutils
galera (>=25.2), rsync, lsof, grep, gawk, iproute,
coreutils, bsdutils, findutils, tar
Provides: mariadb-server, mysql-server, virtual-mysql-server
Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}),
mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5,

View file

@ -0,0 +1,6 @@
if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE
VARIABLE_NAME LIKE 'wsrep_provider' AND VARIABLE_VALUE NOT LIKE 'none'`)
{
--skip Test requires wsrep provider library (libgalera_smm.so)
}

View file

@ -0,0 +1,38 @@
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld]
wsrep-on=1
binlog-format=row
innodb-autoinc-lock-mode=2
default-storage-engine=innodb
wsrep-cluster-address=gcomm://
wsrep-provider=@ENV.WSREP_PROVIDER
# enforce read-committed characteristics across the cluster
wsrep-causal-reads=ON
wsrep-sync-wait=7
[mysqld.1]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
wsrep_node_incoming_address=127.0.0.1
[mysqld.2]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port'
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
NODE_MYPORT_2= @mysqld.2.port
NODE_MYSOCK_2= @mysqld.2.socket

View file

@ -0,0 +1 @@
!include galera_2nodes.cnf

View file

@ -27,21 +27,4 @@ c1
4
5
DROP TABLE t1;
#
# MDEV-7397: SIGSEGV on inserting into a key-less table
#
# On node_1
USE test;
CREATE TABLE t1(c1 INT) ENGINE=INNODB;
INSERT INTO t1 VALUES (1);
SELECT * FROM t1;
c1
1
# On node_2
SELECT * FROM test.t1;
c1
1
DROP TABLE t1;
# End of test

View file

@ -0,0 +1,23 @@
#
# MDEV-6924 : Server crashed on CREATE TABLE ... SELECT
#
SET @wsrep_forced_binlog_format_saved=@@GLOBAL.wsrep_forced_binlog_format;
SET @@GLOBAL.wsrep_forced_binlog_format=STATEMENT;
SHOW VARIABLES LIKE '%log%bin%';
Variable_name Value
log_bin OFF
log_bin_trust_function_creators ON
sql_log_bin ON
USE test;
CREATE TABLE t1(i INT) ENGINE=INNODB;
INSERT INTO t1 VALUES(1);
CREATE TEMPORARY TABLE `t1_temp` AS SELECT * FROM `t1` WHERE i = 1;
SELECT * FROM t1;
i
1
SELECT * FROM t1_temp;
i
1
DROP TABLE t1;
SET @@GLOBAL.wsrep_forced_binlog_format=@wsrep_forced_binlog_format_saved;
# End of tests

View file

@ -0,0 +1,96 @@
USE test;
# On node_1
CREATE TABLE networks (
`tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
`admin_state_up` tinyint(1) DEFAULT NULL,
`shared` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE ports (
`tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`network_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`mac_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`admin_state_up` tinyint(1) NOT NULL,
`status` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
`device_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`device_owner` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `network_id` (`network_id`),
CONSTRAINT `ports_ibfk_1` FOREIGN KEY (`network_id`) REFERENCES networks (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE subnets (
`tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`network_id` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
`ip_version` int(11) NOT NULL,
`cidr` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`gateway_ip` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`enable_dhcp` tinyint(1) DEFAULT NULL,
`shared` tinyint(1) DEFAULT NULL,
`ipv6_ra_mode` enum('slaac','dhcpv6-stateful','dhcpv6-stateless') COLLATE utf8_unicode_ci DEFAULT NULL,
`ipv6_address_mode` enum('slaac','dhcpv6-stateful','dhcpv6-stateless') COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `network_id` (`network_id`),
CONSTRAINT `subnets_ibfk_1` FOREIGN KEY (`network_id`) REFERENCES networks (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `ipallocations` (
`port_id` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
`ip_address` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`subnet_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`network_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`ip_address`,`subnet_id`,`network_id`),
KEY `port_id` (`port_id`),
KEY `subnet_id` (`subnet_id`),
KEY `network_id` (`network_id`),
CONSTRAINT `ipallocations_ibfk_1` FOREIGN KEY (`port_id`) REFERENCES `ports` (`id`) ON DELETE CASCADE,
CONSTRAINT `ipallocations_ibfk_2` FOREIGN KEY (`subnet_id`) REFERENCES `subnets` (`id`) ON DELETE CASCADE,
CONSTRAINT `ipallocations_ibfk_3` FOREIGN KEY (`network_id`) REFERENCES `networks` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO networks VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','MyNet','ACTIVE',0,0);
INSERT INTO ports VALUES ('','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','fa:16:3e:e3:cc:bb',1,'DOWN','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','network:router_gateway');
INSERT INTO subnets VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','ext-subnet','f37aa3fe-ab99-4d0f-a566-6cd3169d7516',4,'10.25.0.0/24','10.25.0.4',0,1,NULL,NULL);
INSERT INTO ipallocations VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','10.25.0.17','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516');
select * from ports where ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
tenant_id id name network_id mac_address admin_state_up status device_id device_owner
f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 fa:16:3e:e3:cc:bb 1 DOWN f37aa3fe-ab99-4d0f-a566-6cd3169d7516 network:router_gateway
select * from ports where ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
tenant_id id name network_id mac_address admin_state_up status device_id device_owner
f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 fa:16:3e:e3:cc:bb 1 DOWN f37aa3fe-ab99-4d0f-a566-6cd3169d7516 network:router_gateway
DELETE FROM ports WHERE ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
select * from networks;
tenant_id id name status admin_state_up shared
f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 MyNet ACTIVE 0 0
select * from ports;
tenant_id id name network_id mac_address admin_state_up status device_id device_owner
select * from subnets;
tenant_id id name network_id ip_version cidr gateway_ip enable_dhcp shared ipv6_ra_mode ipv6_address_mode
f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 ext-subnet f37aa3fe-ab99-4d0f-a566-6cd3169d7516 4 10.25.0.0/24 10.25.0.4 0 1 NULL NULL
select * from ipallocations;
port_id ip_address subnet_id network_id
select * from ports;
tenant_id id name network_id mac_address admin_state_up status device_id device_owner
# On node_2
select * from networks;
tenant_id id name status admin_state_up shared
f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 MyNet ACTIVE 0 0
select * from ports;
tenant_id id name network_id mac_address admin_state_up status device_id device_owner
select * from subnets;
tenant_id id name network_id ip_version cidr gateway_ip enable_dhcp shared ipv6_ra_mode ipv6_address_mode
f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 ext-subnet f37aa3fe-ab99-4d0f-a566-6cd3169d7516 4 10.25.0.0/24 10.25.0.4 0 1 NULL NULL
select * from ipallocations;
port_id ip_address subnet_id network_id
select * from ports;
tenant_id id name network_id mac_address admin_state_up status device_id device_owner
drop table ipallocations;
drop table subnets;
drop table ports;
drop table networks;

View file

@ -0,0 +1,30 @@
CREATE TABLE grandparent (
id INT NOT NULL PRIMARY KEY
) ENGINE=InnoDB;
CREATE TABLE parent (
id INT NOT NULL PRIMARY KEY,
grandparent_id INT,
FOREIGN KEY (grandparent_id)
REFERENCES grandparent(id)
ON DELETE CASCADE
) ENGINE=InnoDB;
CREATE TABLE child (
id INT NOT NULL PRIMARY KEY,
parent_id INT,
FOREIGN KEY (parent_id)
REFERENCES parent(id)
ON DELETE CASCADE
) ENGINE=InnoDB;
INSERT INTO grandparent VALUES (1),(2);
INSERT INTO parent VALUES (1,1), (2,2);
INSERT INTO child VALUES (1,1), (2,2);
DELETE FROM grandparent WHERE id = 1;
SELECT COUNT(*) = 0 FROM parent WHERE grandparent_id = 1;
COUNT(*) = 0
1
SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1;
COUNT(*) = 0
1
DROP TABLE child;
DROP TABLE parent;
DROP TABLE grandparent;

View file

@ -0,0 +1,30 @@
CREATE TABLE grandparent (
id INT NOT NULL PRIMARY KEY
) ENGINE=InnoDB;
CREATE TABLE parent (
id INT NOT NULL PRIMARY KEY,
grandparent_id INT,
FOREIGN KEY (grandparent_id)
REFERENCES grandparent(id)
ON UPDATE CASCADE
) ENGINE=InnoDB;
CREATE TABLE child (
id INT NOT NULL PRIMARY KEY,
grandparent_id INT,
FOREIGN KEY (grandparent_id)
REFERENCES parent(grandparent_id)
ON UPDATE CASCADE
) ENGINE=InnoDB;
INSERT INTO grandparent VALUES (1),(2);
INSERT INTO parent VALUES (1,1), (2,2);
INSERT INTO child VALUES (1,1), (2,2);
UPDATE grandparent SET id = 3 WHERE id = 1;
SELECT COUNT(*) = 1 FROM parent WHERE grandparent_id = 3;
COUNT(*) = 1
1
SELECT COUNT(*) = 1 FROM child WHERE grandparent_id = 3;
COUNT(*) = 1
1
DROP TABLE child;
DROP TABLE parent;
DROP TABLE grandparent;

View file

@ -0,0 +1,23 @@
CREATE TABLE parent (
id INT PRIMARY KEY,
KEY (id)
) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY,
parent_id INT,
FOREIGN KEY (parent_id)
REFERENCES parent(id)
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1), (2);
INSERT INTO child VALUES (1,1);
SET AUTOCOMMIT = OFF;
START TRANSACTION;
DELETE FROM parent WHERE id = 2;
SET AUTOCOMMIT = OFF;
START TRANSACTION;
INSERT INTO child VALUES (2, 2);
COMMIT;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE child;
DROP TABLE parent;

View file

@ -0,0 +1,25 @@
CREATE TABLE parent (
id1 INT,
id2 INT,
PRIMARY KEY (id1, id2) /* Multipart PK */
) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY,
parent_id1 INT,
FOREIGN KEY (parent_id1)
REFERENCES parent(id1) /* FK is subset of PK above */
ON UPDATE CASCADE
ON DELETE CASCADE
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1, 2);
INSERT INTO child VALUES (1, 1);
UPDATE parent SET id1 = 3 WHERE id1 = 1;
SELECT COUNT(*) = 1 FROM child WHERE parent_id1 = 3;
COUNT(*) = 1
1
DELETE FROM parent WHERE id1 = 3;
SELECT COUNT(*) = 0 FROM child WHERE parent_id1 = 3;
COUNT(*) = 0
1
DROP TABLE child;
DROP TABLE parent;

View file

@ -0,0 +1,35 @@
CREATE TABLE t0 (
f1 INT PRIMARY KEY,
f2 INT UNIQUE
) ENGINE=INNODB;
CREATE TABLE t1 (
f1 INT PRIMARY KEY,
FOREIGN KEY (f1)
REFERENCES t0(f1)
ON UPDATE CASCADE
) ENGINE=INNODB;
CREATE TABLE t2 (
f2 INT PRIMARY KEY,
FOREIGN KEY (f2)
REFERENCES t0(f2)
ON UPDATE CASCADE
) ENGINE=INNODB;
INSERT INTO t0 VALUES (0, 0);
INSERT INTO t1 VALUES (0);
INSERT INTO t2 VALUES (0);
UPDATE t0 SET f1 = 1, f2 = 2;
SELECT f1 = 1 FROM t1 WHERE f1 = 1;
f1 = 1
1
SELECT f2 = 2 FROM t2 WHERE f2 = 2;
f2 = 2
1
SELECT f1 = 1 FROM t1;
f1 = 1
1
SELECT f2 = 2 FROM t2;
f2 = 2
1
DROP TABLE t2;
DROP TABLE t1;
DROP TABLE t0;

View file

@ -0,0 +1,22 @@
CREATE TABLE t0 (
f0 INT PRIMARY KEY
) ENGINE=INNODB;
CREATE TABLE t1 (
f1 INT PRIMARY KEY,
f0 INTEGER,
FOREIGN KEY (f0)
REFERENCES t0(f0)
ON DELETE CASCADE
) ENGINE=INNODB;
INSERT INTO t0 VALUES (0), (1);
INSERT INTO t1 VALUES (0, 0);
INSERT INTO t1 VALUES (1, 0);
DELETE t0.*, t1.* FROM t0, t1 WHERE t0.f0 = 0 AND t1.f1 = 0;
SELECT COUNT(*) = 1 FROM t0;
COUNT(*) = 1
1
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
DROP TABLE t1;
DROP TABLE t0;

View file

@ -0,0 +1,28 @@
CREATE TABLE parent (
id INT,
KEY (id)
) ENGINE=InnoDB;
CREATE TABLE child (
id INT,
parent_id INT,
FOREIGN KEY (parent_id)
REFERENCES parent(id)
ON UPDATE CASCADE
ON DELETE CASCADE
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1), (1), (2), (2);
INSERT INTO child VALUES (1,1), (2,2), (1,1), (2,2);
DELETE FROM parent WHERE id = 1;
SELECT COUNT(*) = 0 FROM child WHERE id = 1;
COUNT(*) = 0
1
UPDATE parent SET id = 3 WHERE id = 2;
SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1;
COUNT(*) = 0
1
SELECT parent_id = 3 FROM child WHERE id = 2;
parent_id = 3
1
1
DROP TABLE child;
DROP TABLE parent;

View file

@ -0,0 +1,13 @@
CREATE TABLE t1 (
f1 INT NOT NULL PRIMARY KEY,
f2 INT,
FOREIGN KEY (f2)
REFERENCES t1(f1)
ON DELETE CASCADE
) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 1), (2, 1);
DELETE FROM t1 WHERE f1 = 1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
DROP TABLE t1;

View file

@ -0,0 +1,30 @@
CREATE TABLE parent (
id INT NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE child (
id INT,
parent_id INT,
FOREIGN KEY (parent_id)
REFERENCES parent(id)
ON UPDATE SET NULL
ON DELETE SET NULL
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1),(2);
INSERT INTO child VALUES (1,1),(2,2);
DELETE FROM parent WHERE id = 1;
SELECT parent_id IS NULL FROM child WHERE id = 1;
parent_id IS NULL
1
SELECT parent_id IS NULL FROM child WHERE id = 1;
parent_id IS NULL
1
UPDATE parent SET id = 3 WHERE id = 2;
SELECT parent_id IS NULL FROM child WHERE id = 2;
parent_id IS NULL
1
SELECT parent_id IS NULL FROM child WHERE id = 2;
parent_id IS NULL
1
DROP TABLE child;
DROP TABLE parent;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,123 @@
CREATE TABLE t1 (f1 VARCHAR(767) PRIMARY KEY) ENGINE=InnoDB;
CREATE UNIQUE INDEX i63 ON t1(f1);
CREATE UNIQUE INDEX i62 ON t1(f1);
CREATE UNIQUE INDEX i61 ON t1(f1);
CREATE UNIQUE INDEX i60 ON t1(f1);
CREATE UNIQUE INDEX i59 ON t1(f1);
CREATE UNIQUE INDEX i58 ON t1(f1);
CREATE UNIQUE INDEX i57 ON t1(f1);
CREATE UNIQUE INDEX i56 ON t1(f1);
CREATE UNIQUE INDEX i55 ON t1(f1);
CREATE UNIQUE INDEX i54 ON t1(f1);
CREATE UNIQUE INDEX i53 ON t1(f1);
CREATE UNIQUE INDEX i52 ON t1(f1);
CREATE UNIQUE INDEX i51 ON t1(f1);
CREATE UNIQUE INDEX i50 ON t1(f1);
CREATE UNIQUE INDEX i49 ON t1(f1);
CREATE UNIQUE INDEX i48 ON t1(f1);
CREATE UNIQUE INDEX i47 ON t1(f1);
CREATE UNIQUE INDEX i46 ON t1(f1);
CREATE UNIQUE INDEX i45 ON t1(f1);
CREATE UNIQUE INDEX i44 ON t1(f1);
CREATE UNIQUE INDEX i43 ON t1(f1);
CREATE UNIQUE INDEX i42 ON t1(f1);
CREATE UNIQUE INDEX i41 ON t1(f1);
CREATE UNIQUE INDEX i40 ON t1(f1);
CREATE UNIQUE INDEX i39 ON t1(f1);
CREATE UNIQUE INDEX i38 ON t1(f1);
CREATE UNIQUE INDEX i37 ON t1(f1);
CREATE UNIQUE INDEX i36 ON t1(f1);
CREATE UNIQUE INDEX i35 ON t1(f1);
CREATE UNIQUE INDEX i34 ON t1(f1);
CREATE UNIQUE INDEX i33 ON t1(f1);
CREATE UNIQUE INDEX i32 ON t1(f1);
CREATE UNIQUE INDEX i31 ON t1(f1);
CREATE UNIQUE INDEX i30 ON t1(f1);
CREATE UNIQUE INDEX i29 ON t1(f1);
CREATE UNIQUE INDEX i28 ON t1(f1);
CREATE UNIQUE INDEX i27 ON t1(f1);
CREATE UNIQUE INDEX i26 ON t1(f1);
CREATE UNIQUE INDEX i25 ON t1(f1);
CREATE UNIQUE INDEX i24 ON t1(f1);
CREATE UNIQUE INDEX i23 ON t1(f1);
CREATE UNIQUE INDEX i22 ON t1(f1);
CREATE UNIQUE INDEX i21 ON t1(f1);
CREATE UNIQUE INDEX i20 ON t1(f1);
CREATE UNIQUE INDEX i19 ON t1(f1);
CREATE UNIQUE INDEX i18 ON t1(f1);
CREATE UNIQUE INDEX i17 ON t1(f1);
CREATE UNIQUE INDEX i16 ON t1(f1);
CREATE UNIQUE INDEX i15 ON t1(f1);
CREATE UNIQUE INDEX i14 ON t1(f1);
CREATE UNIQUE INDEX i13 ON t1(f1);
CREATE UNIQUE INDEX i12 ON t1(f1);
CREATE UNIQUE INDEX i11 ON t1(f1);
CREATE UNIQUE INDEX i10 ON t1(f1);
CREATE UNIQUE INDEX i9 ON t1(f1);
CREATE UNIQUE INDEX i8 ON t1(f1);
CREATE UNIQUE INDEX i7 ON t1(f1);
CREATE UNIQUE INDEX i6 ON t1(f1);
CREATE UNIQUE INDEX i5 ON t1(f1);
CREATE UNIQUE INDEX i4 ON t1(f1);
CREATE UNIQUE INDEX i3 ON t1(f1);
CREATE UNIQUE INDEX i2 ON t1(f1);
CREATE UNIQUE INDEX i1 ON t1(f1);
INSERT INTO t1 VALUES (REPEAT('a', 767));
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SELECT LENGTH(f1) = 767 FROM t1;
LENGTH(f1) = 767
1
EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 769 const 1 Using index
SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767);
COUNT(*) = 1
1
EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const i1 i1 769 const 1 Using index
SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767);
COUNT(*) = 1
1
EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const i63 i63 769 const 1 Using index
SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767);
COUNT(*) = 1
1
INSERT INTO t1 VALUES (REPEAT('b', 767));
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
DELETE FROM t1 WHERE f1 = REPEAT('b', 767);
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
INSERT INTO t1 (f1) VALUES (REPEAT('c', 767));
ROLLBACK;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
START TRANSACTION;
SET AUTOCOMMIT=OFF;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
START TRANSACTION;
START TRANSACTION;
UPDATE t1 SET f1 = REPEAT('e', 767);
UPDATE t1 SET f1 = REPEAT('f', 767);
COMMIT;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1;

View file

@ -0,0 +1,41 @@
CREATE TABLE ten (f1 INTEGER) ENGINE=INNODB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
SELECT COUNT(*) = 100000 FROM t1;
COUNT(*) = 100000
1
INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
SELECT COUNT(*) = 200000 FROM t1;
COUNT(*) = 200000
1
UPDATE t1 SET f2 = 1;
SELECT COUNT(*) = 200000 FROM t1 WHERE f2 = 1;
COUNT(*) = 200000
1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
ROLLBACK;
SELECT COUNT(*) = 200000 FROM t1;
COUNT(*) = 200000
1
SELECT COUNT(*) = 200000 FROM t1;
COUNT(*) = 200000
1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f2 = 2;
ROLLBACK;
START TRANSACTION;
SELECT COUNT(*) = 200000 FROM t1;
COUNT(*) = 200000
1
UPDATE t1 SET f2 = 3;
START TRANSACTION;
UPDATE t1 SET f2 = 4;
COMMIT;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1;
DROP TABLE ten;

View file

@ -0,0 +1,27 @@
CREATE TABLE t1 (f1 BIT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),(0),(b'1');
SELECT f1 IS NULL, f1 = b'1' FROM t1;
f1 IS NULL f1 = b'1'
1 NULL
0 0
0 1
DELETE FROM t1 WHERE f1 = b'1';
UPDATE t1 SET f1 = b'1' WHERE f1 IS NULL;
UPDATE t1 SET f1 = 1 WHERE f1 = b'0';
SELECT f1 IS NULL, f1 = b'1' FROM t1;
f1 IS NULL f1 = b'1'
0 1
0 1
CREATE TABLE t2 (f1 BIT) ENGINE=InnoDB;
INSERT INTO t2 VALUES (NULL);
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 0 WHERE f1 IS NULL;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 1 WHERE f1 IS NULL;
COMMIT;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1;
DROP TABLE t2;

View file

@ -0,0 +1,27 @@
CREATE TABLE t1 (f1 BLOB) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),('abc');
SELECT f1 FROM t1;
f1
NULL
abc
DELETE FROM t1 WHERE f1 IS NULL;
UPDATE t1 SET f1 = 'xyz' WHERE f1 = 'abc';
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SELECT f1 = 'abc' FROM t1;
f1 = 'abc'
0
CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
INSERT INTO t2 VALUES (NULL);
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'abc' WHERE f1 IS NULL;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'xyz' WHERE f1 IS NULL;
COMMIT;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1;
DROP TABLE t2;

View file

@ -0,0 +1,30 @@
CREATE TABLE t1 (f1 VARCHAR(8000)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),(CONCAT(REPEAT('x', 7999), 'a'));
SELECT LENGTH(f1) FROM t1;
LENGTH(f1)
NULL
8000
DELETE FROM t1 WHERE f1 IS NULL;
UPDATE t1 SET f1 = CONCAT(REPEAT('x', 7999), 'b') WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SELECT LENGTH(f1) = 8000 FROM t1;
LENGTH(f1) = 8000
1
SELECT f1 = CONCAT(REPEAT('x', 7999), 'b') FROM t1;
f1 = CONCAT(REPEAT('x', 7999), 'b')
1
CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
INSERT INTO t2 VALUES (CONCAT(REPEAT('x', 7999), 'a'));
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'abc' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'xyz' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
COMMIT;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1;
DROP TABLE t2;

View file

@ -0,0 +1,46 @@
SET GLOBAL wsrep_sync_wait = 7;
SET GLOBAL wsrep_sync_wait = 7;
CREATE DATABASE `database with space`;
USE `database with space`;
CREATE TABLE `table with space` (
`column with space` INTEGER AUTO_INCREMENT PRIMARY KEY,
`second column with space` INTEGER,
UNIQUE `index name with space` (`second column with space`)
) ENGINE=INNODB;
INSERT INTO `table with space` VALUES (DEFAULT, 1);
CREATE DATABASE `база`;
USE `база`;
CREATE TABLE `таблица` (
`първаолона` INTEGER PRIMARY KEY,
`втораолона` INTEGER,
UNIQUE `индекс` (`втораолона`)
) ENGINE=INNODB;
INSERT INTO `таблица` VALUES (1, 1);
CREATE DATABASE `втора база`;
USE `втора база`;
CREATE TABLE `втора таблица` (
`първа колона` INTEGER,
`втора колона` INTEGER,
KEY `първи индекс` (`първа колона`)
) ENGINE=INNODB;
INSERT INTO `втора таблица` VALUES (1, 1);
USE `database with space`;
SELECT * FROM `table with space`;
column with space second column with space
1 1
USE `база`;
SELECT * FROM `таблица`;
първаолона втораолона
1 1
USE `втора база`;
SELECT * FROM `втора таблица`;
първа колона втора колона
1 1
SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait);
DROP TABLE `database with space`.`table with space`;
DROP TABLE `база`.`таблица`;
DROP TABLE `втора база`.`втора таблица`;
DROP DATABASE `database with space`;
DROP DATABASE `база`;
DROP DATABASE `втора база`;
SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait);

View file

@ -0,0 +1,67 @@
SET GLOBAL wsrep_auto_increment_control = OFF;
SET GLOBAL auto_increment_increment = 1;
SET GLOBAL auto_increment_offset = 1;
SET GLOBAL wsrep_auto_increment_control = OFF;
SET GLOBAL auto_increment_increment = 1;
SET GLOBAL auto_increment_offset = 1;
SELECT @@auto_increment_increment = 1;
@@auto_increment_increment = 1
1
SELECT @@auto_increment_offset = 1;
@@auto_increment_offset = 1
1
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL AUTO_INCREMENT,
`node` varchar(10) DEFAULT NULL,
PRIMARY KEY (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL AUTO_INCREMENT,
`node` varchar(10) DEFAULT NULL,
PRIMARY KEY (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT @@auto_increment_increment = 1;
@@auto_increment_increment = 1
1
SELECT @@auto_increment_offset = 1;
@@auto_increment_offset = 1
1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 (node) VALUES ('node1');
SELECT f1 FROM t1;
f1
1
SELECT @@auto_increment_increment = 1;
@@auto_increment_increment = 1
1
SELECT @@auto_increment_offset = 1;
@@auto_increment_offset = 1
1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 (node) VALUES ('node2');
SELECT f1 FROM t1;
f1
1
COMMIT;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SELECT * FROM t1;
f1 node
1 node1
SELECT * FROM t1;
f1 node
1 node1
SET GLOBAL wsrep_auto_increment_control = 1;
SET GLOBAL auto_increment_increment = 2;
SET GLOBAL auto_increment_offset = 1;
SET GLOBAL wsrep_auto_increment_control = 1;
SET GLOBAL auto_increment_increment = 2;
SET GLOBAL auto_increment_offset = 2;
DROP TABLE t1;

View file

@ -0,0 +1,44 @@
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL AUTO_INCREMENT,
`node` varchar(10) DEFAULT NULL,
PRIMARY KEY (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size')
1
SELECT @@auto_increment_offset = 1;
@@auto_increment_offset = 1
1
INSERT INTO t1 VALUES (DEFAULT, 'node1');;
INSERT INTO t1 VALUES (DEFAULT, 'node2');;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL AUTO_INCREMENT,
`node` varchar(10) DEFAULT NULL,
PRIMARY KEY (`f1`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size')
1
SELECT @@auto_increment_offset = 2;
@@auto_increment_offset = 2
1
INSERT INTO t1 VALUES (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2');;
INSERT INTO t1 VALUES (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1');;
SELECT COUNT(*) = 22 FROM t1;
COUNT(*) = 22
1
SELECT COUNT(DISTINCT f1) = 22 FROM t1;
COUNT(DISTINCT f1) = 22
1
SELECT COUNT(*) = 22 FROM t1;
COUNT(*) = 22
1
SELECT COUNT(DISTINCT f1) = 22 FROM t1;
COUNT(DISTINCT f1) = 22
1
DROP TABLE t1;

View file

@ -0,0 +1,21 @@
SET GLOBAL wsrep_certify_nonPK = OFF;
SET GLOBAL wsrep_certify_nonPK = OFF;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB /* Table has no primary key */;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
INSERT INTO t2 VALUES (1), (2);
UPDATE t2 SET f1 = 3 WHERE f1 = 1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
SELECT COUNT(*) = 2 FROM t2;
COUNT(*) = 2
1
SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 3;
COUNT(*) = 1
1
SET GLOBAL wsrep_certify_nonPK = 1;
SET GLOBAL wsrep_certify_nonPK = 1;
DROP TABLE t1;
DROP TABLE t2;

View file

@ -0,0 +1,26 @@
CREATE TABLE parent (
id INT PRIMARY KEY,
KEY (id)
) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY,
parent_id INT,
FOREIGN KEY (parent_id)
REFERENCES parent(id)
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1);
INSERT INTO child VALUES (1,1);
SET SESSION foreign_key_checks = 0;
INSERT INTO child VALUES (2,2);
SELECT COUNT(*) = 1 FROM child WHERE id = 2;
COUNT(*) = 1
1
INSERT INTO child VALUES (3,3);
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))
SET SESSION foreign_key_checks = 0;
DELETE FROM parent;
SELECT COUNT(*) = 0 FROM parent;
COUNT(*) = 0
1
DROP TABLE child;
DROP TABLE parent;

View file

@ -0,0 +1,12 @@
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
SET GLOBAL wsrep_mysql_replication_bundle = 2;
INSERT INTO t1 VALUES (1);
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
0
INSERT INTO t1 VALUES (2);
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
SET GLOBAL wsrep_mysql_replication_bundle = 0;
DROP TABLE t1;

View file

@ -0,0 +1,8 @@
SET GLOBAL wsrep_replicate_myisam = FALSE;
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM;
INSERT INTO t1 VALUES (1);
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
SET GLOBAL wsrep_replicate_myisam = 0;
DROP TABLE t1;

View file

@ -0,0 +1,8 @@
SET GLOBAL wsrep_replicate_myisam = TRUE;
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM;
INSERT INTO t1 VALUES (1);
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SET GLOBAL wsrep_replicate_myisam = 0;
DROP TABLE t1;

View file

@ -0,0 +1,21 @@
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
SET GLOBAL wsrep_sync_wait = 1;
SHOW TABLES LIKE '%t1';
Tables_in_test (%t1)
t1
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
CREATE TABLE t2 (f1 INT PRIMARY KEY) Engine=InnoDB;
SET GLOBAL wsrep_sync_wait = 4;
INSERT INTO t2 VALUES (1);
CREATE TABLE t3 (f1 INT PRIMARY KEY) Engine=InnoDB;
INSERT INTO t3 VALUES (1);
SET GLOBAL wsrep_sync_wait = 2;
UPDATE t3 SET f1 = 2;
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
SET GLOBAL wsrep_sync_wait = 7;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,45 @@
package My::Suite::GALERA;
use File::Basename;
use My::Find;
@ISA = qw(My::Suite);
return "Not run for embedded server" if $::opt_embedded_server;
return "WSREP is not compiled in" unless defined $::mysqld_variables{'wsrep-on'};
my ($provider) = grep { -f $_ } $ENV{WSREP_PROVIDER},
"/usr/lib/galera/libgalera_smm.so",
"/usr/lib64/galera/libgalera_smm.so";
return "No wsrep provider library" unless -f $provider;
$ENV{WSREP_PROVIDER} = $provider;
my ($spath) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir;
return "No SST scripts" unless $spath;
my ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir;
return "No my_print_defaults" unless $epath;
push @::global_suppressions,
(
qr(WSREP: Failed to guess base node address),
qr(WSREP: Guessing address for incoming client connections failed),
qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1),
qr(WSREP: Could not open saved state file for reading: ),
qr(WSREP: Gap in state sequence. Need state transfer.),
qr(WSREP: Failed to prepare for incremental state transfer:),
qr(WSREP:.*down context.*),
qr(WSREP: Failed to send state UUID:),
qr(WSREP: last inactive check more than .* skipping check),
qr(WSREP: SQL statement was ineffective),
qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned.),
);
$ENV{PATH}="$epath:$ENV{PATH}";
$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
bless { };

View file

@ -22,27 +22,5 @@ SELECT * FROM test.t1;
# Cleanup
DROP TABLE t1;
--echo #
--echo # MDEV-7397: SIGSEGV on inserting into a key-less table
--echo #
--echo
--echo # On node_1
--connection node_1
USE test;
CREATE TABLE t1(c1 INT) ENGINE=INNODB;
INSERT INTO t1 VALUES (1);
SELECT * FROM t1;
--echo
--echo # On node_2
--connection node_2
SELECT * FROM test.t1;
--let $galera_diff_statement = SELECT * FROM t1
--source include/galera_diff.inc
# Cleanup
DROP TABLE t1;
--source include/galera_end.inc
--echo # End of test

View file

@ -0,0 +1,26 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--echo #
--echo # MDEV-6924 : Server crashed on CREATE TABLE ... SELECT
--echo #
SET @wsrep_forced_binlog_format_saved=@@GLOBAL.wsrep_forced_binlog_format;
SET @@GLOBAL.wsrep_forced_binlog_format=STATEMENT;
# @@log_bin must be OFF
SHOW VARIABLES LIKE '%log%bin%';
USE test;
CREATE TABLE t1(i INT) ENGINE=INNODB;
INSERT INTO t1 VALUES(1);
CREATE TEMPORARY TABLE `t1_temp` AS SELECT * FROM `t1` WHERE i = 1;
SELECT * FROM t1;
SELECT * FROM t1_temp;
# Cleanup
DROP TABLE t1;
SET @@GLOBAL.wsrep_forced_binlog_format=@wsrep_forced_binlog_format_saved;
--echo # End of tests

View file

@ -0,0 +1,116 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
#
# MDEV-6651: MariaDB galera cluster crashes in file row0mysql.cc line 684
# DELETE FROM ports WHERE ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516'
# where table ports have foreign keys
#
USE test;
--echo
--echo # On node_1
--connection node_1
CREATE TABLE networks (
`tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
`admin_state_up` tinyint(1) DEFAULT NULL,
`shared` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE ports (
`tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`network_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`mac_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`admin_state_up` tinyint(1) NOT NULL,
`status` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
`device_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`device_owner` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `network_id` (`network_id`),
CONSTRAINT `ports_ibfk_1` FOREIGN KEY (`network_id`) REFERENCES networks (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE subnets (
`tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`network_id` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
`ip_version` int(11) NOT NULL,
`cidr` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`gateway_ip` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`enable_dhcp` tinyint(1) DEFAULT NULL,
`shared` tinyint(1) DEFAULT NULL,
`ipv6_ra_mode` enum('slaac','dhcpv6-stateful','dhcpv6-stateless') COLLATE utf8_unicode_ci DEFAULT NULL,
`ipv6_address_mode` enum('slaac','dhcpv6-stateful','dhcpv6-stateless') COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `network_id` (`network_id`),
CONSTRAINT `subnets_ibfk_1` FOREIGN KEY (`network_id`) REFERENCES networks (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `ipallocations` (
`port_id` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
`ip_address` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`subnet_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`network_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`ip_address`,`subnet_id`,`network_id`),
KEY `port_id` (`port_id`),
KEY `subnet_id` (`subnet_id`),
KEY `network_id` (`network_id`),
CONSTRAINT `ipallocations_ibfk_1` FOREIGN KEY (`port_id`) REFERENCES `ports` (`id`) ON DELETE CASCADE,
CONSTRAINT `ipallocations_ibfk_2` FOREIGN KEY (`subnet_id`) REFERENCES `subnets` (`id`) ON DELETE CASCADE,
CONSTRAINT `ipallocations_ibfk_3` FOREIGN KEY (`network_id`) REFERENCES `networks` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO networks VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','MyNet','ACTIVE',0,0);
INSERT INTO ports VALUES ('','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','fa:16:3e:e3:cc:bb',1,'DOWN','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','network:router_gateway');
INSERT INTO subnets VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','ext-subnet','f37aa3fe-ab99-4d0f-a566-6cd3169d7516',4,'10.25.0.0/24','10.25.0.4',0,1,NULL,NULL);
INSERT INTO ipallocations VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','10.25.0.17','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516');
select * from ports where ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
--connection node_2
select * from ports where ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
--let $galera_diff_statement = SELECT * FROM ports
--source include/galera_diff.inc
--connection node_1
DELETE FROM ports WHERE ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
select * from networks;
select * from ports;
select * from subnets;
select * from ipallocations;
select * from ports;
--echo
--echo # On node_2
--connection node_2
select * from networks;
select * from ports;
select * from subnets;
select * from ipallocations;
select * from ports;
--let $galera_diff_statement = SELECT * FROM ports
--source include/galera_diff.inc
--connection node_1
drop table ipallocations;
drop table subnets;
drop table ports;
drop table networks;
--source include/galera_end.inc

View file

@ -0,0 +1,41 @@
#
# Test Foreign Key Cascading DELETEs
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE grandparent (
id INT NOT NULL PRIMARY KEY
) ENGINE=InnoDB;
CREATE TABLE parent (
id INT NOT NULL PRIMARY KEY,
grandparent_id INT,
FOREIGN KEY (grandparent_id)
REFERENCES grandparent(id)
ON DELETE CASCADE
) ENGINE=InnoDB;
CREATE TABLE child (
id INT NOT NULL PRIMARY KEY,
parent_id INT,
FOREIGN KEY (parent_id)
REFERENCES parent(id)
ON DELETE CASCADE
) ENGINE=InnoDB;
INSERT INTO grandparent VALUES (1),(2);
INSERT INTO parent VALUES (1,1), (2,2);
INSERT INTO child VALUES (1,1), (2,2);
--connection node_2
DELETE FROM grandparent WHERE id = 1;
--connection node_1
SELECT COUNT(*) = 0 FROM parent WHERE grandparent_id = 1;
SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1;
DROP TABLE child;
DROP TABLE parent;
DROP TABLE grandparent;

View file

@ -0,0 +1,41 @@
#
# Test Foreign Key Cascading UPDATEs
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE grandparent (
id INT NOT NULL PRIMARY KEY
) ENGINE=InnoDB;
CREATE TABLE parent (
id INT NOT NULL PRIMARY KEY,
grandparent_id INT,
FOREIGN KEY (grandparent_id)
REFERENCES grandparent(id)
ON UPDATE CASCADE
) ENGINE=InnoDB;
CREATE TABLE child (
id INT NOT NULL PRIMARY KEY,
grandparent_id INT,
FOREIGN KEY (grandparent_id)
REFERENCES parent(grandparent_id)
ON UPDATE CASCADE
) ENGINE=InnoDB;
INSERT INTO grandparent VALUES (1),(2);
INSERT INTO parent VALUES (1,1), (2,2);
INSERT INTO child VALUES (1,1), (2,2);
--connection node_2
UPDATE grandparent SET id = 3 WHERE id = 1;
--connection node_1
SELECT COUNT(*) = 1 FROM parent WHERE grandparent_id = 3;
SELECT COUNT(*) = 1 FROM child WHERE grandparent_id = 3;
DROP TABLE child;
DROP TABLE parent;
DROP TABLE grandparent;

View file

@ -0,0 +1,41 @@
#
# Test two transactions on separate nodes which conflict on a FK
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE parent (
id INT PRIMARY KEY,
KEY (id)
) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY,
parent_id INT,
FOREIGN KEY (parent_id)
REFERENCES parent(id)
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1), (2);
INSERT INTO child VALUES (1,1);
--connection node_1
SET AUTOCOMMIT = OFF;
START TRANSACTION;
DELETE FROM parent WHERE id = 2;
--connection node_2
SET AUTOCOMMIT = OFF;
START TRANSACTION;
INSERT INTO child VALUES (2, 2);
--connection node_1
COMMIT;
--connection node_2
--error ER_LOCK_DEADLOCK
COMMIT;
DROP TABLE child;
DROP TABLE parent;

View file

@ -0,0 +1,38 @@
#
# Test the operation where the definition of the FK is different from the one of the underlying key
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE parent (
id1 INT,
id2 INT,
PRIMARY KEY (id1, id2) /* Multipart PK */
) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY,
parent_id1 INT,
FOREIGN KEY (parent_id1)
REFERENCES parent(id1) /* FK is subset of PK above */
ON UPDATE CASCADE
ON DELETE CASCADE
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1, 2);
INSERT INTO child VALUES (1, 1);
--connection node_2
UPDATE parent SET id1 = 3 WHERE id1 = 1;
--connection node_1
SELECT COUNT(*) = 1 FROM child WHERE parent_id1 = 3;
DELETE FROM parent WHERE id1 = 3;
--connection node_2
SELECT COUNT(*) = 0 FROM child WHERE parent_id1 = 3;
DROP TABLE child;
DROP TABLE parent;

View file

@ -0,0 +1,42 @@
#
# Test UPDATE on multiple columns with multiple FKs
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t0 (
f1 INT PRIMARY KEY,
f2 INT UNIQUE
) ENGINE=INNODB;
CREATE TABLE t1 (
f1 INT PRIMARY KEY,
FOREIGN KEY (f1)
REFERENCES t0(f1)
ON UPDATE CASCADE
) ENGINE=INNODB;
CREATE TABLE t2 (
f2 INT PRIMARY KEY,
FOREIGN KEY (f2)
REFERENCES t0(f2)
ON UPDATE CASCADE
) ENGINE=INNODB;
INSERT INTO t0 VALUES (0, 0);
INSERT INTO t1 VALUES (0);
INSERT INTO t2 VALUES (0);
--connection node_2
UPDATE t0 SET f1 = 1, f2 = 2;
--connection node_1
SELECT f1 = 1 FROM t1 WHERE f1 = 1;
SELECT f2 = 2 FROM t2 WHERE f2 = 2;
SELECT f1 = 1 FROM t1;
SELECT f2 = 2 FROM t2;
DROP TABLE t2;
DROP TABLE t1;
DROP TABLE t0;

View file

@ -0,0 +1,32 @@
#
# Test multi-table DELETE in the presence of FKs
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t0 (
f0 INT PRIMARY KEY
) ENGINE=INNODB;
CREATE TABLE t1 (
f1 INT PRIMARY KEY,
f0 INTEGER,
FOREIGN KEY (f0)
REFERENCES t0(f0)
ON DELETE CASCADE
) ENGINE=INNODB;
INSERT INTO t0 VALUES (0), (1);
INSERT INTO t1 VALUES (0, 0);
INSERT INTO t1 VALUES (1, 0);
--connection node_2
DELETE t0.*, t1.* FROM t0, t1 WHERE t0.f0 = 0 AND t1.f1 = 0;
--connection node_1
SELECT COUNT(*) = 1 FROM t0;
SELECT COUNT(*) = 0 FROM t1;
DROP TABLE t1;
DROP TABLE t0;

View file

@ -0,0 +1,37 @@
#
# Test foreign keys if no PK is present
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE parent (
id INT,
KEY (id)
) ENGINE=InnoDB;
CREATE TABLE child (
id INT,
parent_id INT,
FOREIGN KEY (parent_id)
REFERENCES parent(id)
ON UPDATE CASCADE
ON DELETE CASCADE
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1), (1), (2), (2);
INSERT INTO child VALUES (1,1), (2,2), (1,1), (2,2);
--connection node_2
DELETE FROM parent WHERE id = 1;
SELECT COUNT(*) = 0 FROM child WHERE id = 1;
--connection node_1
UPDATE parent SET id = 3 WHERE id = 2;
--connection node_2
SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1;
SELECT parent_id = 3 FROM child WHERE id = 2;
DROP TABLE child;
DROP TABLE parent;

View file

@ -0,0 +1,24 @@
#
# Test self-referential foreign keys
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (
f1 INT NOT NULL PRIMARY KEY,
f2 INT,
FOREIGN KEY (f2)
REFERENCES t1(f1)
ON DELETE CASCADE
) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 1), (2, 1);
--connection node_2
DELETE FROM t1 WHERE f1 = 1;
--connection node_1
SELECT COUNT(*) = 0 FROM t1;
DROP TABLE t1;

View file

@ -0,0 +1,36 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE parent (
id INT NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE child (
id INT,
parent_id INT,
FOREIGN KEY (parent_id)
REFERENCES parent(id)
ON UPDATE SET NULL
ON DELETE SET NULL
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1),(2);
INSERT INTO child VALUES (1,1),(2,2);
--connection node_2
DELETE FROM parent WHERE id = 1;
SELECT parent_id IS NULL FROM child WHERE id = 1;
--connection node_1
SELECT parent_id IS NULL FROM child WHERE id = 1;
UPDATE parent SET id = 3 WHERE id = 2;
SELECT parent_id IS NULL FROM child WHERE id = 2;
--connection node_2
SELECT parent_id IS NULL FROM child WHERE id = 2;
--connection node_1
DROP TABLE child;
DROP TABLE parent;

View file

@ -0,0 +1,65 @@
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (f1017 VARCHAR(3) DEFAULT 'ABC') ENGINE=InnoDB;
--let $count = 1016
while ($count)
{
--disable_query_log
--eval SET @ddl_var1 = CONCAT("ALTER TABLE t1 ADD COLUMN f", $count, " VARCHAR(3) DEFAULT 'ABC'")
--let $ddl_var = `SELECT @ddl_var1`
--enable_query_log
--eval $ddl_var
--dec $count
}
ALTER TABLE t1 ADD PRIMARY KEY (f1, f1017);
INSERT INTO t1 (f1) VALUES (DEFAULT);
--connection node_2
SELECT f1 = 'ABC', f1017 = 'ABC' FROM t1;
UPDATE t1 SET f1 = 'XYZ', f1017 = 'XYZ' ;
--connection node_1
SELECT f1 = 'XYZ', f1017 = 'XYZ' FROM t1 WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
# Deadlock
--connection node_1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f2 = 'KLM' WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
--connection node_2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f2 = 'CDE' WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
COMMIT;
--connection node_1
--error ER_LOCK_DEADLOCK
COMMIT;
ROLLBACK;
--connection node_2
ROLLBACK;
# Rollback
--connection node_1
START TRANSACTION;
INSERT INTO t1 (f1, f1017) VALUES ('BCE','BCE');
INSERT INTO t1 (f1, f1017) VALUES ('CED','CED');
INSERT INTO t1 (f1, f1017) VALUES ('EDF','EDF');
INSERT INTO t1 (f1, f1017) VALUES ('FED','FED');
ROLLBACK;
SELECT COUNT(*) = 1 FROM t1;
--connection node_2
SELECT COUNT(*) = 1 FROM t1;
DROP TABLE t1;

View file

@ -0,0 +1,74 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (f1 VARCHAR(767) PRIMARY KEY) ENGINE=InnoDB;
# MySQL complains about multiple identical indexes on the same column
--disable_warnings
--let $count = 63
while ($count)
{
--disable_query_log
--eval SET @ddl_var1 = CONCAT("CREATE UNIQUE INDEX i", $count, " ON t1(f1)")
--let $ddl_var = `SELECT @ddl_var1`
--enable_query_log
--eval $ddl_var
--dec $count
}
--enable_warnings
INSERT INTO t1 VALUES (REPEAT('a', 767));
--connection node_2
SELECT COUNT(*) = 1 FROM t1;
SELECT LENGTH(f1) = 767 FROM t1;
EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767);
SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767);
EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767);
SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767);
EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767);
SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767);
INSERT INTO t1 VALUES (REPEAT('b', 767));
ANALYZE TABLE t1;
--connection node_1
SELECT COUNT(*) = 2 FROM t1;
ANALYZE TABLE t1;
DELETE FROM t1 WHERE f1 = REPEAT('b', 767);
# Rollback
--connection node_1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SELECT COUNT(*) = 1 FROM t1;
INSERT INTO t1 (f1) VALUES (REPEAT('c', 767));
ROLLBACK;
SELECT COUNT(*) = 1 FROM t1;
--connection node_2
START TRANSACTION;
SET AUTOCOMMIT=OFF;
SELECT COUNT(*) = 1 FROM t1;
# Deadlock
--connection node_1
START TRANSACTION;
--connection node_2
START TRANSACTION;
--connection node_1
UPDATE t1 SET f1 = REPEAT('e', 767);
--connection node_2
UPDATE t1 SET f1 = REPEAT('f', 767);
--connection node_1
COMMIT;
--connection node_2
--error ER_LOCK_DEADLOCK
COMMIT;
DROP TABLE t1;

View file

@ -0,0 +1,55 @@
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE ten (f1 INTEGER) ENGINE=INNODB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
--connection node_2
SELECT COUNT(*) = 100000 FROM t1;
INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
--connection node_1
SELECT COUNT(*) = 200000 FROM t1;
UPDATE t1 SET f2 = 1;
--connection node_2
SELECT COUNT(*) = 200000 FROM t1 WHERE f2 = 1;
# Rollback
--connection node_1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
ROLLBACK;
SELECT COUNT(*) = 200000 FROM t1;
--connection node_2
SELECT COUNT(*) = 200000 FROM t1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f2 = 2;
ROLLBACK;
--connection node_1
START TRANSACTION;
SELECT COUNT(*) = 200000 FROM t1;
UPDATE t1 SET f2 = 3;
--connection node_2
START TRANSACTION;
UPDATE t1 SET f2 = 4;
--connection node_1
COMMIT;
--connection node_2
--error ER_LOCK_DEADLOCK
COMMIT;
DROP TABLE t1;
DROP TABLE ten;

View file

@ -0,0 +1,46 @@
#
# This checks that even tables with a single BIT column are replicated properly without a PK
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (f1 BIT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),(0),(b'1');
--connection node_2
SELECT f1 IS NULL, f1 = b'1' FROM t1;
DELETE FROM t1 WHERE f1 = b'1';
UPDATE t1 SET f1 = b'1' WHERE f1 IS NULL;
UPDATE t1 SET f1 = 1 WHERE f1 = b'0';
--connection node_1
SELECT f1 IS NULL, f1 = b'1' FROM t1;
#
# Provoke a conflict
#
--connection node_1
CREATE TABLE t2 (f1 BIT) ENGINE=InnoDB;
INSERT INTO t2 VALUES (NULL);
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 0 WHERE f1 IS NULL;
--connection node_2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 1 WHERE f1 IS NULL;
--connection node_1
COMMIT;
--connection node_2
--error ER_LOCK_DEADLOCK
COMMIT;
DROP TABLE t1;
DROP TABLE t2;

View file

@ -0,0 +1,46 @@
#
# This checks that even tables with a single BLOB column and no FK are replicated properly
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (f1 BLOB) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),('abc');
--connection node_2
SELECT f1 FROM t1;
DELETE FROM t1 WHERE f1 IS NULL;
UPDATE t1 SET f1 = 'xyz' WHERE f1 = 'abc';
--connection node_1
SELECT COUNT(*) = 1 FROM t1;
SELECT f1 = 'abc' FROM t1;
#
# Provoke a conflict
#
--connection node_1
CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
INSERT INTO t2 VALUES (NULL);
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'abc' WHERE f1 IS NULL;
--connection node_2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'xyz' WHERE f1 IS NULL;
--connection node_1
COMMIT;
--connection node_2
--error ER_LOCK_DEADLOCK
COMMIT;
DROP TABLE t1;
DROP TABLE t2;

View file

@ -0,0 +1,50 @@
#
# This checks that even tables with a single long VARCHARcolumn and no FK are replicated properly
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
# From the Innodb manual: "The maximum row length, except for variable-length columns (VARBINARY, VARCHAR, BLOB and TEXT),
# is slightly less than half of a database page. That is, the maximum row length is about 8000 bytes"
CREATE TABLE t1 (f1 VARCHAR(8000)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),(CONCAT(REPEAT('x', 7999), 'a'));
--connection node_2
SELECT LENGTH(f1) FROM t1;
DELETE FROM t1 WHERE f1 IS NULL;
UPDATE t1 SET f1 = CONCAT(REPEAT('x', 7999), 'b') WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
--connection node_1
SELECT COUNT(*) = 1 FROM t1;
SELECT LENGTH(f1) = 8000 FROM t1;
SELECT f1 = CONCAT(REPEAT('x', 7999), 'b') FROM t1;
#
# Provoke a conflict
#
--connection node_1
CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
INSERT INTO t2 VALUES (CONCAT(REPEAT('x', 7999), 'a'));
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'abc' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
--connection node_2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'xyz' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
--connection node_1
COMMIT;
--connection node_2
--error ER_LOCK_DEADLOCK
COMMIT;
DROP TABLE t1;
DROP TABLE t2;

View file

@ -0,0 +1,72 @@
#
# Test non-ascii table, column and index names
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $wsrep_sync_wait_orig = (SELECT @@wsrep_sync_wait)
SET GLOBAL wsrep_sync_wait = 7;
--connection node_2
SET GLOBAL wsrep_sync_wait = 7;
--connection node_1
# Spaces in identifiers
CREATE DATABASE `database with space`;
USE `database with space`;
CREATE TABLE `table with space` (
`column with space` INTEGER AUTO_INCREMENT PRIMARY KEY,
`second column with space` INTEGER,
UNIQUE `index name with space` (`second column with space`)
) ENGINE=INNODB;
INSERT INTO `table with space` VALUES (DEFAULT, 1);
# Unicode identifiers
CREATE DATABASE `база`;
USE `база`;
CREATE TABLE `таблица` (
`първаолона` INTEGER PRIMARY KEY,
`втораолона` INTEGER,
UNIQUE `индекс` (`втораолона`)
) ENGINE=INNODB;
INSERT INTO `таблица` VALUES (1, 1);
# Without a PK
CREATE DATABASE `втора база`;
USE `втора база`;
CREATE TABLE `втора таблица` (
`първа колона` INTEGER,
`втора колона` INTEGER,
KEY `първи индекс` (`първа колона`)
) ENGINE=INNODB;
INSERT INTO `втора таблица` VALUES (1, 1);
--connection node_2
USE `database with space`;
SELECT * FROM `table with space`;
USE `база`;
SELECT * FROM `таблица`;
USE `втора база`;
SELECT * FROM `втора таблица`;
--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig
--connection node_1
DROP TABLE `database with space`.`table with space`;
DROP TABLE `база`.`таблица`;
DROP TABLE `втора база`.`втора таблица`;
DROP DATABASE `database with space`;
DROP DATABASE `база`;
DROP DATABASE `втора база`;
--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig

View file

@ -0,0 +1,101 @@
#
# Test wsrep_auto_increment_control = OFF
# We issue two concurrent INSERTs and one will fail with a deadlock error
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $auto_increment_control_orig = `SELECT @@wsrep_auto_increment_control`
#
# Preserve existing variable values
#
--connection node_1
--let $auto_increment_increment_node1 = `SELECT @@auto_increment_increment`
--let $auto_increment_offset_node1 = `SELECT @@auto_increment_offset`
# Restore stock MySQL defaults
SET GLOBAL wsrep_auto_increment_control = OFF;
SET GLOBAL auto_increment_increment = 1;
SET GLOBAL auto_increment_offset = 1;
#Open a fresh connection to node_1 so that the variables above take effect
--let $galera_connection_name = node_1a
--let $galera_server_number = 1
--source include/galera_connect.inc
--connection node_2
--let $auto_increment_increment_node2 = `SELECT @@auto_increment_increment`
--let $auto_increment_offset_node2 = `SELECT @@auto_increment_offset`
SET GLOBAL wsrep_auto_increment_control = OFF;
SET GLOBAL auto_increment_increment = 1;
SET GLOBAL auto_increment_offset = 1;
#Open a fresh connection to node_2
--let $galera_connection_name = node_2a
--let $galera_server_number = 2
--source include/galera_connect.inc
--connection node_1a
SELECT @@auto_increment_increment = 1;
SELECT @@auto_increment_offset = 1;
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
#
# We expect that SHOW CREATE TABLE on both nodes will return identical values
#
SHOW CREATE TABLE t1;
--connection node_2a
SHOW CREATE TABLE t1;
--connection node_1a
SELECT @@auto_increment_increment = 1;
SELECT @@auto_increment_offset = 1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 (node) VALUES ('node1');
SELECT f1 FROM t1;
--connection node_2a
SELECT @@auto_increment_increment = 1;
SELECT @@auto_increment_offset = 1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 (node) VALUES ('node2');
SELECT f1 FROM t1;
--connection node_1a
COMMIT;
--connection node_2a
--error ER_LOCK_DEADLOCK
COMMIT;
--connection node_1a
SELECT * FROM t1;
--connection node_2a
SELECT * FROM t1;
#
# Restore all variables as they were
#
--connection node_1
--eval SET GLOBAL wsrep_auto_increment_control = $auto_increment_control_orig
--eval SET GLOBAL auto_increment_increment = $auto_increment_increment_node1
--eval SET GLOBAL auto_increment_offset = $auto_increment_offset_node1
--connection node_2
--eval SET GLOBAL wsrep_auto_increment_control = $auto_increment_control_orig
--eval SET GLOBAL auto_increment_increment = $auto_increment_increment_node2
--eval SET GLOBAL auto_increment_offset = $auto_increment_offset_node2
DROP TABLE t1;

View file

@ -0,0 +1,56 @@
#
# Test the operation of wsrep_auto_increment_control = ON
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_1
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
SHOW CREATE TABLE t1;
# auto_increment_increment is equal to the number of nodes
# auto_increment_offset is equal to the ID of the node
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
SELECT @@auto_increment_offset = 1;
# Expect no conflicts
--send INSERT INTO t1 VALUES (DEFAULT, 'node1');
--connection node_2
--send INSERT INTO t1 VALUES (DEFAULT, 'node2');
--connection node_1
--reap
--connection node_2
--reap
SHOW CREATE TABLE t1;
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
SELECT @@auto_increment_offset = 2;
# Expect no conflicts
--send INSERT INTO t1 VALUES (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2');
--connection node_1
--send INSERT INTO t1 VALUES (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1');
--connection node_2
--reap
--connection node_1
--reap
--connection node_2
SELECT COUNT(*) = 22 FROM t1;
SELECT COUNT(DISTINCT f1) = 22 FROM t1;
--connection node_1
SELECT COUNT(*) = 22 FROM t1;
SELECT COUNT(DISTINCT f1) = 22 FROM t1;
DROP TABLE t1;

View file

@ -0,0 +1,39 @@
#
# Test wsrep_certify_nonPK = OFF
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $wsrep_certify_nonPK_orig = `SELECT @@wsrep_certify_nonPK`
SET GLOBAL wsrep_certify_nonPK = OFF;
--connection node_2
SET GLOBAL wsrep_certify_nonPK = OFF;
--connection node_1
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB /* Table has no primary key */;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
# All DML without a PK is rejected with an error
--error ER_LOCK_DEADLOCK
INSERT INTO t1 VALUES (1), (2);
# DML with a PK is allowed to proceed
INSERT INTO t2 VALUES (1), (2);
UPDATE t2 SET f1 = 3 WHERE f1 = 1;
--connection node_2
SELECT COUNT(*) = 0 FROM t1;
SELECT COUNT(*) = 2 FROM t2;
SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 3;
--connection node_1
--eval SET GLOBAL wsrep_certify_nonPK = $wsrep_certify_nonPK_orig
--connection node_2
--eval SET GLOBAL wsrep_certify_nonPK = $wsrep_certify_nonPK_orig
DROP TABLE t1;
DROP TABLE t2;

View file

@ -0,0 +1,40 @@
#
# Test the operation on the foreign_key_checks variable
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE parent (
id INT PRIMARY KEY,
KEY (id)
) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY,
parent_id INT,
FOREIGN KEY (parent_id)
REFERENCES parent(id)
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1);
INSERT INTO child VALUES (1,1);
SET SESSION foreign_key_checks = 0;
INSERT INTO child VALUES (2,2);
--connection node_2
SELECT COUNT(*) = 1 FROM child WHERE id = 2;
--error ER_NO_REFERENCED_ROW_2
INSERT INTO child VALUES (3,3);
SET SESSION foreign_key_checks = 0;
DELETE FROM parent;
--connection node_1
SELECT COUNT(*) = 0 FROM parent;
DROP TABLE child;
DROP TABLE parent;

View file

@ -0,0 +1,30 @@
#
# Simple test for the operation on the wsrep-mysql-replication-bundle
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $wsrep_mysql_replication_bundle_orig = `SELECT @@wsrep_mysql_replication_bundle`
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
SET GLOBAL wsrep_mysql_replication_bundle = 2;
--connection node_1
# This statement will not be replicated immediately
INSERT INTO t1 VALUES (1);
--connection node_2
SELECT COUNT(*) = 0 FROM t1;
--connection node_1
INSERT INTO t1 VALUES (2);
--connection node_2
SELECT COUNT(*) = 2 FROM t1;
--connection node_1
--eval SET GLOBAL wsrep_mysql_replication_bundle = $wsrep_mysql_replication_bundle_orig
DROP TABLE t1;

View file

@ -0,0 +1,21 @@
#
# Simple test for wsrep-replicate-myisam = FALSE
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $wsrep_replicate_myisam_orig = `SELECT @@wsrep_replicate_myisam`
SET GLOBAL wsrep_replicate_myisam = FALSE;
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM;
INSERT INTO t1 VALUES (1);
--connection node_2
SELECT COUNT(*) = 0 FROM t1;
--connection node_1
--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig
DROP TABLE t1;

View file

@ -0,0 +1,21 @@
#
# Simple test for wsrep-replicate-myisam = ON
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $wsrep_replicate_myisam_orig = `SELECT @@wsrep_replicate_myisam`
SET GLOBAL wsrep_replicate_myisam = TRUE;
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM;
INSERT INTO t1 VALUES (1);
--connection node_2
SELECT COUNT(*) = 1 FROM t1;
--connection node_1
--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig
DROP TABLE t1;

View file

@ -0,0 +1,43 @@
#
# Simple test for the various levels of wsrep-sync-wait
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait`
--connection node_1
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
--connection node_2
SET GLOBAL wsrep_sync_wait = 1;
# Those statements should see the table
SHOW TABLES LIKE '%t1';
SELECT COUNT(*) = 0 FROM t1;
--connection node_1
CREATE TABLE t2 (f1 INT PRIMARY KEY) Engine=InnoDB;
--connection node_2
SET GLOBAL wsrep_sync_wait = 4;
# This insert should see the table and succeed
INSERT INTO t2 VALUES (1);
--connection node_1
CREATE TABLE t3 (f1 INT PRIMARY KEY) Engine=InnoDB;
INSERT INTO t3 VALUES (1);
--connection node_2
SET GLOBAL wsrep_sync_wait = 2;
# This statement should see and update 1 row
--enable_info
UPDATE t3 SET f1 = 2;
--disable_info
--connection node_2
--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,5 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--echo #
--echo # MDEV#5552 Deadlock when inserting NULL column value in column with
@ -19,12 +20,14 @@ SELECT * FROM test.t1;
--connection node_2
SELECT * FROM test.t1;
--echo
--echo # On node_1
--connection node_1
INSERT INTO t1 VALUES (1);
UPDATE t1 SET c1=NULL WHERE c1=1;
SELECT * FROM test.t1;
--echo
--echo # On node_2
--connection node_2

View file

@ -0,0 +1,7 @@
* 'wsrep' suite is designated for tests which do not require a multi-node
galera cluster.
* As these tests are specific to wsrep-related functionalities, they must skip
on server built without wsrep patch (vanilla). (-DWITH_WSREP=OFF)
See : include/have_wsrep.inc, include/have_wsrep_enabled.inc, not_wsrep.inc

View file

@ -3,31 +3,10 @@
[mysqld]
wsrep-on=1
binlog-format=row
innodb-autoinc-lock-mode=2
innodb-locks-unsafe-for-binlog=1
wsrep-cluster-address=gcomm://
wsrep_provider=@ENV.WSREP_PROVIDER
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
[mysqld.1]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
[mysqld.2]
#galera_port=@OPT.port
#sst_port=@OPT.port
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port'
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
NODE_MYPORT_2= @mysqld.2.port
NODE_MYSOCK_2= @mysqld.2.socket
wsrep_cluster_address='not empty but invalid'

View file

@ -0,0 +1,8 @@
#
# MDEV-7374 : Losing connection to MySQL while running ALTER TABLE
#
CREATE TABLE t1(i INT) ENGINE=INNODB;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e;
ALTER TABLE t1 MODIFY i FLOAT;
DROP TABLE t1;

View file

@ -1,27 +1,30 @@
call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*");
call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID");
call mtr.add_suppression("WSREP: Could not open saved state file for reading:.*");
#
# MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT
#
SHOW VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
SET binlog_format=STATEMENT;
ERROR 42000: Variable 'binlog_format' can't be set to the value of 'STATEMENT'
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
SHOW WARNINGS;
Level Code Message
Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
Error 1231 Variable 'binlog_format' can't be set to the value of 'STATEMENT'
SHOW VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
binlog_format STATEMENT
CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
SET binlog_format=MIXED;
ERROR 42000: Variable 'binlog_format' can't be set to the value of 'MIXED'
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: MIXED
SHOW WARNINGS;
Level Code Message
Warning 1105 MariaDB Galera does not support binlog format: MIXED
Error 1231 Variable 'binlog_format' can't be set to the value of 'MIXED'
SHOW VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
binlog_format MIXED
CREATE TABLE IF NOT EXISTS test.t2 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
SET binlog_format=ROW;
SHOW WARNINGS;
@ -33,3 +36,26 @@ CREATE TABLE IF NOT EXISTS test.t3 AS SELECT * FROM information_schema.routines
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
#
# MDEV-7322: Option to allow setting the binlog_format with Galera
#
SET @@GLOBAL.binlog_format=STATEMENT;
ERROR 42000: Variable 'binlog_format' can't be set to the value of 'STATEMENT'
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
SET @@GLOBAL.binlog_format=MIXED;
ERROR 42000: Variable 'binlog_format' can't be set to the value of 'MIXED'
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
SET @@GLOBAL.binlog_format=DEFAULT;
ERROR 42000: Variable 'binlog_format' can't be set to the value of 'DEFAULT'
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
SET @@GLOBAL.binlog_format=ROW;
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
# End of test.

View file

@ -0,0 +1,19 @@
USE test;
create table p(v varchar(20), i int, primary key(v,i)) engine=innodb character set = utf8;
create table c(k int primary key, v varchar(20), i int, foreign key(v,i) references p(v,i)) engine=innodb character set = utf8;
insert into p values (_utf32 0x000004100000041100000412, 1);
insert into c values (1, _utf32 0x000004100000041100000412, 1);
SELECT * FROM test.p;
v i
??? 1
SELECT * FROM test.c;
k v i
1 ??? 1
SELECT * FROM test.p;
v i
??? 1
SELECT * FROM test.c;
k v i
1 ??? 1
DROP TABLE c;
DROP TABLE p;

View file

@ -0,0 +1,11 @@
#
# MDEV-6832: ER_LOCK_WAIT_TIMEOUT on SHOW STATUS
#
SHOW STATUS LIKE 'wsrep_ready';
Variable_name Value
wsrep_ready ON
SHOW STATUS LIKE 'wsrep_ready';
Variable_name Value
wsrep_ready OFF
SET @@global.wsrep_cluster_address='gcomm://';
# End of test.

View file

@ -0,0 +1,78 @@
#
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
#
# Verbose run
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
prepare set_wsrep_myisam from @prep;
set @toggle=1; execute set_wsrep_myisam using @toggle;
TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID();
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
(@time_zone_id, 0, 0, 0, 'GMT')
;
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/garbage' as time zone. Skipping it.
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/ignored.tab' as time zone. Skipping it.
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID();
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('posix/GMT', @time_zone_id);
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
(@time_zone_id, 0, 0, 0, 'GMT')
;
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/ignored.tab' as time zone. Skipping it.
Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
set @toggle=0; execute set_wsrep_myisam using @toggle;
# Silent run
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
prepare set_wsrep_myisam from @prep;
set @toggle=1; execute set_wsrep_myisam using @toggle;
TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID();
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
(@time_zone_id, 0, 0, 0, 'GMT')
;
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/garbage' as time zone. Skipping it.
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID();
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('posix/GMT', @time_zone_id);
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
(@time_zone_id, 0, 0, 0, 'GMT')
;
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
set @toggle=0; execute set_wsrep_myisam using @toggle;
#
# Testing with explicit timezonefile
#
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
prepare set_wsrep_myisam from @prep;
set @toggle=1; execute set_wsrep_myisam using @toggle;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID();
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
(@time_zone_id, 0, 0, 0, 'GMT')
;
set @toggle=0; execute set_wsrep_myisam using @toggle;
#
# Testing --leap
#
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
prepare set_wsrep_myisam from @prep;
set @toggle=1; execute set_wsrep_myisam using @toggle;
TRUNCATE TABLE time_zone_leap_second;
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
set @toggle=0; execute set_wsrep_myisam using @toggle;

View file

@ -1,3 +1,5 @@
SET @wsrep_provider_options_saved= @@global.wsrep_provider_options;
SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address;
# MDEV#5534: mysql_tzinfo_to_sql generates wrong query
#
@ -11,10 +13,12 @@ SET SESSION wsrep_replicate_myisam= ON;
ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable and should be set with SET GLOBAL
SET GLOBAL wsrep_replicate_myisam= ON;
SET GLOBAL wsrep_replicate_myisam= OFF;
SET GLOBAL wsrep_provider=none;
#
# MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of
# variables when using "_"
#
CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*");
SHOW GLOBAL STATUS LIKE 'wsrep%';
Variable_name Value
wsrep_apply_oooe #
@ -122,6 +126,7 @@ wsrep_local_state_comment #
# Should show nothing.
SHOW STATUS LIKE 'x';
Variable_name Value
SET GLOBAL wsrep_provider=none;
#
# MDEV#6079: xtrabackup SST failing with maria-10.0-galera
#
@ -133,10 +138,12 @@ wsrep_local_state_uuid #
SHOW STATUS LIKE 'wsrep_last_committed';
Variable_name Value
wsrep_last_committed #
SET GLOBAL wsrep_provider=none;
#
# MDEV#6206: wsrep_slave_threads subtracts from max_connections
#
call mtr.add_suppression("WSREP: Failed to get provider options");
SELECT @@global.wsrep_provider;
@@global.wsrep_provider
libgalera_smm.so
@ -145,6 +152,36 @@ SELECT @@global.wsrep_slave_threads;
1
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
NULL
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
Threads_connected 1
SHOW STATUS LIKE 'wsrep_thread_count';
Variable_name Value
wsrep_thread_count 0
SELECT @@global.wsrep_provider;
@@global.wsrep_provider
libgalera_smm.so
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
NULL
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
Threads_connected 1
SHOW STATUS LIKE 'wsrep_thread_count';
Variable_name Value
wsrep_thread_count 0
# Setting wsrep_cluster_address triggers the creation of
# applier/rollbacker threads.
SET GLOBAL wsrep_cluster_address= 'gcomm://';
# Wait for applier threads to get created.
SELECT @@global.wsrep_provider;
@@global.wsrep_provider
libgalera_smm.so
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
gcomm://
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
@ -156,13 +193,12 @@ wsrep_thread_count 2
SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads;
SET GLOBAL wsrep_slave_threads= 10;
# Wait for applier threads to get created.
SHOW STATUS LIKE 'wsrep_thread_count';
Variable_name Value
wsrep_thread_count 11
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
Threads_connected 1
SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
SHOW STATUS LIKE 'wsrep_thread_count';
Variable_name Value
wsrep_thread_count 11
#
# MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
#
@ -180,4 +216,8 @@ SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
NULL
SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved;
SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
SET GLOBAL wsrep_provider= none;
SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved;
SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved;
# End of test.

View file

@ -24,17 +24,13 @@ return "No my_print_defaults" unless $epath;
push @::global_suppressions,
(
qr(WSREP:.*down context.*),
qr(WSREP: Failed to send state UUID:.*),
qr(WSREP: wsrep_sst_receive_address.*),
qr(WSREP: Could not open saved state file for reading: .*),
qr(WSREP: last inactive check more than .* skipping check),
qr(WSREP: Gap in state sequence. Need state transfer.),
qr(WSREP: Failed to prepare for incremental state transfer: .*),
qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned.),
qr(WSREP: Failed to guess base node address),
qr(WSREP: Guessing address for incoming client connections failed),
qr(WSREP: Could not open saved state file for reading: ),
qr(WSREP: option --wsrep-casual-reads is deprecated),
qr(WSREP: --wsrep-casual-reads=ON takes precedence over --wsrep-sync-wait=0),
);
$ENV{PATH}="$epath:$ENV{PATH}";
$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;

View file

@ -0,0 +1 @@
--wsrep-on=0

View file

@ -0,0 +1,10 @@
--source include/have_innodb.inc
--echo #
--echo # MDEV-7374 : Losing connection to MySQL while running ALTER TABLE
--echo #
CREATE TABLE t1(i INT) ENGINE=INNODB;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e;
ALTER TABLE t1 MODIFY i FLOAT;
DROP TABLE t1;

View file

@ -1 +1 @@
--log-bin
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm://

View file

@ -1,18 +1,18 @@
--source include/have_wsrep_enabled.inc
--source include/have_wsrep_provider.inc
--source include/have_binlog_format_row.inc
#
# MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT
#
call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*");
call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID");
call mtr.add_suppression("WSREP: Could not open saved state file for reading:.*");
--echo #
--echo # MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT
--echo #
SHOW VARIABLES LIKE 'binlog_format';
-- error ER_WRONG_VALUE_FOR_VAR
SET binlog_format=STATEMENT;
SHOW WARNINGS;
SHOW VARIABLES LIKE 'binlog_format';
CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
-- error ER_WRONG_VALUE_FOR_VAR
SET binlog_format=MIXED;
SHOW WARNINGS;
SHOW VARIABLES LIKE 'binlog_format';
@ -25,3 +25,23 @@ DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
--echo #
--echo # MDEV-7322: Option to allow setting the binlog_format with Galera
--echo #
-- error ER_WRONG_VALUE_FOR_VAR
SET @@GLOBAL.binlog_format=STATEMENT;
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
-- error ER_WRONG_VALUE_FOR_VAR
SET @@GLOBAL.binlog_format=MIXED;
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
-- error ER_WRONG_VALUE_FOR_VAR
SET @@GLOBAL.binlog_format=DEFAULT;
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
SET @@GLOBAL.binlog_format=ROW;
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
--echo # End of test.

View file

@ -0,0 +1 @@
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm://

View file

@ -0,0 +1,20 @@
--source include/have_wsrep_enabled.inc
--source include/have_binlog_format_row.inc
--source include/have_innodb.inc
USE test;
create table p(v varchar(20), i int, primary key(v,i)) engine=innodb character set = utf8;
create table c(k int primary key, v varchar(20), i int, foreign key(v,i) references p(v,i)) engine=innodb character set = utf8;
insert into p values (_utf32 0x000004100000041100000412, 1);
insert into c values (1, _utf32 0x000004100000041100000412, 1);
SELECT * FROM test.p;
SELECT * FROM test.c;
SELECT * FROM test.p;
SELECT * FROM test.c;
# Cleanup
DROP TABLE c;
DROP TABLE p;

View file

@ -0,0 +1 @@
--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1 --wsrep_causal_reads=ON

View file

@ -0,0 +1,15 @@
--source include/have_wsrep_provider.inc
--source include/have_binlog_format_row.inc
--echo #
--echo # MDEV-6832: ER_LOCK_WAIT_TIMEOUT on SHOW STATUS
--echo #
SHOW STATUS LIKE 'wsrep_ready';
--disable_query_log
eval SET @@global.wsrep_provider='$WSREP_PROVIDER';
--enable_query_log
SHOW STATUS LIKE 'wsrep_ready';
SET @@global.wsrep_cluster_address='gcomm://';
--echo # End of test.

View file

@ -0,0 +1,40 @@
--source include/have_wsrep.inc
--source include/have_symlink.inc
--source include/not_windows.inc
--echo #
--echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
--echo #
--exec mkdir $MYSQLTEST_VARDIR/zoneinfo
--exec ln -s $MYSQLTEST_VARDIR/zoneinfo $MYSQLTEST_VARDIR/zoneinfo/posix
--copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/GMT
--copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/garbage
--copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/ignored.tab
--echo # Verbose run
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_TZINFO_TO_SQL --verbose $MYSQLTEST_VARDIR/zoneinfo 2>&1
--echo # Silent run
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1
--echo #
--echo # Testing with explicit timezonefile
--echo #
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1
--echo #
--echo # Testing --leap
--echo #
--exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1
#
# Cleanup
#
--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo

View file

@ -1 +1 @@
--thread_handling=pool-of-threads
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --thread_handling=pool-of-threads

View file

@ -1,4 +1,5 @@
--source include/have_wsrep_enabled.inc
--source include/have_wsrep.inc
--source include/have_binlog_format_row.inc
--echo
--echo #

View file

@ -1,5 +1,7 @@
--source include/have_wsrep.inc
--source include/have_innodb.inc
SET @wsrep_provider_options_saved= @@global.wsrep_provider_options;
SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address;
--echo
--echo # MDEV#5534: mysql_tzinfo_to_sql generates wrong query
@ -16,12 +18,19 @@ SET GLOBAL wsrep_replicate_myisam= ON;
# Reset it back.
SET GLOBAL wsrep_replicate_myisam= OFF;
SET GLOBAL wsrep_provider=none;
--echo #
--echo # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of
--echo # variables when using "_"
--echo #
CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*");
--disable_query_log
eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--enable_query_log
--replace_column 2 #
SHOW GLOBAL STATUS LIKE 'wsrep%';
@ -35,10 +44,17 @@ SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';
--echo # Should show nothing.
SHOW STATUS LIKE 'x';
# Reset it back.
SET GLOBAL wsrep_provider=none;
--echo #
--echo # MDEV#6079: xtrabackup SST failing with maria-10.0-galera
--echo #
--disable_query_log
eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--enable_query_log
# The following 2 variables are used in innobackupex during xtrabackup-based
# SST.
--echo
@ -48,10 +64,18 @@ SHOW STATUS LIKE 'wsrep_local_state_uuid';
--replace_column 2 #
SHOW STATUS LIKE 'wsrep_last_committed';
# Reset it back.
SET GLOBAL wsrep_provider=none;
--echo
--echo #
--echo # MDEV#6206: wsrep_slave_threads subtracts from max_connections
--echo #
call mtr.add_suppression("WSREP: Failed to get provider options");
--disable_query_log
eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--enable_query_log
--replace_regex /.*libgalera_smm.*/libgalera_smm.so/
SELECT @@global.wsrep_provider;
@ -61,15 +85,36 @@ SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count';
--echo
--disable_query_log
eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--enable_query_log
--replace_regex /.*libgalera_smm.*/libgalera_smm.so/
SELECT @@global.wsrep_provider;
SELECT @@global.wsrep_cluster_address;
SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count';
--echo
--echo # Setting wsrep_cluster_address triggers the creation of
--echo # applier/rollbacker threads.
SET GLOBAL wsrep_cluster_address= 'gcomm://';
--echo # Wait for applier threads to get created.
sleep 3;
--replace_regex /.*libgalera_smm.*/libgalera_smm.so/
SELECT @@global.wsrep_provider;
SELECT @@global.wsrep_cluster_address;
SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count';
--echo
SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads;
SET GLOBAL wsrep_slave_threads= 10;
--echo # Wait for applier threads to get created.
sleep 5;
SHOW STATUS LIKE 'wsrep_thread_count';
sleep 3;
SHOW STATUS LIKE 'threads_connected';
# reset (for mtr internal checks)
SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
SHOW STATUS LIKE 'wsrep_thread_count';
--echo #
--echo # MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
@ -83,5 +128,11 @@ SET @@global.wsrep_sst_auth= NULL;
SELECT @@global.wsrep_sst_auth;
SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved;
# Reset (for mtr internal checks)
SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
SET GLOBAL wsrep_provider= none;
SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved;
SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved;
--echo # End of test.

View file

@ -240,7 +240,7 @@ parse_cnf()
get_footprint()
{
pushd $WSREP_SST_OPT_DATA 1>/dev/null
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | xargs -0 du --block-size=1 -c | awk 'END { print $1 }')
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | du --files0-from=- --block-size=1 -c | awk 'END { print $1 }')
if $my_print_defaults xtrabackup | grep -q -- "--compress";then
# QuickLZ has around 50% compression ratio
# When compression/compaction used, the progress is only an approximate.

View file

@ -205,7 +205,7 @@ parse_cnf()
get_footprint()
{
pushd $WSREP_SST_OPT_DATA 1>/dev/null
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | xargs -0 du --block-size=1 -c | awk 'END { print $1 }')
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | du --files0-from=- --block-size=1 -c | awk 'END { print $1 }')
if $my_print_defaults xtrabackup | grep -q -- "--compress";then
# QuickLZ has around 50% compression ratio
# When compression/compaction used, the progress is only an approximate.

View file

@ -223,6 +223,7 @@ Rpl_filter *get_or_create_rpl_filter(const char *name, uint length)
void free_rpl_filter(const char *name, Rpl_filter *filter)
{
delete filter;
filter= 0;
}
void free_all_rpl_filters()

Some files were not shown because too many files have changed in this diff Show more