Skip to content

Commit 54d66cc

Browse files
committed
add tests for new decimal data type
1 parent 4ae1f1f commit 54d66cc

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

pymysqlreplication/tests/test_data_type.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,31 @@ def test_decimal_long_values(self):
5858
event = self.create_and_insert_value(create_query, insert_query)
5959
self.assertEqual(event.rows[0]["values"]["test"], Decimal("42000.123456"))
6060

61+
def test_decimal_long_values_1(self):
62+
create_query = "CREATE TABLE test (\
63+
test DECIMAL(20,10) \
64+
)"
65+
insert_query = "INSERT INTO test VALUES(9000000001.123456)"
66+
event = self.create_and_insert_value(create_query, insert_query)
67+
self.assertEqual(event.rows[0]["values"]["test"], Decimal("9000000001.123456"))
68+
69+
def test_decimal_long_values_1(self):
70+
create_query = "CREATE TABLE test (\
71+
test DECIMAL(20,10) \
72+
)"
73+
insert_query = "INSERT INTO test VALUES(9000000123.123456)"
74+
event = self.create_and_insert_value(create_query, insert_query)
75+
self.assertEqual(event.rows[0]["values"]["test"], Decimal("9000000123.123456"))
76+
77+
def test_decimal_long_values_2(self):
78+
create_query = "CREATE TABLE test (\
79+
test DECIMAL(20,10) \
80+
)"
81+
insert_query = "INSERT INTO test VALUES(9000000123.0000012345)"
82+
event = self.create_and_insert_value(create_query, insert_query)
83+
self.assertEqual(event.rows[0]["values"]["test"],
84+
Decimal("9000000123.0000012345"))
85+
6186
def test_decimal_negative_values(self):
6287
create_query = "CREATE TABLE test (\
6388
test DECIMAL(20,10) \

0 commit comments

Comments
 (0)