Skip to content

Commit 741e036

Browse files
author
Arthur Gautier
committed
broken test, fixup event ordering
If create table is before we fetch the gtid from mysql, then the create table should not appear in the replication stream. Fetch gtid, THEN create table. Only one event should be in the stream (the create table) Signed-off-by: Arthur Gautier <baloo@gandi.net>
1 parent c61d2b3 commit 741e036

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pymysqlreplication/tests/test_basic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,11 +810,12 @@ def test_position_gtid(self):
810810
query = "COMMIT;"
811811
self.execute(query)
812812

813-
query = "CREATE TABLE test2 (id INT NOT NULL, data VARCHAR (50) NOT NULL, PRIMARY KEY (id))"
814-
self.execute(query)
815813
query = "SELECT @@global.gtid_executed;"
816814
gtid = self.execute(query).fetchone()[0]
817815

816+
query = "CREATE TABLE test2 (id INT NOT NULL, data VARCHAR (50) NOT NULL, PRIMARY KEY (id))"
817+
self.execute(query)
818+
818819
self.stream.close()
819820
self.stream = BinLogStreamReader(
820821
self.database, server_id=1024, blocking=True, auto_position=gtid,

0 commit comments

Comments
 (0)