Skip to content

Commit 3b95812

Browse files
committed
fix: capitalize sql statements
1 parent 62a009c commit 3b95812

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: pymysqlreplication/binlogstream.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def __connect_to_stream(self):
302302
# we support it
303303
if self.__use_checksum:
304304
cur = self._stream_connection.cursor()
305-
cur.execute("set @master_binlog_checksum= @@global.binlog_checksum")
305+
cur.execute("SET @master_binlog_checksum= @@global.binlog_checksum")
306306
cur.close()
307307

308308
if self.slave_uuid:
@@ -323,7 +323,7 @@ def __connect_to_stream(self):
323323
# master_heartbeat_period is nanoseconds
324324
heartbeat = int(heartbeat * 1000000000)
325325
cur = self._stream_connection.cursor()
326-
cur.execute("set @master_heartbeat_period= %d" % heartbeat)
326+
cur.execute("SET @master_heartbeat_period= %d" % heartbeat)
327327
cur.close()
328328

329329
# When replicating from Mariadb 10.6.12 using binlog coordinates, a slave capability < 4 triggers a bug in

Diff for: pymysqlreplication/tests/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,16 @@ def set_sql_mode(self):
106106
"""set sql_mode to test with same sql_mode (mysql 5.7 sql_mode default is changed)"""
107107
version = float(self.getMySQLVersion().rsplit('.', 1)[0])
108108
if version == 5.7:
109-
self.execute("set @@sql_mode='NO_ENGINE_SUBSTITUTION'")
109+
self.execute("SET @@sql_mode='NO_ENGINE_SUBSTITUTION'")
110110

111111
def bin_log_format(self):
112-
query = "select @@binlog_format"
112+
query = "SELECT @@binlog_format"
113113
cursor = self.execute(query)
114114
result = cursor.fetchone()
115115
return result[0]
116116

117117
def bin_log_basename(self):
118-
cursor = self.execute('select @@log_bin_basename')
118+
cursor = self.execute('SELECT @@log_bin_basename')
119119
bin_log_basename = cursor.fetchone()[0]
120120
bin_log_basename = bin_log_basename.split("/")[-1]
121121
return bin_log_basename

0 commit comments

Comments
 (0)