@@ -74,9 +74,9 @@ func newTestWorkspace() *testWorkspace {
7474 return & testWorkspace {}
7575}
7676
77- func (txn * testWorkspace ) StartStatement () {
77+ func (txn * testWorkspace ) StartStatement (sql string ) {
7878 if txn .start {
79- panic ("BUG: StartStatement called twice" )
79+ panic (fmt . Sprintf ( "BUG: StartStatement called twice, sql: %s" , sql ) )
8080 }
8181 txn .start = true
8282 txn .incr = false
@@ -177,7 +177,7 @@ func TestWorkspace(t *testing.T) {
177177 convey .So (
178178 func () {
179179 wsp := newTestWorkspace ()
180- wsp .StartStatement ()
180+ wsp .StartStatement ("" )
181181 wsp .EndStatement ()
182182 },
183183 convey .ShouldNotPanic ,
@@ -196,8 +196,8 @@ func TestWorkspace(t *testing.T) {
196196 convey .So (
197197 func () {
198198 wsp := newTestWorkspace ()
199- wsp .StartStatement ()
200- wsp .StartStatement ()
199+ wsp .StartStatement ("" )
200+ wsp .StartStatement ("" )
201201 },
202202 convey .ShouldPanic ,
203203 )
@@ -217,7 +217,7 @@ func TestWorkspace(t *testing.T) {
217217 convey .So (
218218 func () {
219219 wsp := newTestWorkspace ()
220- wsp .StartStatement ()
220+ wsp .StartStatement ("" )
221221 err := wsp .IncrStatementID (context .TODO (), false )
222222 convey .So (err , convey .ShouldBeNil )
223223 //incr twice
@@ -231,7 +231,7 @@ func TestWorkspace(t *testing.T) {
231231 convey .So (
232232 func () {
233233 wsp := newTestWorkspace ()
234- wsp .StartStatement ()
234+ wsp .StartStatement ("" )
235235 err := wsp .RollbackLastStatement (context .TODO ())
236236 convey .So (err , convey .ShouldBeNil )
237237 },
@@ -242,7 +242,7 @@ func TestWorkspace(t *testing.T) {
242242 convey .So (
243243 func () {
244244 wsp := newTestWorkspace ()
245- wsp .StartStatement ()
245+ wsp .StartStatement ("" )
246246 err := wsp .IncrStatementID (context .TODO (), false )
247247 convey .So (err , convey .ShouldBeNil )
248248 err = wsp .RollbackLastStatement (context .TODO ())
@@ -484,7 +484,7 @@ func Test_rollbackStatement(t *testing.T) {
484484 NeedToBeCommittedInActiveTransaction (& tree.Insert {}), convey .ShouldBeFalse )
485485 convey .So (txnOp != nil && ! ses .IsDerivedStmt (), convey .ShouldBeTrue )
486486 //called incrStatement
487- txnOp .GetWorkspace ().StartStatement ()
487+ txnOp .GetWorkspace ().StartStatement ("" )
488488 err = txnOp .GetWorkspace ().IncrStatementID (ctx , false )
489489 convey .So (err , convey .ShouldBeNil )
490490 ec .stmt = & tree.Insert {}
@@ -514,7 +514,7 @@ func Test_rollbackStatement(t *testing.T) {
514514 NeedToBeCommittedInActiveTransaction (& tree.Insert {}), convey .ShouldBeFalse )
515515 convey .So (txnOp != nil && ! ses .IsDerivedStmt (), convey .ShouldBeTrue )
516516 //called incrStatement
517- txnOp .GetWorkspace ().StartStatement ()
517+ txnOp .GetWorkspace ().StartStatement ("" )
518518 err = txnOp .GetWorkspace ().IncrStatementID (ctx , false )
519519 convey .So (err , convey .ShouldBeNil )
520520 ec .stmt = & tree.Insert {}
@@ -671,7 +671,7 @@ func Test_rollbackStatement5(t *testing.T) {
671671 NeedToBeCommittedInActiveTransaction (& tree.Insert {}), convey .ShouldBeFalse )
672672 convey .So (txnOp != nil && ! ses .IsDerivedStmt (), convey .ShouldBeTrue )
673673 //called incrStatement
674- txnOp .GetWorkspace ().StartStatement ()
674+ txnOp .GetWorkspace ().StartStatement ("" )
675675 err = txnOp .GetWorkspace ().IncrStatementID (ctx , false )
676676 convey .So (err , convey .ShouldBeNil )
677677 ec .stmt = & tree.Insert {}
@@ -710,7 +710,7 @@ func Test_rollbackStatement6(t *testing.T) {
710710 NeedToBeCommittedInActiveTransaction (& tree.Insert {}), convey .ShouldBeFalse )
711711 convey .So (txnOp != nil && ! ses .IsDerivedStmt (), convey .ShouldBeTrue )
712712 //called incrStatement
713- txnOp .GetWorkspace ().StartStatement ()
713+ txnOp .GetWorkspace ().StartStatement ("" )
714714 err = txnOp .GetWorkspace ().IncrStatementID (ctx , false )
715715 convey .So (err , convey .ShouldBeNil )
716716 ec .stmt = & tree.Insert {}
@@ -745,7 +745,7 @@ func Test_rollbackStatement6(t *testing.T) {
745745 NeedToBeCommittedInActiveTransaction (& tree.Insert {}), convey .ShouldBeFalse )
746746 convey .So (txnOp != nil && ! ses .IsDerivedStmt (), convey .ShouldBeTrue )
747747 //called incrStatement
748- txnOp .GetWorkspace ().StartStatement ()
748+ txnOp .GetWorkspace ().StartStatement ("" )
749749 err = txnOp .GetWorkspace ().IncrStatementID (ctx , false )
750750 convey .So (err , convey .ShouldBeNil )
751751 ec .stmt = & tree.Insert {}
0 commit comments