File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ def isMySQL56AndMore(self):
5555 return True
5656 return False
5757
58+ @property
59+ def supportsGTID (self ):
60+ if not self .isMySQL56AndMore ():
61+ return False
62+ return self .execute ("SELECT @@global.gtid_mode " ).fetchone ()[0 ] == "ON"
63+
5864 def connect_conn_control (self , db ):
5965 if self .conn_control is not None :
6066 self .conn_control .close ()
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2+ import unittest
23
34from pymysqlreplication .tests import base
45from pymysqlreplication import BinLogStreamReader
@@ -542,6 +543,11 @@ def test_drop_table(self):
542543
543544
544545class TestGtidBinLogStreamReader (base .PyMySQLReplicationTestCase ):
546+ def setUp (self ):
547+ super (TestGtidBinLogStreamReader , self ).setUp ()
548+ if not self .supportsGTID :
549+ raise unittest .SkipTest ("database does not support GTID, skipping GTID tests" )
550+
545551 def test_read_query_event (self ):
546552 query = "CREATE TABLE test (id INT NOT NULL, data VARCHAR (50) NOT NULL, PRIMARY KEY (id))"
547553 self .execute (query )
You can’t perform that action at this time.
0 commit comments