From aff1496da77344a25e0584685e46a5c79f445bbc Mon Sep 17 00:00:00 2001 From: siddontang Date: Tue, 10 Nov 2015 08:40:24 +0800 Subject: [PATCH] ddl: fix column test panic. --- ddl/column_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ddl/column_test.go b/ddl/column_test.go index ca50aa4814..809b2e35bd 100644 --- a/ddl/column_test.go +++ b/ddl/column_test.go @@ -511,7 +511,10 @@ func (s *testIndexSuite) TestAddColumn(c *C) { return } - s.checkAddOrDropColumn(c, col.State, ctx, d, tblInfo, handle, col, row, defaultColValue, false) + ctx1 := testNewContext(c, d) + defer ctx.FinishTxn(false) + + s.checkAddOrDropColumn(c, col.State, ctx1, d, tblInfo, handle, col, row, defaultColValue, false) if col.State == model.StatePublic { checkOK = true } @@ -572,10 +575,13 @@ func (s *testIndexSuite) TestDropColumn(c *C) { t := testGetTable(c, d, s.dbInfo.ID, tblInfo.ID).(*tables.Table) col := testGetColumn(t, colName) if col == nil { + checkOK = true return } - s.checkAddOrDropColumn(c, col.State, ctx, d, tblInfo, handle, col, row, defaultColValue, true) + ctx1 := testNewContext(c, d) + defer ctx.FinishTxn(false) + s.checkAddOrDropColumn(c, col.State, ctx1, d, tblInfo, handle, col, row, defaultColValue, true) if col.State == model.StateNone { checkOK = true