-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport partition tests from 10.0-galera.
- Loading branch information
Nirbhay Choubey
committed
Aug 20, 2015
1 parent
98bebad
commit ccd39b2
Showing
4 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
mysql-test/suite/galera/r/galera_var_load_data_splitting.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; | ||
SET GLOBAL wsrep_load_data_splitting = TRUE; | ||
SELECT COUNT(*) = 95000 FROM t1; | ||
COUNT(*) = 95000 | ||
1 | ||
wsrep_last_committed_diff | ||
1 | ||
SET GLOBAL wsrep_load_data_splitting = 1;; | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# MDEV#4953 Galera: DELETE from a partitioned table is not replicated | ||
# | ||
USE test; | ||
CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2; | ||
INSERT INTO t1 VALUES (1,100), (2,200); | ||
SELECT * FROM t1; | ||
pk i | ||
2 200 | ||
1 100 | ||
DELETE FROM t1; | ||
SELECT * FROM t1; | ||
pk i | ||
|
||
# On node_1 | ||
SELECT * FROM t1; | ||
pk i | ||
|
||
# On node_2 | ||
SELECT * FROM t1; | ||
pk i | ||
DROP TABLE t1; | ||
# End of test |
38 changes: 38 additions & 0 deletions
38
mysql-test/suite/galera/t/galera_var_load_data_splitting.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--source include/galera_cluster.inc | ||
--source include/have_innodb.inc | ||
|
||
--let $wsrep_load_data_splitting_orig = `SELECT @@wsrep_load_data_splitting` | ||
|
||
# Create a file for LOAD DATA with 95K entries | ||
--perl | ||
open(FILE, ">", "$ENV{'MYSQLTEST_VARDIR'}/tmp/galera_var_load_data_splitting.csv") or die; | ||
foreach my $i (1..95000) { | ||
print FILE "$i\n"; | ||
} | ||
EOF | ||
|
||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; | ||
|
||
# Record wsrep_last_committed as it was before LOAD DATA | ||
--connection node_2 | ||
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` | ||
|
||
SET GLOBAL wsrep_load_data_splitting = TRUE; | ||
--disable_query_log | ||
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/galera_var_load_data_splitting.csv' INTO TABLE t1; | ||
--enable_query_log | ||
|
||
--connection node_2 | ||
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` | ||
|
||
SELECT COUNT(*) = 95000 FROM t1; | ||
|
||
# LOAD-ing 95K rows causes 10 commits to be registered | ||
--disable_query_log | ||
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 10 AS wsrep_last_committed_diff; | ||
--enable_query_log | ||
|
||
--connection node_1 | ||
--eval SET GLOBAL wsrep_load_data_splitting = $wsrep_load_data_splitting_orig; | ||
|
||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--source include/galera_cluster.inc | ||
--source include/have_innodb.inc | ||
--source include/have_partition.inc | ||
|
||
--echo # | ||
--echo # MDEV#4953 Galera: DELETE from a partitioned table is not replicated | ||
--echo # | ||
|
||
USE test; | ||
CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2; | ||
INSERT INTO t1 VALUES (1,100), (2,200); | ||
SELECT * FROM t1; | ||
|
||
DELETE FROM t1; | ||
SELECT * FROM t1; | ||
|
||
--echo | ||
--echo # On node_1 | ||
--connection node_1 | ||
SELECT * FROM t1; | ||
|
||
--echo | ||
--echo # On node_2 | ||
--connection node_2 | ||
SELECT * FROM t1; | ||
|
||
# Cleanup | ||
DROP TABLE t1; | ||
|
||
--source include/galera_end.inc | ||
--echo # End of test |