File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -585,6 +585,27 @@ def test_drop_column(self):
585
585
finally :
586
586
self .resetBinLog ()
587
587
588
+ def test_alter_column (self ):
589
+ self .stream .close ()
590
+ self .execute ("CREATE TABLE test_drop_column (id INTEGER(11), data VARCHAR(50))" )
591
+ self .execute ("INSERT INTO test_drop_column VALUES (1, 'A value')" )
592
+ self .execute ("COMMIT" )
593
+ # this is a problem only when column is added in position other than at the end
594
+ self .execute ("ALTER TABLE test_drop_column ADD COLUMN another_data VARCHAR(50) AFTER id" )
595
+ self .execute ("INSERT INTO test_drop_column VALUES (2, 'Another value', 'A value')" )
596
+ self .execute ("COMMIT" )
597
+
598
+ self .stream = BinLogStreamReader (
599
+ self .database ,
600
+ server_id = 1024 ,
601
+ only_events = (WriteRowsEvent ,),
602
+ )
603
+ event = self .stream .fetchone () # insert with two values
604
+ # both of these asserts fail because of issue underlying proble described in issue #118
605
+ self .assertEqual (event .rows [0 ]["values" ]["data" ], 'A value' )
606
+ self .assertNotEqual (event .rows [0 ]["values" ]["another_data" ], 'A value' )
607
+ self .stream .fetchone () # insert with three values
608
+
588
609
589
610
class TestGtidBinLogStreamReader (base .PyMySQLReplicationTestCase ):
590
611
def setUp (self ):
You can’t perform that action at this time.
0 commit comments