| 1 |
--source include/galera_cluster.inc |
| 2 |
--source include/have_innodb.inc |
| 3 |
|
| 4 |
# |
| 5 |
# Test Streaming Replication + LOAD DATA |
| 6 |
# |
| 7 |
|
| 8 |
--let $wsrep_trx_fragment_size_orig = `SELECT @@wsrep_trx_fragment_size` |
| 9 |
SET SESSION wsrep_trx_fragment_size = 512; |
| 10 |
|
| 11 |
# Create a file for LOAD DATA with 20K entries |
| 12 |
--perl |
| 13 |
open(FILE, ">", "$ENV{'MYSQLTEST_VARDIR'}/tmp/galera_sr_load_data.csv") or die; |
| 14 |
foreach my $i (1..20000) { |
| 15 |
print FILE "$i\n"; |
| 16 |
} |
| 17 |
EOF |
| 18 |
|
| 19 |
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; |
| 20 |
|
| 21 |
# Record wsrep_last_committed as it was before LOAD DATA |
| 22 |
--connection node_2 |
| 23 |
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` |
| 24 |
|
| 25 |
--connection node_1 |
| 26 |
--disable_query_log |
| 27 |
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/galera_sr_load_data.csv' INTO TABLE t1; |
| 28 |
--enable_query_log |
| 29 |
|
| 30 |
--connection node_2 |
| 31 |
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` |
| 32 |
|
| 33 |
SELECT COUNT(*) = 20000 FROM t1; |
| 34 |
# LOAD-ing 20K rows causes 3 commits to be registered |
| 35 |
--disable_query_log |
| 36 |
--eval SELECT $wsrep_last_committed_after - $wsrep_last_committed_before = 3 AS wsrep_last_committed_diff |
| 37 |
--enable_query_log |
| 38 |
|
| 39 |
--connection node_1 |
| 40 |
|
| 41 |
DROP TABLE t1; |