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):
55
55
return True
56
56
return False
57
57
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
+
58
64
def connect_conn_control (self , db ):
59
65
if self .conn_control is not None :
60
66
self .conn_control .close ()
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
+ import unittest
2
3
3
4
from pymysqlreplication .tests import base
4
5
from pymysqlreplication import BinLogStreamReader
@@ -542,6 +543,11 @@ def test_drop_table(self):
542
543
543
544
544
545
class 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
+
545
551
def test_read_query_event (self ):
546
552
query = "CREATE TABLE test (id INT NOT NULL, data VARCHAR (50) NOT NULL, PRIMARY KEY (id))"
547
553
self .execute (query )
You can’t perform that action at this time.
0 commit comments