Skip to content

Commit fbfa2d6

Browse files
committed
feat : added check mysql 8.0.16
1 parent 6c4c93b commit fbfa2d6

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

pymysqlreplication/bitmap.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# fmt: off
12
bitCountInByte = [
23
0,
34
1,
@@ -256,6 +257,7 @@
256257
7,
257258
8,
258259
]
260+
# fmt: on
259261

260262

261263
# Calculate total bit counts in a bitmap

pymysqlreplication/tests/base.py

+7
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ def isMySQL8014AndMore(self):
8484
return True
8585
return version == 8.0 and version_detail >= 14
8686

87+
def isMySQL8016AndMore(self):
88+
version = float(self.getMySQLVersion().rsplit(".", 1)[0])
89+
version_detail = int(self.getMySQLVersion().rsplit(".", 1)[1])
90+
if version > 8.0:
91+
return True
92+
return version == 8.0 and version_detail >= 16
93+
8794
def isMariaDB(self):
8895
if self.__is_mariaDB is None:
8996
self.__is_mariaDB = (

pymysqlreplication/tests/benchmark.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ def consume_events():
2525
only_events=[UpdateRowsEvent],
2626
only_tables=["test"],
2727
)
28-
start = time.clock()
28+
start = time.perf_counter()
2929
i = 0.0
3030
for binlogevent in stream:
3131
i += 1.0
3232
if i % 1000 == 0:
33-
print(f"{i / (time.clock()- start)} event by seconds ({i} total)")
33+
print(f"{i / (time.perf_counter()- start)} event by seconds ({i} total)")
3434

3535
stream.close()
3636

0 commit comments

Comments
 (0)