Skip to content

Commit 8597170

Browse files
author
Nirbhay Choubey
committed
Added test for MDEV#4953.
1 parent 2f90221 commit 8597170

File tree

4 files changed

+54
-17
lines changed

4 files changed

+54
-17
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# MDEV#4953 Galera: DELETE from a partitioned table is not replicated
3+
#
4+
USE test;
5+
CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
6+
INSERT INTO t1 VALUES (1,100), (2,200);
7+
SELECT * FROM t1;
8+
pk i
9+
2 200
10+
1 100
11+
DELETE FROM t1;
12+
SELECT * FROM t1;
13+
pk i
14+
15+
# On node_1
16+
SELECT * FROM t1;
17+
pk i
18+
19+
# On node_2
20+
SELECT * FROM t1;
21+
pk i
22+
DROP TABLE t1;
23+
# End of test
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--source include/galera_cluster.inc
2+
--source include/have_innodb.inc
3+
--source include/have_partition.inc
4+
5+
--echo #
6+
--echo # MDEV#4953 Galera: DELETE from a partitioned table is not replicated
7+
--echo #
8+
9+
USE test;
10+
CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
11+
INSERT INTO t1 VALUES (1,100), (2,200);
12+
SELECT * FROM t1;
13+
14+
DELETE FROM t1;
15+
SELECT * FROM t1;
16+
17+
--echo
18+
--echo # On node_1
19+
--connection node_1
20+
SELECT * FROM t1;
21+
22+
--echo
23+
--echo # On node_2
24+
--connection node_2
25+
SELECT * FROM t1;
26+
27+
# Cleanup
28+
DROP TABLE t1;
29+
30+
--source include/galera_end.inc
31+
--echo # End of test

sql/ha_partition.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,17 +1284,8 @@ class ha_partition :public handler
12841284
}
12851285
#ifdef WITH_WSREP
12861286
virtual int wsrep_db_type() const;
1287-
#if 0
1288-
// TODO: Verify : https://mariadb.atlassian.net/browse/MDEV-4953
1289-
void wsrep_reset_files()
1290-
{
1291-
for (uint i=0; i < m_tot_parts; i++)
1292-
m_file[i]->ha_start_of_new_statement();
1293-
}
1294-
#endif
12951287
#endif /* WITH_WSREP */
12961288

1297-
12981289
friend int cmp_key_rowid_part_id(void *ptr, uchar *ref1, uchar *ref2);
12991290
};
13001291

sql/table.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4019,14 +4019,6 @@ void TABLE::init(THD *thd, TABLE_LIST *tl)
40194019
insert_values= 0;
40204020
fulltext_searched= 0;
40214021
file->ft_handler= 0;
4022-
#if 0
4023-
#ifdef WITH_WSREP
4024-
if (file->ht->db_type == DB_TYPE_PARTITION_DB)
4025-
{
4026-
((ha_partition*)file)->wsrep_reset_files();
4027-
}
4028-
#endif
4029-
#endif
40304022
reginfo.impossible_range= 0;
40314023
created= TRUE;
40324024
cond_selectivity= 1.0;

0 commit comments

Comments
 (0)