File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -563,6 +563,28 @@ def test_drop_table(self):
563563
564564 self .assertEqual ([], event .rows )
565565
566+ def test_drop_column (self ):
567+ self .stream .close ()
568+ self .execute ("CREATE TABLE test_drop_column (id INTEGER(11), data VARCHAR(50))" )
569+ self .execute ("INSERT INTO test_drop_column VALUES (1, 'A value')" )
570+ self .execute ("COMMIT" )
571+ self .execute ("ALTER TABLE test_drop_column DROP COLUMN data" )
572+ self .execute ("INSERT INTO test_drop_column VALUES (2)" )
573+ self .execute ("COMMIT" )
574+
575+ self .stream = BinLogStreamReader (
576+ self .database ,
577+ server_id = 1024 ,
578+ only_events = (WriteRowsEvent ,),
579+ )
580+ try :
581+ self .stream .fetchone () # insert with two values
582+ self .stream .fetchone () # insert with one value
583+ except Exception as e :
584+ self .fail ("raised unexpected exception: {exception}" .format (exception = e ))
585+ finally :
586+ self .resetBinLog ()
587+
566588
567589class TestGtidBinLogStreamReader (base .PyMySQLReplicationTestCase ):
568590 def setUp (self ):
You can’t perform that action at this time.
0 commit comments