Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: check 'is_mariadb' when trying to set 'mariadb-related variable(mariadb_slave_capability)' to master #559

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pymysqlreplication/binlogstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,10 @@ def __connect_to_stream(self):
# Mariadb, when it tries to replace GTID events with dummy ones. Given that this library understands GTID
# events, setting the capability to 4 circumvents this error.
# If the DB is mysql, this won't have any effect so no need to run this in a condition
cur = self._stream_connection.cursor()
cur.execute("SET @mariadb_slave_capability=4")
cur.close()
if self.is_mariadb:
cur = self._stream_connection.cursor()
cur.execute("SET @mariadb_slave_capability=4")
cur.close()

self._register_slave()

Expand Down