Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 75d4892

Browse files
committedSep 19, 2023
fix: add ignoredEvents in TestDataTypeVersion8
1 parent 6c6bbce commit 75d4892

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed
 

‎pymysqlreplication/tests/test_data_type.py

+19-15
Original file line numberDiff line numberDiff line change
@@ -895,21 +895,8 @@ def test_mariadb_only_status_vars(self):
895895

896896

897897
class TestDataTypeVersion8(base.PyMySQLReplicationPercona8TestCase):
898-
def test_partition_id(self):
899-
if not self.isMySQL80AndMore():
900-
self.skipTest("Not supported in this version of MySQL")
901-
create_query = "CREATE TABLE test (id INTEGER) \
902-
PARTITION BY RANGE (id) ( \
903-
PARTITION p0 VALUES LESS THAN (1), \
904-
PARTITION p1 VALUES LESS THAN (2), \
905-
PARTITION p2 VALUES LESS THAN (3), \
906-
PARTITION p3 VALUES LESS THAN (4), \
907-
PARTITION p4 VALUES LESS THAN (5) \
908-
)"
909-
insert_query = "INSERT INTO test (id) VALUES(3)"
910-
event = self.create_and_insert_value(create_query, insert_query)
911-
self.assertEqual(event.extra_data_type, 1)
912-
self.assertEqual(event.partition_id, 3)
898+
def ignoredEvents(self):
899+
return [GtidEvent, PreviousGtidsEvent]
913900

914901
def create_and_insert_value(self, create_query, insert_query):
915902
self.execute(create_query)
@@ -934,6 +921,23 @@ def create_and_insert_value(self, create_query, insert_query):
934921
self.assertIsInstance(event, WriteRowsEvent)
935922
return event
936923

924+
def test_partition_id(self):
925+
if not self.isMySQL80AndMore():
926+
self.skipTest("Not supported in this version of MySQL")
927+
create_query = "CREATE TABLE test (id INTEGER) \
928+
PARTITION BY RANGE (id) ( \
929+
PARTITION p0 VALUES LESS THAN (1), \
930+
PARTITION p1 VALUES LESS THAN (2), \
931+
PARTITION p2 VALUES LESS THAN (3), \
932+
PARTITION p3 VALUES LESS THAN (4), \
933+
PARTITION p4 VALUES LESS THAN (5) \
934+
)"
935+
insert_query = "INSERT INTO test (id) VALUES(3)"
936+
event = self.create_and_insert_value(create_query, insert_query)
937+
self.assertEqual(event.extra_data_type, 1)
938+
self.assertEqual(event.partition_id, 3)
939+
940+
937941

938942
if __name__ == "__main__":
939943
unittest.main()

0 commit comments

Comments
 (0)
Please sign in to comment.