summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-02-06 16:14:23 +0100
committerSergei Golubchik <serg@mariadb.org>2015-02-06 16:14:23 +0100
commit8e7649867f23ef4fca5ddb6678a66e414026ef7b (patch)
treeff7649743a3bf13ea13eb80f1126a13cd756d335 /mysql-test/suite
parentf9448bcb2153aac614ecb260a4dd7f27b04f17a2 (diff)
parent7cda4bee0ef7c8a3ec85e94bc1443ceaba3a64e8 (diff)
downloadmariadb-git-8e7649867f23ef4fca5ddb6678a66e414026ef7b.tar.gz
Merge 10.0-galera into 10.1
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/galera/galera_2nodes.cnf38
-rw-r--r--mysql-test/suite/galera/my.cnf1
-rw-r--r--mysql-test/suite/galera/r/basic.result (renamed from mysql-test/suite/wsrep/r/basic.result)17
-rw-r--r--mysql-test/suite/galera/r/create.result23
-rw-r--r--mysql-test/suite/galera/r/fk.result96
-rw-r--r--mysql-test/suite/galera/r/galera_fk_cascade_delete.result30
-rw-r--r--mysql-test/suite/galera/r/galera_fk_cascade_update.result30
-rw-r--r--mysql-test/suite/galera/r/galera_fk_conflict.result23
-rw-r--r--mysql-test/suite/galera/r/galera_fk_mismatch.result25
-rw-r--r--mysql-test/suite/galera/r/galera_fk_multicolumn.result35
-rw-r--r--mysql-test/suite/galera/r/galera_fk_multitable.result22
-rw-r--r--mysql-test/suite/galera/r/galera_fk_no_pk.result28
-rw-r--r--mysql-test/suite/galera/r/galera_fk_selfreferential.result13
-rw-r--r--mysql-test/suite/galera/r/galera_fk_setnull.result30
-rw-r--r--mysql-test/suite/galera/r/galera_many_columns.result1050
-rw-r--r--mysql-test/suite/galera/r/galera_many_indexes.result123
-rw-r--r--mysql-test/suite/galera/r/galera_many_rows.result41
-rw-r--r--mysql-test/suite/galera/r/galera_nopk_bit.result27
-rw-r--r--mysql-test/suite/galera/r/galera_nopk_blob.result27
-rw-r--r--mysql-test/suite/galera/r/galera_nopk_large_varchar.result30
-rw-r--r--mysql-test/suite/galera/r/galera_unicode_identifiers.result46
-rw-r--r--mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result67
-rw-r--r--mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result44
-rw-r--r--mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result21
-rw-r--r--mysql-test/suite/galera/r/galera_var_dirty_reads.result (renamed from mysql-test/suite/wsrep/r/galera_var_dirty_reads.result)0
-rw-r--r--mysql-test/suite/galera/r/galera_var_fkchecks.result26
-rw-r--r--mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result12
-rw-r--r--mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result8
-rw-r--r--mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result8
-rw-r--r--mysql-test/suite/galera/r/galera_var_sync_wait.result21
-rw-r--r--mysql-test/suite/galera/r/grant.result (renamed from mysql-test/suite/wsrep/r/grant.result)0
-rw-r--r--mysql-test/suite/galera/r/partition.result (renamed from mysql-test/suite/wsrep/r/partition.result)0
-rw-r--r--mysql-test/suite/galera/r/query_cache.result1645
-rw-r--r--mysql-test/suite/galera/r/unique_key.result (renamed from mysql-test/suite/wsrep/r/unique_key.result)0
-rw-r--r--mysql-test/suite/galera/r/view.result (renamed from mysql-test/suite/wsrep/r/view.result)0
-rw-r--r--mysql-test/suite/galera/suite.pm45
-rw-r--r--mysql-test/suite/galera/t/basic.test (renamed from mysql-test/suite/wsrep/t/basic.test)22
-rw-r--r--mysql-test/suite/galera/t/create.test26
-rw-r--r--mysql-test/suite/galera/t/fk.test116
-rw-r--r--mysql-test/suite/galera/t/galera_fk_cascade_delete.test41
-rw-r--r--mysql-test/suite/galera/t/galera_fk_cascade_update.test41
-rw-r--r--mysql-test/suite/galera/t/galera_fk_conflict.test41
-rw-r--r--mysql-test/suite/galera/t/galera_fk_mismatch.test38
-rw-r--r--mysql-test/suite/galera/t/galera_fk_multicolumn.test42
-rw-r--r--mysql-test/suite/galera/t/galera_fk_multitable.test32
-rw-r--r--mysql-test/suite/galera/t/galera_fk_no_pk.test37
-rw-r--r--mysql-test/suite/galera/t/galera_fk_selfreferential.test24
-rw-r--r--mysql-test/suite/galera/t/galera_fk_setnull.test36
-rw-r--r--mysql-test/suite/galera/t/galera_many_columns.test65
-rw-r--r--mysql-test/suite/galera/t/galera_many_indexes.test74
-rw-r--r--mysql-test/suite/galera/t/galera_many_rows.test55
-rw-r--r--mysql-test/suite/galera/t/galera_nopk_bit.test46
-rw-r--r--mysql-test/suite/galera/t/galera_nopk_blob.test46
-rw-r--r--mysql-test/suite/galera/t/galera_nopk_large_varchar.test50
-rw-r--r--mysql-test/suite/galera/t/galera_unicode_identifiers.test72
-rw-r--r--mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test101
-rw-r--r--mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test56
-rw-r--r--mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test39
-rw-r--r--mysql-test/suite/galera/t/galera_var_dirty_reads.test (renamed from mysql-test/suite/wsrep/t/galera_var_dirty_reads.test)0
-rw-r--r--mysql-test/suite/galera/t/galera_var_fkchecks.test40
-rw-r--r--mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test30
-rw-r--r--mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test21
-rw-r--r--mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test21
-rw-r--r--mysql-test/suite/galera/t/galera_var_sync_wait.test43
-rw-r--r--mysql-test/suite/galera/t/grant.test (renamed from mysql-test/suite/wsrep/t/grant.test)0
-rw-r--r--mysql-test/suite/galera/t/partition.test (renamed from mysql-test/suite/wsrep/t/partition.test)0
-rw-r--r--mysql-test/suite/galera/t/query_cache.test1002
-rw-r--r--mysql-test/suite/galera/t/unique_key.test (renamed from mysql-test/suite/wsrep/t/unique_key.test)3
-rw-r--r--mysql-test/suite/galera/t/view.test (renamed from mysql-test/suite/wsrep/t/view.test)0
-rw-r--r--mysql-test/suite/wsrep/README7
-rw-r--r--mysql-test/suite/wsrep/my.cnf25
-rw-r--r--mysql-test/suite/wsrep/r/alter_table_innodb.result8
-rw-r--r--mysql-test/suite/wsrep/r/binlog_format.result40
-rw-r--r--mysql-test/suite/wsrep/r/foreign_key.result19
-rw-r--r--mysql-test/suite/wsrep/r/mdev_6832.result11
-rw-r--r--mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result78
-rw-r--r--mysql-test/suite/wsrep/r/variables.result48
-rw-r--r--mysql-test/suite/wsrep/suite.pm14
-rw-r--r--mysql-test/suite/wsrep/t/alter_table_innodb.opt1
-rw-r--r--mysql-test/suite/wsrep/t/alter_table_innodb.test10
-rw-r--r--mysql-test/suite/wsrep/t/binlog_format.opt2
-rw-r--r--mysql-test/suite/wsrep/t/binlog_format.test34
-rw-r--r--mysql-test/suite/wsrep/t/foreign_key.opt1
-rw-r--r--mysql-test/suite/wsrep/t/foreign_key.test20
-rw-r--r--mysql-test/suite/wsrep/t/mdev_6832.opt1
-rw-r--r--mysql-test/suite/wsrep/t/mdev_6832.test15
-rw-r--r--mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test40
-rw-r--r--mysql-test/suite/wsrep/t/pool_of_threads.opt2
-rw-r--r--mysql-test/suite/wsrep/t/pool_of_threads.test3
-rw-r--r--mysql-test/suite/wsrep/t/variables.test63
90 files changed, 6256 insertions, 98 deletions
diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf
new file mode 100644
index 00000000000..99f887b7ca2
--- /dev/null
+++ b/mysql-test/suite/galera/galera_2nodes.cnf
@@ -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
+
diff --git a/mysql-test/suite/galera/my.cnf b/mysql-test/suite/galera/my.cnf
new file mode 100644
index 00000000000..ca163a540d9
--- /dev/null
+++ b/mysql-test/suite/galera/my.cnf
@@ -0,0 +1 @@
+!include galera_2nodes.cnf
diff --git a/mysql-test/suite/wsrep/r/basic.result b/mysql-test/suite/galera/r/basic.result
index 6f8b65de166..d4efe348b61 100644
--- a/mysql-test/suite/wsrep/r/basic.result
+++ b/mysql-test/suite/galera/r/basic.result
@@ -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
diff --git a/mysql-test/suite/galera/r/create.result b/mysql-test/suite/galera/r/create.result
new file mode 100644
index 00000000000..4dffe96d719
--- /dev/null
+++ b/mysql-test/suite/galera/r/create.result
@@ -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
diff --git a/mysql-test/suite/galera/r/fk.result b/mysql-test/suite/galera/r/fk.result
new file mode 100644
index 00000000000..d6a3a25b01a
--- /dev/null
+++ b/mysql-test/suite/galera/r/fk.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_fk_cascade_delete.result b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result
new file mode 100644
index 00000000000..89f4301a0b4
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_fk_cascade_update.result b/mysql-test/suite/galera/r/galera_fk_cascade_update.result
new file mode 100644
index 00000000000..2ab2ad31a13
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_cascade_update.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_fk_conflict.result b/mysql-test/suite/galera/r/galera_fk_conflict.result
new file mode 100644
index 00000000000..ae6c4823a54
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_conflict.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_fk_mismatch.result b/mysql-test/suite/galera/r/galera_fk_mismatch.result
new file mode 100644
index 00000000000..07cdb1b09a2
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_mismatch.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_fk_multicolumn.result b/mysql-test/suite/galera/r/galera_fk_multicolumn.result
new file mode 100644
index 00000000000..62ec9f85cd4
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_multicolumn.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_fk_multitable.result b/mysql-test/suite/galera/r/galera_fk_multitable.result
new file mode 100644
index 00000000000..410565eb0ed
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_multitable.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_fk_no_pk.result b/mysql-test/suite/galera/r/galera_fk_no_pk.result
new file mode 100644
index 00000000000..e4f92863d92
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_no_pk.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_fk_selfreferential.result b/mysql-test/suite/galera/r/galera_fk_selfreferential.result
new file mode 100644
index 00000000000..25c37046e88
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_selfreferential.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_fk_setnull.result b/mysql-test/suite/galera/r/galera_fk_setnull.result
new file mode 100644
index 00000000000..f7fb9d04040
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_setnull.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_many_columns.result b/mysql-test/suite/galera/r/galera_many_columns.result
new file mode 100644
index 00000000000..ba7b9116e7c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_many_columns.result
@@ -0,0 +1,1050 @@
+CREATE TABLE t1 (f1017 VARCHAR(3) DEFAULT 'ABC') ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN f1016 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1015 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1014 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1013 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1012 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1011 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1010 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1009 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1008 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1007 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1006 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1005 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1004 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1003 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1002 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1001 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1000 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f999 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f998 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f997 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f996 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f995 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f994 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f993 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f992 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f991 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f990 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f989 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f988 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f987 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f986 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f985 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f984 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f983 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f982 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f981 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f980 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f979 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f978 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f977 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f976 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f975 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f974 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f973 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f972 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f971 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f970 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f969 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f968 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f967 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f966 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f965 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f964 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f963 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f962 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f961 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f960 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f959 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f958 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f957 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f956 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f955 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f954 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f953 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f952 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f951 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f950 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f949 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f948 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f947 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f946 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f945 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f944 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f943 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f942 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f941 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f940 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f939 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f938 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f937 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f936 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f935 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f934 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f933 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f932 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f931 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f930 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f929 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f928 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f927 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f926 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f925 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f924 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f923 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f922 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f921 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f920 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f919 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f918 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f917 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f916 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f915 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f914 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f913 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f912 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f911 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f910 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f909 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f908 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f907 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f906 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f905 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f904 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f903 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f902 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f901 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f900 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f899 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f898 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f897 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f896 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f895 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f894 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f893 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f892 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f891 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f890 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f889 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f888 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f887 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f886 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f885 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f884 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f883 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f882 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f881 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f880 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f879 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f878 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f877 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f876 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f875 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f874 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f873 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f872 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f871 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f870 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f869 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f868 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f867 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f866 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f865 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f864 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f863 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f862 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f861 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f860 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f859 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f858 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f857 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f856 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f855 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f854 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f853 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f852 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f851 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f850 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f849 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f848 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f847 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f846 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f845 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f844 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f843 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f842 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f841 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f840 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f839 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f838 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f837 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f836 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f835 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f834 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f833 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f832 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f831 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f830 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f829 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f828 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f827 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f826 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f825 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f824 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f823 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f822 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f821 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f820 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f819 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f818 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f817 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f816 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f815 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f814 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f813 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f812 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f811 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f810 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f809 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f808 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f807 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f806 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f805 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f804 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f803 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f802 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f801 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f800 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f799 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f798 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f797 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f796 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f795 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f794 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f793 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f792 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f791 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f790 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f789 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f788 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f787 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f786 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f785 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f784 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f783 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f782 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f781 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f780 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f779 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f778 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f777 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f776 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f775 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f774 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f773 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f772 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f771 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f770 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f769 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f768 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f767 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f766 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f765 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f764 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f763 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f762 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f761 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f760 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f759 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f758 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f757 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f756 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f755 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f754 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f753 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f752 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f751 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f750 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f749 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f748 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f747 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f746 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f745 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f744 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f743 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f742 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f741 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f740 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f739 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f738 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f737 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f736 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f735 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f734 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f733 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f732 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f731 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f730 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f729 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f728 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f727 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f726 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f725 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f724 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f723 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f722 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f721 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f720 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f719 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f718 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f717 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f716 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f715 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f714 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f713 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f712 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f711 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f710 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f709 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f708 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f707 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f706 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f705 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f704 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f703 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f702 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f701 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f700 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f699 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f698 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f697 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f696 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f695 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f694 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f693 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f692 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f691 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f690 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f689 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f688 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f687 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f686 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f685 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f684 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f683 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f682 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f681 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f680 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f679 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f678 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f677 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f676 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f675 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f674 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f673 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f672 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f671 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f670 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f669 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f668 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f667 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f666 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f665 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f664 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f663 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f662 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f661 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f660 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f659 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f658 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f657 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f656 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f655 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f654 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f653 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f652 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f651 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f650 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f649 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f648 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f647 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f646 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f645 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f644 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f643 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f642 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f641 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f640 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f639 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f638 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f637 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f636 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f635 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f634 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f633 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f632 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f631 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f630 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f629 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f628 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f627 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f626 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f625 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f624 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f623 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f622 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f621 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f620 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f619 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f618 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f617 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f616 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f615 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f614 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f613 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f612 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f611 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f610 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f609 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f608 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f607 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f606 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f605 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f604 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f603 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f602 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f601 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f600 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f599 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f598 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f597 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f596 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f595 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f594 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f593 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f592 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f591 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f590 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f589 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f588 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f587 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f586 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f585 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f584 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f583 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f582 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f581 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f580 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f579 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f578 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f577 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f576 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f575 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f574 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f573 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f572 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f571 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f570 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f569 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f568 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f567 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f566 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f565 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f564 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f563 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f562 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f561 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f560 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f559 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f558 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f557 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f556 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f555 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f554 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f553 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f552 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f551 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f550 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f549 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f548 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f547 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f546 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f545 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f544 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f543 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f542 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f541 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f540 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f539 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f538 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f537 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f536 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f535 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f534 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f533 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f532 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f531 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f530 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f529 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f528 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f527 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f526 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f525 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f524 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f523 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f522 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f521 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f520 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f519 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f518 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f517 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f516 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f515 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f514 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f513 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f512 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f511 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f510 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f509 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f508 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f507 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f506 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f505 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f504 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f503 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f502 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f501 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f500 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f499 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f498 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f497 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f496 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f495 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f494 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f493 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f492 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f491 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f490 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f489 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f488 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f487 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f486 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f485 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f484 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f483 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f482 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f481 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f480 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f479 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f478 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f477 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f476 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f475 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f474 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f473 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f472 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f471 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f470 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f469 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f468 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f467 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f466 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f465 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f464 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f463 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f462 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f461 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f460 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f459 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f458 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f457 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f456 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f455 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f454 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f453 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f452 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f451 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f450 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f449 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f448 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f447 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f446 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f445 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f444 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f443 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f442 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f441 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f440 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f439 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f438 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f437 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f436 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f435 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f434 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f433 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f432 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f431 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f430 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f429 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f428 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f427 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f426 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f425 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f424 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f423 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f422 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f421 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f420 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f419 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f418 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f417 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f416 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f415 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f414 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f413 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f412 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f411 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f410 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f409 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f408 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f407 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f406 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f405 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f404 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f403 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f402 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f401 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f400 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f399 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f398 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f397 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f396 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f395 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f394 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f393 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f392 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f391 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f390 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f389 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f388 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f387 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f386 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f385 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f384 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f383 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f382 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f381 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f380 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f379 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f378 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f377 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f376 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f375 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f374 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f373 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f372 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f371 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f370 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f369 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f368 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f367 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f366 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f365 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f364 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f363 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f362 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f361 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f360 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f359 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f358 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f357 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f356 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f355 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f354 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f353 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f352 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f351 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f350 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f349 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f348 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f347 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f346 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f345 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f344 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f343 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f342 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f341 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f340 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f339 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f338 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f337 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f336 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f335 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f334 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f333 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f332 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f331 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f330 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f329 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f328 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f327 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f326 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f325 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f324 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f323 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f322 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f321 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f320 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f319 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f318 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f317 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f316 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f315 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f314 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f313 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f312 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f311 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f310 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f309 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f308 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f307 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f306 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f305 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f304 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f303 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f302 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f301 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f300 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f299 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f298 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f297 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f296 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f295 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f294 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f293 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f292 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f291 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f290 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f289 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f288 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f287 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f286 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f285 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f284 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f283 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f282 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f281 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f280 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f279 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f278 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f277 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f276 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f275 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f274 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f273 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f272 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f271 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f270 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f269 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f268 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f267 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f266 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f265 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f264 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f263 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f262 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f261 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f260 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f259 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f258 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f257 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f256 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f255 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f254 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f253 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f252 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f251 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f250 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f249 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f248 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f247 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f246 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f245 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f244 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f243 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f242 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f241 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f240 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f239 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f238 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f237 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f236 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f235 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f234 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f233 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f232 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f231 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f230 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f229 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f228 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f227 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f226 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f225 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f224 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f223 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f222 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f221 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f220 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f219 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f218 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f217 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f216 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f215 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f214 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f213 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f212 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f211 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f210 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f209 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f208 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f207 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f206 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f205 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f204 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f203 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f202 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f201 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f200 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f199 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f198 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f197 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f196 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f195 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f194 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f193 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f192 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f191 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f190 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f189 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f188 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f187 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f186 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f185 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f184 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f183 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f182 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f181 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f180 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f179 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f178 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f177 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f176 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f175 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f174 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f173 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f172 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f171 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f170 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f169 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f168 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f167 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f166 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f165 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f164 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f163 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f162 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f161 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f160 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f159 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f158 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f157 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f156 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f155 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f154 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f153 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f152 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f151 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f150 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f149 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f148 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f147 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f146 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f145 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f144 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f143 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f142 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f141 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f140 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f139 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f138 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f137 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f136 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f135 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f134 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f133 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f132 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f131 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f130 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f129 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f128 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f127 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f126 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f125 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f124 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f123 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f122 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f121 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f120 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f119 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f118 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f117 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f116 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f115 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f114 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f113 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f112 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f111 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f110 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f109 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f108 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f107 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f106 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f105 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f104 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f103 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f102 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f101 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f100 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f99 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f98 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f97 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f96 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f95 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f94 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f93 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f92 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f91 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f90 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f89 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f88 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f87 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f86 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f85 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f84 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f83 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f82 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f81 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f80 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f79 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f78 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f77 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f76 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f75 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f74 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f73 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f72 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f71 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f70 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f69 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f68 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f67 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f66 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f65 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f64 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f63 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f62 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f61 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f60 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f59 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f58 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f57 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f56 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f55 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f54 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f53 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f52 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f51 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f50 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f49 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f48 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f47 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f46 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f45 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f44 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f43 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f42 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f41 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f40 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f39 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f38 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f37 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f36 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f35 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f34 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f33 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f32 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f31 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f30 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f29 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f28 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f27 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f26 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f25 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f24 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f23 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f22 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f21 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f20 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f19 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f18 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f17 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f16 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f15 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f14 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f13 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f12 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f11 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f10 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f9 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f8 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f7 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f6 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f5 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f4 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f3 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f2 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD COLUMN f1 VARCHAR(3) DEFAULT 'ABC';
+ALTER TABLE t1 ADD PRIMARY KEY (f1, f1017);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+SELECT f1 = 'ABC', f1017 = 'ABC' FROM t1;
+f1 = 'ABC' f1017 = 'ABC'
+1 1
+UPDATE t1 SET f1 = 'XYZ', f1017 = 'XYZ' ;
+SELECT f1 = 'XYZ', f1017 = 'XYZ' FROM t1 WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
+f1 = 'XYZ' f1017 = 'XYZ'
+1 1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'KLM' WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'CDE' WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ROLLBACK;
+ROLLBACK;
+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;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_many_indexes.result b/mysql-test/suite/galera/r/galera_many_indexes.result
new file mode 100644
index 00000000000..ab6eec550a1
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_many_indexes.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_many_rows.result b/mysql-test/suite/galera/r/galera_many_rows.result
new file mode 100644
index 00000000000..fdcec573030
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_many_rows.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_nopk_bit.result b/mysql-test/suite/galera/r/galera_nopk_bit.result
new file mode 100644
index 00000000000..5723dac42fd
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_nopk_bit.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_nopk_blob.result b/mysql-test/suite/galera/r/galera_nopk_blob.result
new file mode 100644
index 00000000000..7491b715ed2
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_nopk_blob.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_nopk_large_varchar.result b/mysql-test/suite/galera/r/galera_nopk_large_varchar.result
new file mode 100644
index 00000000000..abca81e15b0
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_nopk_large_varchar.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_unicode_identifiers.result b/mysql-test/suite/galera/r/galera_unicode_identifiers.result
new file mode 100644
index 00000000000..cb348f8509f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_unicode_identifiers.result
@@ -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);
diff --git a/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result b/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result
new file mode 100644
index 00000000000..87d6020d47c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result b/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result
new file mode 100644
index 00000000000..953ae9f4d81
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result b/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result
new file mode 100644
index 00000000000..35dabb7654f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result
@@ -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;
diff --git a/mysql-test/suite/wsrep/r/galera_var_dirty_reads.result b/mysql-test/suite/galera/r/galera_var_dirty_reads.result
index 6d703c8cf95..6d703c8cf95 100644
--- a/mysql-test/suite/wsrep/r/galera_var_dirty_reads.result
+++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result
diff --git a/mysql-test/suite/galera/r/galera_var_fkchecks.result b/mysql-test/suite/galera/r/galera_var_fkchecks.result
new file mode 100644
index 00000000000..342212a5241
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_fkchecks.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result b/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result
new file mode 100644
index 00000000000..f2a951c26b0
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result b/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result
new file mode 100644
index 00000000000..c8b79071d10
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result b/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result
new file mode 100644
index 00000000000..abaec56a2ad
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result
@@ -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;
diff --git a/mysql-test/suite/galera/r/galera_var_sync_wait.result b/mysql-test/suite/galera/r/galera_var_sync_wait.result
new file mode 100644
index 00000000000..f6136a4ddc4
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_sync_wait.result
@@ -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;
diff --git a/mysql-test/suite/wsrep/r/grant.result b/mysql-test/suite/galera/r/grant.result
index 8d257e7e8e2..8d257e7e8e2 100644
--- a/mysql-test/suite/wsrep/r/grant.result
+++ b/mysql-test/suite/galera/r/grant.result
diff --git a/mysql-test/suite/wsrep/r/partition.result b/mysql-test/suite/galera/r/partition.result
index 60fb2ed298d..60fb2ed298d 100644
--- a/mysql-test/suite/wsrep/r/partition.result
+++ b/mysql-test/suite/galera/r/partition.result
diff --git a/mysql-test/suite/galera/r/query_cache.result b/mysql-test/suite/galera/r/query_cache.result
new file mode 100644
index 00000000000..4b1b950e5c3
--- /dev/null
+++ b/mysql-test/suite/galera/r/query_cache.result
@@ -0,0 +1,1645 @@
+
+# Execute FLUSH/RESET commands.
+# On node-1
+SET @query_cache_size_saved=@@GLOBAL.query_cache_size;
+SET @query_cache_type_saved=@@GLOBAL.query_cache_type;
+set GLOBAL query_cache_size=1355776;
+flush query cache;
+reset query cache;
+flush status;
+# On node-2
+SET @query_cache_size_saved=@@GLOBAL.query_cache_size;
+SET @query_cache_type_saved=@@GLOBAL.query_cache_type;
+set GLOBAL query_cache_size=1355776;
+flush query cache;
+reset query cache;
+flush status;
+# On node-1
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+select sql_no_cache * from t1;
+a
+1
+2
+3
+select length(now()) from t1;
+length(now())
+19
+19
+19
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+select sql_no_cache * from t1;
+a
+1
+2
+3
+select length(now()) from t1;
+length(now())
+19
+19
+19
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-1
+delete from t1 where a=1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-1
+select * from t1;
+a
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+select * from t1;
+a
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-1
+update t1 set a=1 where a=3;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-1
+select * from t1;
+a
+2
+1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+select * from t1;
+a
+2
+1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-1
+drop table t1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+
+# On node-1
+create table t1 (a int not null) ENGINE=MyISAM;
+insert into t1 values (1),(2),(3);
+create table t2 (a int not null) ENGINE=MyISAM;
+insert into t2 values (4),(5),(6);
+create table t3 (a int not null) engine=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
+select * from t3;
+a
+1
+2
+3
+4
+5
+6
+select * from t3;
+a
+1
+2
+3
+4
+5
+6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+insert into t2 values (7);
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+insert into t3 values (8);
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select * from t3;
+a
+1
+2
+3
+8
+4
+5
+6
+7
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+update t2 set a=9 where a=7;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select * from t1;
+a
+1
+2
+3
+8
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+update t3 set a=10 where a=1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select * from t3;
+a
+10
+2
+3
+8
+4
+5
+6
+9
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+delete from t2 where a=9;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select * from t1;
+a
+10
+2
+3
+8
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+delete from t3 where a=10;
+select * from t3;
+a
+2
+3
+8
+4
+5
+6
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+# On node-2
+select * from t3;
+a
+select * from t3;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 4
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+drop table t1, t2, t3;
+# On node-1
+set query_cache_type=demand;
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+a
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select sql_cache * from t1 union select * from t1;
+a
+1
+2
+3
+set query_cache_type=2;
+select sql_cache * from t1 union select * from t1;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+set query_cache_type=on;
+# On node-2
+set query_cache_type=demand;
+select * from t1;
+a
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+select sql_cache * from t1 union select * from t1;
+a
+1
+2
+3
+set query_cache_type=2;
+select sql_cache * from t1 union select * from t1;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+set query_cache_type=on;
+# On node-1
+reset query cache;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+# On node-2
+reset query cache;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+# On node-1
+select sql_no_cache * from t1;
+a
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+# On node-2
+select sql_no_cache * from t1;
+a
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+drop table t1;
+# On node-1
+create table t1 (a text not null) engine=innodb;
+select CONNECTION_ID() from t1;
+CONNECTION_ID()
+select FOUND_ROWS();
+FOUND_ROWS()
+0
+select NOW() from t1;
+NOW()
+select CURDATE() from t1;
+CURDATE()
+select CURTIME() from t1;
+CURTIME()
+select DATABASE() from t1;
+DATABASE()
+select ENCRYPT("test") from t1;
+ENCRYPT("test")
+select LAST_INSERT_ID() from t1;
+LAST_INSERT_ID()
+select RAND() from t1;
+RAND()
+select UNIX_TIMESTAMP() from t1;
+UNIX_TIMESTAMP()
+select USER() from t1;
+USER()
+select CURRENT_USER() from t1;
+CURRENT_USER()
+select benchmark(1,1) from t1;
+benchmark(1,1)
+explain extended select benchmark(1,1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select benchmark(1,1) AS `benchmark(1,1)` from `test`.`t1`
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+# On node-2
+select CONNECTION_ID() from t1;
+CONNECTION_ID()
+select FOUND_ROWS();
+FOUND_ROWS()
+0
+select NOW() from t1;
+NOW()
+select CURDATE() from t1;
+CURDATE()
+select CURTIME() from t1;
+CURTIME()
+select DATABASE() from t1;
+DATABASE()
+select ENCRYPT("test") from t1;
+ENCRYPT("test")
+select LAST_INSERT_ID() from t1;
+LAST_INSERT_ID()
+select RAND() from t1;
+RAND()
+select UNIX_TIMESTAMP() from t1;
+UNIX_TIMESTAMP()
+select USER() from t1;
+USER()
+select CURRENT_USER() from t1;
+CURRENT_USER()
+select benchmark(1,1) from t1;
+benchmark(1,1)
+explain extended select benchmark(1,1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select benchmark(1,1) AS `benchmark(1,1)` from `test`.`t1`
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+drop table t1;
+# On node-1
+create database mysqltest;
+create table mysqltest.t1 (i int not null auto_increment, a int, primary key
+(i)) engine=innodb;
+insert into mysqltest.t1 values (1, 1);
+select * from mysqltest.t1 where i is null;
+i a
+create table t1(a int) engine=innodb;
+select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+select * from mysqltest.t1;
+i a
+1 1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+# On node-2
+select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select * from mysqltest.t1;
+i a
+1 1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+drop database mysqltest;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+drop table t1;
+# On node-1
+create table t1 (a char(1) not null collate koi8r_general_ci) engine=innodb;
+insert into t1 values(_koi8r"á");
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+set CHARACTER SET koi8r;
+select * from t1;
+a
+
+set CHARACTER SET cp1251_koi8;
+select * from t1;
+a
+
+set CHARACTER SET DEFAULT;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+# On node-2
+set CHARACTER SET koi8r;
+select * from t1;
+a
+
+set CHARACTER SET cp1251_koi8;
+select * from t1;
+a
+
+set CHARACTER SET DEFAULT;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+drop table t1;
+# On node-1
+create database if not exists mysqltest;
+create table mysqltest.t1 (i int not null) engine=innodb;
+create table t1 (i int not null) engine=innodb;
+insert into mysqltest.t1 (i) values (1);
+insert into t1 (i) values (2);
+select * from t1;
+i
+2
+use mysqltest;
+select * from t1;
+i
+1
+select * from t1;
+i
+1
+use test;
+select * from t1;
+i
+2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 6
+# On node-2
+select * from t1;
+i
+2
+use mysqltest;
+select * from t1;
+i
+1
+select * from t1;
+i
+1
+use test;
+select * from t1;
+i
+2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 5
+drop database mysqltest;
+drop table t1;
+# On node-1
+create table t1 (i int not null) engine=innodb;
+insert into t1 (i) values (1),(2),(3),(4);
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+i
+1
+2
+select FOUND_ROWS();
+FOUND_ROWS()
+4
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 6
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+select * from t1 where i=1;
+i
+1
+select FOUND_ROWS();
+FOUND_ROWS()
+1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 6
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+i
+1
+2
+select FOUND_ROWS();
+FOUND_ROWS()
+4
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 7
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+select * from t1 where i=1;
+i
+1
+select FOUND_ROWS();
+FOUND_ROWS()
+1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 8
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+# On node-2
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+i
+1
+2
+select FOUND_ROWS();
+FOUND_ROWS()
+4
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 5
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+select * from t1 where i=1;
+i
+1
+select FOUND_ROWS();
+FOUND_ROWS()
+1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 5
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+i
+1
+2
+select FOUND_ROWS();
+FOUND_ROWS()
+4
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 6
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+select * from t1 where i=1;
+i
+1
+select FOUND_ROWS();
+FOUND_ROWS()
+1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 7
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+drop table t1;
+# On node-2
+flush query cache;
+reset query cache;
+# On node-1
+flush query cache;
+reset query cache;
+create table t1 (a int not null) ENGINE=MYISAM;
+insert into t1 values (1),(2),(3);
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 9
+insert delayed into t1 values (4);
+select a from t1;
+a
+1
+2
+3
+4
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 9
+# On node-2
+select * from t1;
+a
+select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 8
+insert delayed into t1 values (4);
+select a from t1;
+a
+4
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 8
+drop table t1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 8
+# On node-1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 9
+# On node-2
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 4096
+set GLOBAL query_cache_min_res_unit=1001;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_min_res_unit value: '1001'
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 1000
+# On node-1
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 4096
+set GLOBAL query_cache_min_res_unit=1001;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_min_res_unit value: '1001'
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 1000
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+create table t2 (a int not null) engine=innodb;
+insert into t2 values (1),(2),(3);
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+select * from t2;
+a
+1
+2
+3
+select * from t2;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+# On node-2
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+select * from t2;
+a
+1
+2
+3
+select * from t2;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 10
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+drop table t1;
+select a from t2;
+a
+1
+2
+3
+select a from t2;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+set GLOBAL query_cache_min_res_unit=default;
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 4096
+# On node-1
+select a from t2;
+a
+1
+2
+3
+select a from t2;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+drop table t2;
+set GLOBAL query_cache_min_res_unit=default;
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 4096
+# On node-1
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1);
+select "aaa" from t1;
+aaa
+aaa
+select "AAA" from t1;
+AAA
+AAA
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+# On node-2
+select "aaa" from t1;
+aaa
+aaa
+select "AAA" from t1;
+AAA
+AAA
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+drop table t1;
+# On node-1
+create table t1 (a int) engine=innodb;
+set GLOBAL query_cache_size=1000;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_size value: '1000'
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=1024;
+Warnings:
+Warning 1282 Query cache failed to set size 1024; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=10240;
+Warnings:
+Warning 1282 Query cache failed to set size 10240; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=20480;
+Warnings:
+Warning 1282 Query cache failed to set size 20480; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=40960;
+Warnings:
+Warning 1282 Query cache failed to set size 40960; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=51200;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 51200
+select * from t1;
+a
+set GLOBAL query_cache_size=61440;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 61440
+select * from t1;
+a
+set GLOBAL query_cache_size=81920;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 81920
+select * from t1;
+a
+set GLOBAL query_cache_size=102400;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 102400
+select * from t1;
+a
+# On node-2
+set GLOBAL query_cache_size=1000;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_size value: '1000'
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=1024;
+Warnings:
+Warning 1282 Query cache failed to set size 1024; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=10240;
+Warnings:
+Warning 1282 Query cache failed to set size 10240; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=20480;
+Warnings:
+Warning 1282 Query cache failed to set size 20480; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=40960;
+Warnings:
+Warning 1282 Query cache failed to set size 40960; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=51200;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 51200
+select * from t1;
+a
+set GLOBAL query_cache_size=61440;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 61440
+select * from t1;
+a
+set GLOBAL query_cache_size=81920;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 81920
+select * from t1;
+a
+set GLOBAL query_cache_size=102400;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 102400
+select * from t1;
+a
+drop table t1;
+# On node-1
+set GLOBAL query_cache_size=1048576;
+create table t1 (i int not null) engine=innodb;
+create table t2 (i int not null) engine=innodb;
+select * from t1;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+create temporary table t3 (i int not null);
+select * from t2;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+select * from t3;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+update t1 set i=(select distinct 1 from (select * from t2) a);
+drop table t3;
+# On node-2
+set GLOBAL query_cache_size=1048576;
+select * from t1;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+select * from t2;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+drop table t1, t2;
+# On node-1
+use mysql;
+select * from db;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+use test;
+select * from mysql.db;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+# On node-1
+create table t1(id int auto_increment primary key) engine=innodb;
+insert into t1 values (1), (2), (3);
+select * from t1;
+id
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+# On node-2
+select * from t1;
+id
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+# On node-1
+alter table t1 rename to t2;
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+# On node-2
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+drop table t2;
+# On node-1
+create table t1 (word char(20) not null) engine=innodb;
+select * from t1;
+word
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+load data infile 'MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+select count(*) from t1;
+count(*)
+70
+# On node-2
+select count(*) from t1;
+count(*)
+70
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+load data infile 'MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+select count(*) from t1;
+count(*)
+140
+drop table t1;
+# On node-1
+create table t1 (a int) engine=innodb;
+insert into t1 values (1),(2),(3);
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+select * from t1 into outfile "query_cache.out.file";
+select * from t1 into outfile "query_cache.out.file";
+ERROR HY000: File 'query_cache.out.file' already exists
+select * from t1 limit 1 into dumpfile "query_cache.dump.file";
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+drop table t1;
+# On node-1
+create table t1 (a int) engine=innodb;
+insert into t1 values (1),(2);
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+select * from t1;
+a
+1
+2
+SET SQL_SELECT_LIMIT=1;
+select * from t1;
+a
+1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+SET SQL_SELECT_LIMIT=DEFAULT;
+# On node-2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+select * from t1;
+a
+1
+2
+SET SQL_SELECT_LIMIT=1;
+select * from t1;
+a
+1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+SET SQL_SELECT_LIMIT=DEFAULT;
+drop table t1;
+# On node-1
+create table t1 (a int not null) engine=innodb;
+create table t2 (a int not null) engine=innodb;
+set query_cache_wlock_invalidate=1;
+create view v1 as select * from t1;
+select * from t1;
+a
+select * from t2;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+lock table t1 write, t2 read;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+unlock table;
+select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+lock table v1 write;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+unlock table;
+drop view v1;
+set query_cache_wlock_invalidate=default;
+# On node-2
+set query_cache_wlock_invalidate=1;
+create view v1 as select * from t1;
+select * from t1;
+a
+select * from t2;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+lock table t1 write, t2 read;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+unlock table;
+select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+lock table v1 write;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+unlock table;
+drop view v1;
+set query_cache_wlock_invalidate=default;
+drop table t1,t2;
+# On node-1
+create table t1 (id int primary key) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+id
+1
+2
+3
+create temporary table t1 (a int not null auto_increment primary key);
+select * from t1;
+a
+drop table t1;
+drop table t1;
+# On node-1
+SET NAMES koi8r;
+CREATE TABLE t1 (a char(1) character set koi8r) engine=innodb;
+INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á');
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
+SELECT a,'Â','â'='Â' FROM t1;
+a  'â'='Â'
+ Â 0
+ Â 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+set collation_connection=koi8r_bin;
+SELECT a,'Â','â'='Â' FROM t1;
+a  'â'='Â'
+ Â 0
+ Â 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+set character_set_client=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+a ? '?'='?'
+ ? 1
+ ? 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 3
+set character_set_results=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+a ? 'â'='Â'
+ ? 1
+ ? 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 4
+SET NAMES default;
+# On node-2
+SELECT a,'Â','â'='Â' FROM t1;
+a  'â'='Â'
+? Â 0
+? Â 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+set collation_connection=koi8r_bin;
+SELECT a,'Â','â'='Â' FROM t1;
+a ?? 'â'='Â'
+? ?? 1
+? ?? 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+set character_set_client=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+a ?? '??'='?'
+? ?? 1
+? ?? 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 3
+set character_set_results=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+a ? 'â'='Â'
+ ? 1
+ ? 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 4
+drop table t1;
+# On node-1
+create table t1 (a int) engine=innodb;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 46
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+/**/ select * from t1;
+a
+/**/ select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 47
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 13
+# On node-2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 38
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+/**/ select * from t1;
+a
+/**/ select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 39
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+drop table t1;
+# On node-1
+set session query_cache_type = 2;
+create table t1(a int) engine=innodb;
+select table_name from information_schema.tables
+where table_schema="test";
+table_name
+t1
+drop table t1;
+select table_name from information_schema.tables
+where table_schema="test";
+table_name
+set session query_cache_type = 1;
+set global query_cache_size=1024*1024;
+flush query cache;
+create table t1 ( a int ) engine=myisam;
+insert into t1 values (1);
+select a from t1;
+a
+1
+select a from t1;
+a
+1
+show status like 'qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 14
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+show status like 'qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 14
+# On node-2
+select a from t1;
+a
+select a from t1;
+a
+show status like 'qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 13
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+show status like 'qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 13
+drop table t1;
+# Restore original settings.
+# On node-1
+SET GLOBAL query_cache_size=@query_cache_size_saved;
+SET GLOBAL query_cache_type=@query_cache_type_saved;
+
+# On node-2
+SET GLOBAL query_cache_size=@query_cache_size_saved;
+SET GLOBAL query_cache_type=@query_cache_type_saved;
+# End of test
diff --git a/mysql-test/suite/wsrep/r/unique_key.result b/mysql-test/suite/galera/r/unique_key.result
index ffb4f01c1f8..ffb4f01c1f8 100644
--- a/mysql-test/suite/wsrep/r/unique_key.result
+++ b/mysql-test/suite/galera/r/unique_key.result
diff --git a/mysql-test/suite/wsrep/r/view.result b/mysql-test/suite/galera/r/view.result
index 89e2355b4dc..89e2355b4dc 100644
--- a/mysql-test/suite/wsrep/r/view.result
+++ b/mysql-test/suite/galera/r/view.result
diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm
new file mode 100644
index 00000000000..7642b937e05
--- /dev/null
+++ b/mysql-test/suite/galera/suite.pm
@@ -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 { };
+
diff --git a/mysql-test/suite/wsrep/t/basic.test b/mysql-test/suite/galera/t/basic.test
index ad220f96f55..8fc6eee3b3b 100644
--- a/mysql-test/suite/wsrep/t/basic.test
+++ b/mysql-test/suite/galera/t/basic.test
@@ -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
diff --git a/mysql-test/suite/galera/t/create.test b/mysql-test/suite/galera/t/create.test
new file mode 100644
index 00000000000..b56a841fb65
--- /dev/null
+++ b/mysql-test/suite/galera/t/create.test
@@ -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
+
diff --git a/mysql-test/suite/galera/t/fk.test b/mysql-test/suite/galera/t/fk.test
new file mode 100644
index 00000000000..e0b7cf06ed0
--- /dev/null
+++ b/mysql-test/suite/galera/t/fk.test
@@ -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
diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_delete.test b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test
new file mode 100644
index 00000000000..9b79b4c30b6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_update.test b/mysql-test/suite/galera/t/galera_fk_cascade_update.test
new file mode 100644
index 00000000000..e736803a285
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_cascade_update.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_fk_conflict.test b/mysql-test/suite/galera/t/galera_fk_conflict.test
new file mode 100644
index 00000000000..cb6f95ee687
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_conflict.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_fk_mismatch.test b/mysql-test/suite/galera/t/galera_fk_mismatch.test
new file mode 100644
index 00000000000..bded41381a7
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_mismatch.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_fk_multicolumn.test b/mysql-test/suite/galera/t/galera_fk_multicolumn.test
new file mode 100644
index 00000000000..fc00eadcf5f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_multicolumn.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_fk_multitable.test b/mysql-test/suite/galera/t/galera_fk_multitable.test
new file mode 100644
index 00000000000..e53757b051b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_multitable.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_fk_no_pk.test b/mysql-test/suite/galera/t/galera_fk_no_pk.test
new file mode 100644
index 00000000000..d1f9c26762d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_no_pk.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_fk_selfreferential.test b/mysql-test/suite/galera/t/galera_fk_selfreferential.test
new file mode 100644
index 00000000000..e2c19001030
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_selfreferential.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_fk_setnull.test b/mysql-test/suite/galera/t/galera_fk_setnull.test
new file mode 100644
index 00000000000..46ba82dbf9c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_setnull.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_many_columns.test b/mysql-test/suite/galera/t/galera_many_columns.test
new file mode 100644
index 00000000000..09bd9902e81
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_many_columns.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_many_indexes.test b/mysql-test/suite/galera/t/galera_many_indexes.test
new file mode 100644
index 00000000000..e01d0b23aa5
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_many_indexes.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_many_rows.test b/mysql-test/suite/galera/t/galera_many_rows.test
new file mode 100644
index 00000000000..5ec1af0a8bf
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_many_rows.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_nopk_bit.test b/mysql-test/suite/galera/t/galera_nopk_bit.test
new file mode 100644
index 00000000000..4292a6d6711
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_nopk_bit.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_nopk_blob.test b/mysql-test/suite/galera/t/galera_nopk_blob.test
new file mode 100644
index 00000000000..08e3b996c8e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_nopk_blob.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_nopk_large_varchar.test b/mysql-test/suite/galera/t/galera_nopk_large_varchar.test
new file mode 100644
index 00000000000..bb9bcd5a593
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_nopk_large_varchar.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_unicode_identifiers.test b/mysql-test/suite/galera/t/galera_unicode_identifiers.test
new file mode 100644
index 00000000000..4722d6d61a2
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_unicode_identifiers.test
@@ -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
+
diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test b/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test
new file mode 100644
index 00000000000..1ae08abc920
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test
new file mode 100644
index 00000000000..4d1b9af1573
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test b/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test
new file mode 100644
index 00000000000..f7967daebe7
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test
@@ -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;
+
diff --git a/mysql-test/suite/wsrep/t/galera_var_dirty_reads.test b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
index 855f4abdbf0..855f4abdbf0 100644
--- a/mysql-test/suite/wsrep/t/galera_var_dirty_reads.test
+++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
diff --git a/mysql-test/suite/galera/t/galera_var_fkchecks.test b/mysql-test/suite/galera/t/galera_var_fkchecks.test
new file mode 100644
index 00000000000..c771b50c06c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_fkchecks.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test b/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test
new file mode 100644
index 00000000000..642d939692c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test b/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test
new file mode 100644
index 00000000000..a9811283918
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test b/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test
new file mode 100644
index 00000000000..f6838028e66
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test
@@ -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;
diff --git a/mysql-test/suite/galera/t/galera_var_sync_wait.test b/mysql-test/suite/galera/t/galera_var_sync_wait.test
new file mode 100644
index 00000000000..935c271a4d6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_sync_wait.test
@@ -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;
diff --git a/mysql-test/suite/wsrep/t/grant.test b/mysql-test/suite/galera/t/grant.test
index de1c202cfbb..de1c202cfbb 100644
--- a/mysql-test/suite/wsrep/t/grant.test
+++ b/mysql-test/suite/galera/t/grant.test
diff --git a/mysql-test/suite/wsrep/t/partition.test b/mysql-test/suite/galera/t/partition.test
index 048f35a9282..048f35a9282 100644
--- a/mysql-test/suite/wsrep/t/partition.test
+++ b/mysql-test/suite/galera/t/partition.test
diff --git a/mysql-test/suite/galera/t/query_cache.test b/mysql-test/suite/galera/t/query_cache.test
new file mode 100644
index 00000000000..24ed8ecd077
--- /dev/null
+++ b/mysql-test/suite/galera/t/query_cache.test
@@ -0,0 +1,1002 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_query_cache.inc
+
+--echo
+--echo # Execute FLUSH/RESET commands.
+--echo # On node-1
+--connection node_1
+SET @query_cache_size_saved=@@GLOBAL.query_cache_size;
+SET @query_cache_type_saved=@@GLOBAL.query_cache_type;
+set GLOBAL query_cache_size=1355776;
+flush query cache; # This crashed in some versions
+reset query cache;
+flush status;
+
+--echo # On node-2
+--connection node_2
+SET @query_cache_size_saved=@@GLOBAL.query_cache_size;
+SET @query_cache_type_saved=@@GLOBAL.query_cache_type;
+set GLOBAL query_cache_size=1355776;
+flush query cache; # This crashed in some versions
+reset query cache;
+flush status;
+
+#
+# INSERT/UPDATE/DELETE/DROP/SELECT
+#
+
+--echo # On node-1
+--connection node_1
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+select * from t1;
+select sql_no_cache * from t1;
+select length(now()) from t1;
+
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+
+select * from t1;
+select * from t1;
+select sql_no_cache * from t1;
+select length(now()) from t1;
+
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+# DELETE should invalidate cache on both the nodes.
+--echo # On node-1
+--connection node_1
+delete from t1 where a=1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+# Add a SELECT to the cache.
+--echo # On node-1
+--connection node_1
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+# UPDATE should invalidate cache on both the nodes.
+--echo # On node-1
+--connection node_1
+update t1 set a=1 where a=3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+# Add a SELECT to the cache.
+--echo # On node-1
+--connection node_1
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+# DROP should invalidate cache on both the nodes.
+--echo # On node-1
+--connection node_1
+drop table t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+#
+# MERGE TABLES with INSERT/UPDATE and DELETE
+#
+--echo
+--echo # On node-1
+--connection node_1
+create table t1 (a int not null) ENGINE=MyISAM;
+insert into t1 values (1),(2),(3);
+create table t2 (a int not null) ENGINE=MyISAM;
+insert into t2 values (4),(5),(6);
+create table t3 (a int not null) engine=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
+# insert
+select * from t3;
+select * from t3;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+insert into t2 values (7);
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1;
+select * from t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+insert into t3 values (8);
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+# update
+select * from t3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+update t2 set a=9 where a=7;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+update t3 set a=10 where a=1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+#delete
+select * from t3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+delete from t2 where a=9;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+delete from t3 where a=10;
+select * from t3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+# MERGE table, expect no records.
+select * from t3;
+select * from t3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+drop table t1, t2, t3;
+
+#
+# SELECT SQL_CACHE ...
+#
+--echo # On node-1
+--connection node_1
+set query_cache_type=demand;
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select sql_cache * from t1 union select * from t1;
+set query_cache_type=2;
+select sql_cache * from t1 union select * from t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+set query_cache_type=on;
+
+--echo # On node-2
+--connection node_2
+set query_cache_type=demand;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select sql_cache * from t1 union select * from t1;
+set query_cache_type=2;
+select sql_cache * from t1 union select * from t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+set query_cache_type=on;
+
+#
+# RESET QUERY CACHE
+#
+--echo # On node-1
+--connection node_1
+reset query cache;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+--echo # On node-2
+--connection node_2
+reset query cache;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+#
+# SELECT SQL_NO_CACHE
+#
+--echo # On node-1
+--connection node_1
+select sql_no_cache * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+--echo # On node-2
+--connection node_2
+select sql_no_cache * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+
+#
+# Check that queries that uses NOW(), LAST_INSERT_ID()... are not cached.
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a text not null) engine=innodb;
+select CONNECTION_ID() from t1;
+select FOUND_ROWS();
+select NOW() from t1;
+select CURDATE() from t1;
+select CURTIME() from t1;
+select DATABASE() from t1;
+select ENCRYPT("test") from t1;
+select LAST_INSERT_ID() from t1;
+select RAND() from t1;
+select UNIX_TIMESTAMP() from t1;
+select USER() from t1;
+select CURRENT_USER() from t1;
+select benchmark(1,1) from t1;
+explain extended select benchmark(1,1) from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+--echo # On node-2
+--connection node_2
+select CONNECTION_ID() from t1;
+select FOUND_ROWS();
+select NOW() from t1;
+select CURDATE() from t1;
+select CURTIME() from t1;
+select DATABASE() from t1;
+select ENCRYPT("test") from t1;
+select LAST_INSERT_ID() from t1;
+select RAND() from t1;
+select UNIX_TIMESTAMP() from t1;
+select USER() from t1;
+select CURRENT_USER() from t1;
+select benchmark(1,1) from t1;
+explain extended select benchmark(1,1) from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+
+#
+# Non-cachable ODBC work around (and prepare cache for drop database)
+#
+--echo # On node-1
+--connection node_1
+create database mysqltest;
+create table mysqltest.t1 (i int not null auto_increment, a int, primary key
+ (i)) engine=innodb;
+insert into mysqltest.t1 values (1, 1);
+select * from mysqltest.t1 where i is null;
+create table t1(a int) engine=innodb;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from mysqltest.t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from mysqltest.t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+#
+# drop db
+#
+drop database mysqltest;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+
+#
+# Charset conversion (cp1251_koi8 always present)
+# Note: Queries using different default character sets are cached separately.
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a char(1) not null collate koi8r_general_ci) engine=innodb;
+insert into t1 values(_koi8r"á");
+set CHARACTER SET koi8r;
+select * from t1;
+set CHARACTER SET cp1251_koi8;
+select * from t1;
+set CHARACTER SET DEFAULT;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+set CHARACTER SET koi8r;
+select * from t1;
+set CHARACTER SET cp1251_koi8;
+select * from t1;
+set CHARACTER SET DEFAULT;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+
+#
+# Same tables in different dbs
+#
+--echo # On node-1
+--connection node_1
+create database if not exists mysqltest;
+create table mysqltest.t1 (i int not null) engine=innodb;
+create table t1 (i int not null) engine=innodb;
+insert into mysqltest.t1 (i) values (1);
+insert into t1 (i) values (2);
+
+select * from t1;
+use mysqltest;
+select * from t1;
+select * from t1;
+use test;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+use mysqltest;
+select * from t1;
+select * from t1;
+use test;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop database mysqltest;
+drop table t1;
+
+#
+# FOUND_ROWS()
+#
+--echo # On node-1
+--connection node_1
+create table t1 (i int not null) engine=innodb;
+insert into t1 (i) values (1),(2),(3),(4);
+
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select * from t1 where i=1;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select * from t1 where i=1;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+--echo # On node-2
+--connection node_2
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select * from t1 where i=1;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select * from t1 where i=1;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+drop table t1;
+
+#
+# Test insert delayed (MYISAM)
+#
+
+--echo # On node-2
+--connection node_2
+flush query cache;
+reset query cache;
+
+--echo # On node-1
+--connection node_1
+flush query cache;
+reset query cache;
+
+create table t1 (a int not null) ENGINE=MYISAM;
+insert into t1 values (1),(2),(3);
+select * from t1;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+insert delayed into t1 values (4);
+--sleep 5 # Wait for insert delayed to be executed.
+select a from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+insert delayed into t1 values (4);
+--sleep 5 # Wait for insert delayed to be executed.
+select a from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+drop table t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-1
+--connection node_1
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+#
+# Test of min result data unit size changing
+#
+--echo # On node-2
+--connection node_2
+show global variables like "query_cache_min_res_unit";
+set GLOBAL query_cache_min_res_unit=1001;
+show global variables like "query_cache_min_res_unit";
+
+--echo # On node-1
+--connection node_1
+show global variables like "query_cache_min_res_unit";
+set GLOBAL query_cache_min_res_unit=1001;
+show global variables like "query_cache_min_res_unit";
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+create table t2 (a int not null) engine=innodb;
+insert into t2 values (1),(2),(3);
+select * from t1;
+select * from t1;
+select * from t2;
+select * from t2;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+select * from t1;
+select * from t2;
+select * from t2;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+drop table t1;
+select a from t2;
+select a from t2;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+set GLOBAL query_cache_min_res_unit=default;
+show global variables like "query_cache_min_res_unit";
+
+--echo # On node-1
+--connection node_1
+select a from t2;
+select a from t2;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+drop table t2;
+set GLOBAL query_cache_min_res_unit=default;
+show global variables like "query_cache_min_res_unit";
+
+#
+# Case sensitive test
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1);
+select "aaa" from t1;
+select "AAA" from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select "aaa" from t1;
+select "AAA" from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+
+#
+# Test of query cache resizing
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int) engine=innodb;
+set GLOBAL query_cache_size=1000;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=1024;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=10240;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=20480;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=40960;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=51200;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=61440;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=81920;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=102400;
+show global variables like "query_cache_size";
+select * from t1;
+
+--echo # On node-2
+--connection node_2
+set GLOBAL query_cache_size=1000;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=1024;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=10240;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=20480;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=40960;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=51200;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=61440;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=81920;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=102400;
+show global variables like "query_cache_size";
+select * from t1;
+
+drop table t1;
+
+#
+# Temporary tables (ignored by Galera)
+#
+--echo # On node-1
+--connection node_1
+set GLOBAL query_cache_size=1048576;
+create table t1 (i int not null) engine=innodb;
+create table t2 (i int not null) engine=innodb;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+create temporary table t3 (i int not null);
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+update t1 set i=(select distinct 1 from (select * from t2) a);
+drop table t3;
+
+--echo # On node-2
+--connection node_2
+set GLOBAL query_cache_size=1048576;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+drop table t1, t2;
+
+#
+# System databse test (no need to perform it on node_2)
+# Note: Queries on system tables are not cached.
+#
+--echo # On node-1
+--connection node_1
+use mysql;
+disable_result_log;
+select * from db;
+enable_result_log;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+use test;
+disable_result_log;
+select * from mysql.db;
+enable_result_log;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+#
+# Simple rename test
+#
+--echo # On node-1
+--connection node_1
+create table t1(id int auto_increment primary key) engine=innodb;
+insert into t1 values (1), (2), (3);
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-1
+--connection node_1
+alter table t1 rename to t2;
+--error ER_NO_SUCH_TABLE
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+--error ER_NO_SUCH_TABLE
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t2;
+
+#
+# Load data invalidation test
+#
+--echo # On node-1
+--connection node_1
+create table t1 (word char(20) not null) engine=innodb;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data infile '$MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select count(*) from t1;
+
+# Wait for "load data" to replicate.
+--sleep 5
+
+--echo # On node-2
+--connection node_2
+select count(*) from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data infile '$MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select count(*) from t1;
+
+drop table t1;
+
+#
+# INTO OUTFILE/DUMPFILE test
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int) engine=innodb;
+insert into t1 values (1),(2),(3);
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1 into outfile "query_cache.out.file";
+--error ER_FILE_EXISTS_ERROR
+select * from t1 into outfile "query_cache.out.file";
+select * from t1 limit 1 into dumpfile "query_cache.dump.file";
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+let $datadir=`select @@datadir`;
+--remove_file $datadir/test/query_cache.dump.file
+--remove_file $datadir/test/query_cache.out.file
+
+#
+# Test of SQL_SELECT_LIMIT
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int) engine=innodb;
+insert into t1 values (1),(2);
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1;
+SET SQL_SELECT_LIMIT=1;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+SET SQL_SELECT_LIMIT=DEFAULT;
+
+--echo # On node-2
+--connection node_2
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1;
+SET SQL_SELECT_LIMIT=1;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+SET SQL_SELECT_LIMIT=DEFAULT;
+
+drop table t1;
+
+#
+# WRITE LOCK & QC
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int not null) engine=innodb;
+create table t2 (a int not null) engine=innodb;
+
+set query_cache_wlock_invalidate=1;
+create view v1 as select * from t1;
+select * from t1;
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+lock table t1 write, t2 read;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+unlock table;
+select * from t1;
+# Implicit locking of t1 does not invalidate QC
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+lock table v1 write;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+unlock table;
+drop view v1;
+set query_cache_wlock_invalidate=default;
+
+--echo # On node-2
+--connection node_2
+set query_cache_wlock_invalidate=1;
+create view v1 as select * from t1;
+select * from t1;
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+lock table t1 write, t2 read;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+unlock table;
+select * from t1;
+# Implicit locking of t1 does not invalidate QC
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+lock table v1 write;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+unlock table;
+drop view v1;
+set query_cache_wlock_invalidate=default;
+
+drop table t1,t2;
+
+#
+# Hiding real table stored in query cache by temporary table
+#
+--echo # On node-1
+--connection node_1
+create table t1 (id int primary key) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+create temporary table t1 (a int not null auto_increment primary key);
+select * from t1;
+drop table t1;
+drop table t1;
+
+#
+# Test character set related variables:
+# character_set_result
+# character_set_client
+# charactet_set_connection/collation_connection
+# If at least one of the above variables has changed,
+# the cached query can't be reused. In the below test
+# absolutely the same query is used several times,
+# SELECT should fetch different results for every instance.
+# No hits should be produced.
+# New cache entry should appear for every SELECT.
+#
+
+--echo # On node-1
+--connection node_1
+SET NAMES koi8r;
+CREATE TABLE t1 (a char(1) character set koi8r) engine=innodb;
+INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á');
+#
+# Run select
+#
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# Change collation_connection and run the same query again
+#
+set collation_connection=koi8r_bin;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# Now change character_set_client and run the same query again
+#
+set character_set_client=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# And finally change character_set_results and run the same query again
+#
+set character_set_results=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+SET NAMES default;
+
+--echo # On node-2
+--connection node_2
+#
+# Run select
+#
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# Change collation_connection and run the same query again
+#
+set collation_connection=koi8r_bin;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# Now change character_set_client and run the same query again
+#
+set character_set_client=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# And finally change character_set_results and run the same query again
+#
+set character_set_results=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+drop table t1;
+
+#
+# Comments before command
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int) engine=innodb;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+/**/ select * from t1;
+/**/ select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+/**/ select * from t1;
+/**/ select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+drop table t1;
+
+#
+# Information schema & query cache test
+#
+--echo # On node-1
+--connection node_1
+set session query_cache_type = 2;
+create table t1(a int) engine=innodb;
+select table_name from information_schema.tables
+where table_schema="test";
+drop table t1;
+select table_name from information_schema.tables
+where table_schema="test";
+# Bug #8480: REPAIR TABLE needs to flush the table from the query cache
+set session query_cache_type = 1;
+set global query_cache_size=1024*1024;
+flush query cache;
+create table t1 ( a int ) engine=myisam; # myisam for repair tables
+insert into t1 values (1);
+select a from t1;
+select a from t1;
+show status like 'qcache_queries_in_cache';
+show status like "Qcache_hits";
+repair table t1;
+show status like 'qcache_queries_in_cache';
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select a from t1;
+select a from t1;
+show status like 'qcache_queries_in_cache';
+show status like "Qcache_hits";
+repair table t1;
+show status like 'qcache_queries_in_cache';
+show status like "Qcache_hits";
+drop table t1;
+
+--echo # Restore original settings.
+--echo # On node-1
+--connection node_1
+SET GLOBAL query_cache_size=@query_cache_size_saved;
+SET GLOBAL query_cache_type=@query_cache_type_saved;
+--echo
+--echo # On node-2
+--connection node_2
+SET GLOBAL query_cache_size=@query_cache_size_saved;
+SET GLOBAL query_cache_type=@query_cache_type_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/wsrep/t/unique_key.test b/mysql-test/suite/galera/t/unique_key.test
index aac3c541355..00b85d57165 100644
--- a/mysql-test/suite/wsrep/t/unique_key.test
+++ b/mysql-test/suite/galera/t/unique_key.test
@@ -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
diff --git a/mysql-test/suite/wsrep/t/view.test b/mysql-test/suite/galera/t/view.test
index 6768917589c..6768917589c 100644
--- a/mysql-test/suite/wsrep/t/view.test
+++ b/mysql-test/suite/galera/t/view.test
diff --git a/mysql-test/suite/wsrep/README b/mysql-test/suite/wsrep/README
index e69de29bb2d..988096071a4 100644
--- a/mysql-test/suite/wsrep/README
+++ b/mysql-test/suite/wsrep/README
@@ -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
+
diff --git a/mysql-test/suite/wsrep/my.cnf b/mysql-test/suite/wsrep/my.cnf
index ea04d948b61..8c5c9851cac 100644
--- a/mysql-test/suite/wsrep/my.cnf
+++ b/mysql-test/suite/wsrep/my.cnf
@@ -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'
diff --git a/mysql-test/suite/wsrep/r/alter_table_innodb.result b/mysql-test/suite/wsrep/r/alter_table_innodb.result
new file mode 100644
index 00000000000..85017cec6e0
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/alter_table_innodb.result
@@ -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;
diff --git a/mysql-test/suite/wsrep/r/binlog_format.result b/mysql-test/suite/wsrep/r/binlog_format.result
index 5b8da51f829..d996371c056 100644
--- a/mysql-test/suite/wsrep/r/binlog_format.result
+++ b/mysql-test/suite/wsrep/r/binlog_format.result
@@ -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.
diff --git a/mysql-test/suite/wsrep/r/foreign_key.result b/mysql-test/suite/wsrep/r/foreign_key.result
new file mode 100644
index 00000000000..c8407480f17
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/foreign_key.result
@@ -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;
diff --git a/mysql-test/suite/wsrep/r/mdev_6832.result b/mysql-test/suite/wsrep/r/mdev_6832.result
new file mode 100644
index 00000000000..43894a6ec49
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/mdev_6832.result
@@ -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.
diff --git a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result
new file mode 100644
index 00000000000..c00a0c73ce3
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result
@@ -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;
diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
index 73b84574056..8ddba797d7c 100644
--- a/mysql-test/suite/wsrep/r/variables.result
+++ b/mysql-test/suite/wsrep/r/variables.result
@@ -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.
diff --git a/mysql-test/suite/wsrep/suite.pm b/mysql-test/suite/wsrep/suite.pm
index 3e8962d09d6..7b3b2db6836 100644
--- a/mysql-test/suite/wsrep/suite.pm
+++ b/mysql-test/suite/wsrep/suite.pm
@@ -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;
diff --git a/mysql-test/suite/wsrep/t/alter_table_innodb.opt b/mysql-test/suite/wsrep/t/alter_table_innodb.opt
new file mode 100644
index 00000000000..1e84570d7f6
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/alter_table_innodb.opt
@@ -0,0 +1 @@
+--wsrep-on=0
diff --git a/mysql-test/suite/wsrep/t/alter_table_innodb.test b/mysql-test/suite/wsrep/t/alter_table_innodb.test
new file mode 100644
index 00000000000..ca06be02a85
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/alter_table_innodb.test
@@ -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;
diff --git a/mysql-test/suite/wsrep/t/binlog_format.opt b/mysql-test/suite/wsrep/t/binlog_format.opt
index beae84b3862..e3f2470c6e5 100644
--- a/mysql-test/suite/wsrep/t/binlog_format.opt
+++ b/mysql-test/suite/wsrep/t/binlog_format.opt
@@ -1 +1 @@
---log-bin
+--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm://
diff --git a/mysql-test/suite/wsrep/t/binlog_format.test b/mysql-test/suite/wsrep/t/binlog_format.test
index 99d34873512..a2dc8542322 100644
--- a/mysql-test/suite/wsrep/t/binlog_format.test
+++ b/mysql-test/suite/wsrep/t/binlog_format.test
@@ -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.
diff --git a/mysql-test/suite/wsrep/t/foreign_key.opt b/mysql-test/suite/wsrep/t/foreign_key.opt
new file mode 100644
index 00000000000..e3f2470c6e5
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/foreign_key.opt
@@ -0,0 +1 @@
+--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm://
diff --git a/mysql-test/suite/wsrep/t/foreign_key.test b/mysql-test/suite/wsrep/t/foreign_key.test
new file mode 100644
index 00000000000..71f6076a1d7
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/foreign_key.test
@@ -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;
+
diff --git a/mysql-test/suite/wsrep/t/mdev_6832.opt b/mysql-test/suite/wsrep/t/mdev_6832.opt
new file mode 100644
index 00000000000..459a9702707
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mdev_6832.opt
@@ -0,0 +1 @@
+--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1 --wsrep_causal_reads=ON
diff --git a/mysql-test/suite/wsrep/t/mdev_6832.test b/mysql-test/suite/wsrep/t/mdev_6832.test
new file mode 100644
index 00000000000..9efccface57
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mdev_6832.test
@@ -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.
diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test
new file mode 100644
index 00000000000..100e09d3afb
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test
@@ -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
diff --git a/mysql-test/suite/wsrep/t/pool_of_threads.opt b/mysql-test/suite/wsrep/t/pool_of_threads.opt
index 76b95d050d1..814417e5b0f 100644
--- a/mysql-test/suite/wsrep/t/pool_of_threads.opt
+++ b/mysql-test/suite/wsrep/t/pool_of_threads.opt
@@ -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
diff --git a/mysql-test/suite/wsrep/t/pool_of_threads.test b/mysql-test/suite/wsrep/t/pool_of_threads.test
index e133ddf35dd..dbf429e3f01 100644
--- a/mysql-test/suite/wsrep/t/pool_of_threads.test
+++ b/mysql-test/suite/wsrep/t/pool_of_threads.test
@@ -1,4 +1,5 @@
---source include/have_wsrep_enabled.inc
+--source include/have_wsrep.inc
+--source include/have_binlog_format_row.inc
--echo
--echo #
diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test
index 98045e2b014..ef795ca9cfa 100644
--- a/mysql-test/suite/wsrep/t/variables.test
+++ b/mysql-test/suite/wsrep/t/variables.test
@@ -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.