|
19 | 19 | from pymysqlreplication._compat import text_type
|
20 | 20 |
|
21 | 21 |
|
22 |
| -__all__ = ["TestDataType"] |
| 22 | +__all__ = ["TestDataType", "TestDataTypeVersion8"] |
23 | 23 |
|
24 | 24 |
|
25 | 25 | def to_binary_dict(d):
|
@@ -894,5 +894,23 @@ def test_mariadb_only_status_vars(self):
|
894 | 894 | self.assertEqual(event.query, create_query)
|
895 | 895 |
|
896 | 896 |
|
| 897 | +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) |
| 913 | + |
| 914 | + |
897 | 915 | if __name__ == "__main__":
|
898 | 916 | unittest.main()
|
0 commit comments